-
Notifications
You must be signed in to change notification settings - Fork 822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
changing mount point from /mnt/c to /c #1918
Comments
As a workaround you could possibly edit your sudoers file to allow any user to use access |
Why not just |
Yeah a soft link works, too. One minor gripe with a soft link is that "ls /c" doesn't work. You need "ls /c/". |
BTW, this ticket is to look into why /etc/fstab doesn't work. |
I imagine this is because WSL doesn't perform most normal Linux systemwide initialization. See #511 , for example. |
@raymod2 Here is the solution. # created as su to match /mnt/c
sudo mkdir -p /c
# update /etc/fstab; requires su
sudo sh -c "echo '/mnt/c /c none bind' >> /etc/fstab"
# reload fstab; requires su
sudo mount -a Ticket probably can be closed now. |
It's the It is tempting to dupe these all into #511 ("make Ref #1854 |
@therealkenc You are correct. I should have posted my answered after testing closing and relaunching a session. Once I noticed I was wrong, I started putting something together to as a work around to share with my team and others. |
My original solution is the proper linux solution. However, the solution currently does not work for Ubuntu for Windows because mounts are not auto loaded. See @therealkenc comments for more information. In the meantime, I have documented and posted a short step-by-step guide to implement a workaround. |
Ref #2636 |
There are some preparations required: * the user must be able to sudo mount --all without asking for su password add 'youruser ALL=NOPASSWD: /bin/mount, /bin/umount' to /etc/sudoers * mount points need to be added to /etc/fstab, e.g. /mnt/c /c none bind * mount points need to be created before mounting (e.g. sudo mkdir /c) * more info: microsoft/WSL#1918 (comment)
FYI this is now possible to do it with
OS Build: 17107.1000 |
@d1egoaz How to upgrade the latest OS build? The update center gave me " Version 1709, OS build 16299", seems not the one your had mentioned. |
/etc/wsl.conf allows you do do this in 1803. |
...where is that wsl.conf file supposed to be...? |
|
Years of using MSYS and MSYS2 has ingrained the habit of referring to the C: drive as "/c" but Bash on Windows uses "/mnt/c". A good solution is using a bind mount:
mkdir -p /c
sudo mount -o bind /mnt/c /c
However, this requires root and needs to be run every time you open a bash window. I tried using /etc/fstab for a persistent mount but I couldn't get it to work:
sudo sh -c "echo '/mnt/c /c none bind' >> /etc/fstab
The text was updated successfully, but these errors were encountered: