Advertisement
hjaltiatlason

WSL2_Install_and_config_guide

Aug 5th, 2020 (edited)
325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. WSL - Install and configuration guide
  2. =====================================
  3. 1) WSL Install : https://docs.microsoft.com/en-us/windows/wsl/install-win10
  4. #Before installing any Linux distributions on Windows, you must enable the "Windows Subsystem for Linux" optional feature.
  5.  
  6. 2) Optional step - Setup Docker desktop with WSL 2 backend: https://docs.docker.com/docker-for-windows/wsl/
  7.  
  8. 3) WSL configuration (after wsl install)
  9. #create symbolic link # Source: https://florianbrinkmann.com/en/ssh-key-and-the-windows-subsystem-for-linux-3436/
  10. mkdir /mnt/c/Users/user/.ssh
  11. ln -s /mnt/c/Users/user/.ssh ~/.ssh
  12.  
  13. # Create /etc/wsl.conf with the following content. # source: https://gist.github.com/shakahl/8b6c969768b3a54506c0fc4905d729a0
  14. [automount]
  15. enabled = true
  16. root = /mnt/
  17. options = "uid=1000,gid=1000,umask=22,fmask=11,metadata"
  18. mountFsTab = true
  19. options = "metadata"
  20.  
  21. [network]
  22. generateHosts = true
  23. generateResolvConf = true
  24.  
  25. [interop]
  26. enabled = true
  27. appendWindowsPath = true
  28.  
  29. #Set correct permissions.
  30. sudo chmod 0644 /etc/wsl.conf
  31.  
  32. #Now restart the shell.
  33.  
  34. 4) Optional step - disable the beep in bash # Source: https://stackoverflow.com/questions/36724209/disable-beep-of-linux-bash-on-windows-10 you need to uncomment (or add if not already there) the line "set bell-style none" in your /etc/inputrc file.
  35.  
  36. 5) Optional Step - Setup an SSH-agent: https://medium.com/@pscheit/use-an-ssh-agent-in-wsl-with-your-ssh-setup-in-windows-10-41756755993e
  37. or follow this wiki: https://wiki.archlinux.org/index.php/SSH_keys#Keychain
  38.  
  39. 6) Other resources i found useful:
  40. https://stackoverflow.com/questions/24154816/git-bash-could-not-open-a-connection-to-your-authentication-agent
  41. https://www.reddit.com/r/bashonubuntuonwindows/comments/982une/sshagent_across_multiple_sessions_such_as_in_tmux/
  42. https://github.com/docker/for-mac/issues/3785
  43. https://devblogs.microsoft.com/commandline/chmod-chown-wsl-improvements/
  44.  
  45. 7) Troubleshooting
  46. #After restart or logout i sometimes need to enter this command to mount /mnt/c and enable .ssh folder redirect
  47. sudo umount /mnt/c
  48. sudo mount -t drvfs C: /mnt/c -o metadata
  49.  
  50. 8) Ubuntu with XFCE GUI Setup
  51. https://github.com/davidbombal/wsl2/blob/main/ubuntu_gui_youtube
  52.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement