WSL 🍻
I LOVE WSL!
I like windows's UI simple I can do jobs faster than mac and adding linux terminal on that is perfect work environment for me.
Some benefist of this setup:
- Use new windows terminal (best terminal ever) setting default terminal to wsl
- Run docker under wsl
- Vscode and see the wsl file system
- View Linux gui apps under wsl
- Runnable .exe files from terminal
There is still some cons, need to much more flexibility of the wsl machine like networking, passthrough devices.
Issues
Cannot execute windows binaries
Old trick, looks not needed anymore
sudo sh -c 'echo :WSLInterop:M::MZ::/init:PF > /usr/lib/binfmt.d/WSLInterop.conf'After shutdown and restart WSL, you can execute windows binaries.
wsl --shutdownWSL - hard disk got all space
First install Optimize-VHD and it is come with Microsoft-Hyper-V check powershell and if not exist than install it:
Remember to run powershell as administrator
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -AllOr just management tools:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Management-PowerShellThan in your ext4.vhdx file location run (this takes time):
Optimize-VHD -Path "C:\Users\rytsh\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu_42thkp1fnegsc\LocalState\ext4.vhdx" -Mode FullUse windirstat program easily to find big files https://windirstat.net/
xdg-open
Redirect xdg-open to powershell.exe start command, so you can open files from wsl terminal.
sudo tee /usr/local/bin/xdg-open <<EOF
#!/bin/sh
powershell.exe -c start "'\$@'"
EOF
sudo chmod +x /usr/local/bin/xdg-openhttps://stackoverflow.com/questions/56633006/open-windows-native-exe-program-via-xdg-open-in-wsl