Skip to content

Instantly share code, notes, and snippets.

View marcesher's full-sized avatar

Marc Esher marcesher

View GitHub Profile
@sgtoj
sgtoj / persistent_c_mount_wsl.sh
Last active January 29, 2024 06:11
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