Last active
June 24, 2024 21:32
-
-
Save sgtoj/f82990bcd9e89db49b84e2d2e70b281d to your computer and use it in GitHub Desktop.
Ubuntu for Windows: Mounting C: Drive to WSL's Root
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# allow `mount` cmd without password | |
echo "$USER ALL=NOPASSWD: /bin/mount" | (sudo su -c 'EDITOR="tee -a" visudo') | |
# add the mount directive to `fstab` | |
sudo mkdir -p /c | |
sudo sh -c "echo '/mnt/c /c none bind' >> /etc/fstab" | |
# update to `.bashrc` to auto mount at login | |
echo "sudo mount -a" >> ~/.bashrc | |
# now reload it | |
source ~/.bashrc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Works for me
(wsl 1, Win 10 pro, Version 10.0.18363.1500, Ubuntu 20.04.2 LTS)