windows_subsystem_for_linux_setup
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
windows_subsystem_for_linux_setup [2019/08/02 11:47] – created tkbletsc | windows_subsystem_for_linux_setup [2024/12/22 19:54] (current) – tkbletsc | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Windows Subsystem for Linux (WSL) ====== | ||
+ | |||
I'll grudgingly admit that Windows Subsytem for Linux isn't bad like I thought it would be. That said, there are several things you might want to do to make it more livable. | I'll grudgingly admit that Windows Subsytem for Linux isn't bad like I thought it would be. That said, there are several things you might want to do to make it more livable. | ||
- | ====== Enabling WSL ====== | + | ===== Enabling WSL ===== |
- | First, to enable WSL at all ([[https://docs.microsoft.com/en-us/windows/wsl/install-win10|from here]]), in adminstrator powershell: | + | |
- | | + | First, to enable WSL at all, in adminstrator powershell: |
- | Then, it still being Windows, | + | |
+ | < | ||
+ | wsl --install | ||
+ | |||
+ | </ | ||
+ | |||
+ | Then, it still being Windows, you have to restart. If it hangs or is weird, restart and try again. If it is then weird in a new way, restart, and try again. | ||
+ | |||
+ | ===== Installing distro ===== | ||
+ | |||
+ | To get Ubuntu 24.04: | ||
+ | |||
+ | < | ||
+ | wsl --install ubuntu-24.04 | ||
+ | |||
+ | </ | ||
+ | |||
+ | To see other distros: | ||
+ | |||
+ | < | ||
+ | wsl --list --online | ||
+ | |||
+ | </ | ||
+ | ===== Making it Launchy-launchable ===== | ||
+ | |||
+ | The distro will be installed as an " | ||
+ | |||
+ | * Make a shortcut of the " | ||
+ | |||
+ | ===== Update plus basic packages ===== | ||
+ | |||
+ | The default package set is actually not bad. But this will update and install what's missing: | ||
+ | |||
+ | < | ||
+ | sudo apt update | ||
+ | sudo apt dist-upgrade | ||
+ | sudo apt install lynx links binutils zip unzip gdb build-essential dos2unix | ||
+ | |||
+ | </ | ||
+ | |||
+ | Bigger list: | ||
+ | |||
+ | < | ||
+ | sudo apt install at bc bzip2 default-jdk dos2unix fdisk ffmpeg build-essential gdb hashdeep valgrind lynx links wget curl ltrace strace manpages-dev mdadm nasm net-tools netcat nmap pv spim zip unzip whois x11-apps | ||
+ | |||
+ | </ | ||
+ | |||
+ | ===== Symlinks ===== | ||
+ | |||
+ | To get to places easily: | ||
+ | |||
+ | < | ||
+ | ln -s / | ||
+ | |||
+ | </ | ||
+ | |||
+ | ===== "Open Linux Shell Here" context menu ===== | ||
+ | |||
+ | It turns out there already is one by default, but it only shows if you // | ||
+ | |||
+ | * Download and run " | ||
+ | * Run regedit using the tool | ||
+ | * In '' | ||
+ | |||
+ | ===== Run explorer from this directory | ||
+ | |||
+ | I'm used to saying '' | ||
+ | < | ||
+ | |||
+ | alias start=" | ||
+ | |||
+ | </ | ||
+ | |||
+ | ===== Keyboard scrolling ===== | ||
+ | |||
+ | By default, there' | ||
+ | < | ||
+ | |||
+ | # | ||
+ | |||
+ | +PgUp:: | ||
+ | Send {WheelUp} | ||
+ | Return | ||
+ | |||
+ | +PgDn:: | ||
+ | Send {WheelDown} | ||
+ | Return | ||
+ | |||
+ | # | ||
+ | |||
+ | </ | ||
+ | |||
+ | ===== Ensure | ||
+ | |||
+ | I just upgraded to Ubuntu 22.04 WSL, and found that some IO requests | ||
+ | |||
+ | < | ||
+ | C:\ on /mnt/c type drvfs (rw, | ||
+ | |||
+ | </ | ||
+ | |||
+ | And the new one had: | ||
+ | |||
+ | < | ||
+ | C:\ on /mnt/c type drvfs (rw, | ||
+ | |||
+ | </ | ||
+ | |||
+ | The fix is to set UID for the WSL mounts. This can be done by editing / | ||
+ | |||
+ | < | ||
+ | [automount] | ||
+ | options = " | ||
+ | |||
+ | </ | ||
- | ====== | + | ===== Script to mount *all* drives |
- | Windows Store is a garbage zone. Here's the spell for skipping that part ([[https:// | + | |
- | Other URLs exist for other distros; you're on your own for that. | + | |
- | ====== Making it Launchy-launchable ====== | + | By default, WSL just mounts physical drives around at boot. This script mounts all drives |
- | The distro will be installed as an " | + | |
- | ====== Basic packages ====== | + | < |
- | The default package set is actually not bad. But here's what's missing: | + | for DRV in `wmic.exe logicaldisk get name | grep : | awk '{print tolower($1)}'` ; do |
- | sudo apt install lynx links binutils zip unzip gdb | + | MNT=/ |
+ | if mount | grep -q $MNT ; then | ||
+ | echo $MNT already mounted | ||
+ | else | ||
+ | | ||
+ | sudo mount -t drvfs $DRV $MNT | ||
+ | fi | ||
+ | done | ||
+ | </ | ||
windows_subsystem_for_linux_setup.1564771652.txt.gz · Last modified: 2019/08/02 11:47 by tkbletsc