<p>This seems to be solved by adding a file called <em>/etc/wsl.conf</em> (in WSL) which contains:</p>
<blockquote>
<p>[automount]<br />
options = &quot;metadata&quot;</p>
</blockquote>
<p>This is equivalent to running the <code>sudo mount -t drvfs C: /mnt/c -o metadata</code> everytime you use WSL.</p>
<p>Also, make sure to set the right permissions to your Craft installation folder:</p>
<pre><code>chmod 777 ./.env
chmod 777 ./composer.lock
chmod 777 ./composer.json
sudo chmod -R 777 ./config
sudo chmod -R 777 ./storage
sudo chmod -R 777 ./vendor
sudo chmod -R 777 ./web &lt;- Or public, ...
</code></pre>

CC BY-SA 4.0
2022-02-16T11:37:00.747Z
2022-02-17T08:43:36.360Z
2022-02-17T08:43:36.360Z
Álvaro Franz
<p>Getting this error on a local Craft install with Nitro / Docker.</p>
<p><a href="https://i.sstatic.net/XWWe4.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/XWWe4.png" alt="enter image description here" /></a></p>
<p>I can get it fixed with:</p>
<blockquote>
<p>sudo umount /mnt/c<br />
sudo mount -t drvfs C: /mnt/c -o metadata</p>
</blockquote>
<p>This works until then the error appears again after a while.</p>
<p>Don't know why this happens. Any clue?</p>

<craft3>
chmod(): Operation not permitted using WSL2
# chmod(): Operation not permitted using WSL2

(Asked by: username_0 on 2022-02-16)

Getting this error on a local Craft install with Nitro / Docker.

[![enter image description here](https://i.sstatic.net/XWWe4.png)](https://i.sstatic.net/XWWe4.png)

I can get it fixed with:

> sudo umount /mnt/c  
> sudo mount -t drvfs C: /mnt/c -o metadata

This works until then the error appears again after a while.

Don't know why this happens. Any clue?

**Tags:** craft3

---

## 1 answers

### Answer by username_0 on 2022-02-16. Score: 3 | Accepted answer

This seems to be solved by adding a file called /etc/wsl.conf (in WSL) which contains:

[automount]
options = "metadata"

This is equivalent to running the sudo mount -t drvfs C: /mnt/c -o metadata everytime you use WSL.
Also, make sure to set the right permissions to your Craft installation folder:
chmod 777 ./.env
chmod 777 ./composer.lock
chmod 777 ./composer.json
sudo chmod -R 777 ./config
sudo chmod -R 777 ./storage
sudo chmod -R 777 ./vendor
sudo chmod -R 777 ./web <- Or public, ...


---

