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 revision Previous revision
Next revision
Previous revision
windows_subsystem_for_linux_setup [2019/08/20 09:45]
tkbletsc [Basic packages]
windows_subsystem_for_linux_setup [2021/04/27 10:00] (current)
tkbletsc
Line 37: Line 37:
  
 ===== Run explorer from this directory in bash ===== ===== Run explorer from this directory in bash =====
-I'm used to saying ''explorer .'' to open an explorer in this directory. For some reason, this doesn't work in WSL, even if I spell out the full path to explorer. However, [[https://stackoverflow.com/questions/44245721/launching-explorer-from-wsl|per 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 explorer="cmd.exe /c start"+  alias start="powershell.exe /c start"
  
  
Line 55: Line 55:
  
 #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.1566319519.txt.gz · Last modified: 2019/08/20 09:45 by tkbletsc