Skip to content

Instantly share code, notes, and snippets.

@rivy
Forked from sgtoj/persistent_c_mount_wsl.sh
Created December 23, 2017 23:35
Show Gist options
  • Select an option

  • Save rivy/dca3845e47f456cf0b6dd5291040479b to your computer and use it in GitHub Desktop.

Select an option

Save rivy/dca3845e47f456cf0b6dd5291040479b 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