How to mount windows 10 drive on WSL home directory?

11,394

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.

Share:
11,394

Related videos on Youtube

masec
Author by

masec

Updated on September 18, 2022

Comments

  • masec
    masec over 1 year

    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?

  • Wei Wang
    Wei Wang almost 5 years
    Does Windows 10 has to be up to a certain version? I have version 1709 (OS Build 16299.1268), with these in /etc/wsl.conf: [automount] // enabled = false // mountFsTab = true // ... and an /etc/fstab file, it doesn't seem to work.