How to mount windows 10 drive on WSL home directory?

Posted on

Problem :

I would like to mount drive D on /home directory in WSL while letting C drive to be mounted on /mnt or not mounting it at all. How can I do that?

Solution :

I figured it out. There is a setting to mount manually instead of automount.

To disable [automount] I should set enable key in wsl.conf to false.
Here is my /etc/wsl.conf:

[automount]
enabled=false
mountFsTab=true

Also, I should have added the following line to fstab.

D:  /home   drvfs   defaults    0 0

and it did work. Just do not forget to have .bashrc and .profile in your D drive.

Leave a Reply

Your email address will not be published.