Skip to content

Instantly share code, notes, and snippets.

@steffen-wirth
Forked from sgtoj/persistent_c_mount_wsl.sh
Created December 16, 2017 18:34
Show Gist options
  • Save steffen-wirth/93b7f1739d86564fa095cf1d49393aca to your computer and use it in GitHub Desktop.
Save steffen-wirth/93b7f1739d86564fa095cf1d49393aca to your computer and use it in GitHub Desktop.
Ubuntu for Windows: Mounting C: Drive to WSL's Root
# 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