User Tools

Site Tools


windows_subsystem_for_linux_setup

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
windows_subsystem_for_linux_setup [2019/08/20 09:48] – [Run explorer from this directory in bash] tkbletscwindows_subsystem_for_linux_setup [2022/10/09 08:57] (current) – [Installing distro] tkbletsc
Line 12: Line 12:
  
 https://aka.ms/wsl-ubuntu-1804 https://aka.ms/wsl-ubuntu-1804
 +
 +https://aka.ms/wslubuntu2004
 +
 +https://aka.ms/wslubuntu2204
  
 Other URLs exist for other distros; you're on your own for that. Other URLs exist for other distros; you're on your own for that.
Line 23: Line 27:
   sudo apt update   sudo apt update
   sudo apt dist-upgrade   sudo apt dist-upgrade
-  sudo apt install lynx links binutils zip unzip gdb+  sudo apt install lynx links binutils zip unzip gdb build-essential dos2unix
  
 ===== Symlinks ===== ===== Symlinks =====
 To get to places easily: To get to places easily:
   ln -s /mnt/c/Users/$USER ~   ln -s /mnt/c/Users/$USER ~
-  sudo ln -s /mnt/c /c 
  
 ===== "Open Linux Shell Here" context menu ===== ===== "Open Linux Shell Here" context menu =====
Line 38: Line 41:
 ===== Run explorer from this directory in bash ===== ===== Run explorer from this directory in bash =====
 I'm used to saying ''start .'' to open an explorer in this directory. Using [[https://stackoverflow.com/questions/44245721/launching-explorer-from-wsl|this recipe]], you can add the following to ~/.bashrc to restore this functionality: I'm used to saying ''start .'' to open an explorer in this directory. Using [[https://stackoverflow.com/questions/44245721/launching-explorer-from-wsl|this recipe]], you can add the following to ~/.bashrc to restore this functionality:
-  alias start="cmd.exe /c start"+  alias start="powershell.exe /c start"
  
  
Line 55: Line 58:
  
 #IfWinActive #IfWinActive
 +</code>
 +
 +===== Script to mount *all* drives =====
 +By default, WSL just mounts physical drives around at boot. This script mounts all drives Windows knows about to directories under /mnt:
 +
 +<code>
 +for DRV in `wmic.exe logicaldisk get name | grep : | awk '{print tolower($1)}'` ; do
 +    MNT=/mnt/${DRV::1}
 +    if mount | grep -q $MNT ; then
 +        echo $MNT already mounted
 +    else
 +        sudo mkdir -p $MNT
 +        sudo mount -t drvfs $DRV $MNT
 +    fi
 +done
 </code> </code>
  
windows_subsystem_for_linux_setup.1566319687.txt.gz · Last modified: 2019/08/20 09:48 by tkbletsc

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki