windows_subsystem_for_linux_setup
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| windows_subsystem_for_linux_setup [2021/04/27 09:59] – tkbletsc | windows_subsystem_for_linux_setup [2024/12/22 19:54] (current) – tkbletsc | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| ===== Enabling WSL ===== | ===== Enabling WSL ===== | ||
| - | First, to enable WSL at all ([[https:// | + | |
| - | | + | First, to enable WSL at all, in adminstrator powershell: |
| - | Then, it still being Windows, you have to restart. | + | |
| + | < | ||
| + | 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 ===== | ===== Installing distro ===== | ||
| - | Windows Store is a garbage zone. Here's the spell for skipping that part ([[https:// | ||
| - | https://aka.ms/ | + | To get Ubuntu 24.04: |
| - | Other URLs exist for other distros; you're on your own for that. | + | < |
| + | wsl --install ubuntu-24.04 | ||
| + | </ | ||
| + | |||
| + | To see other distros: | ||
| + | |||
| + | < | ||
| + | wsl --list --online | ||
| + | |||
| + | </ | ||
| ===== Making it Launchy-launchable ===== | ===== Making it Launchy-launchable ===== | ||
| + | |||
| The distro will be installed as an " | The distro will be installed as an " | ||
| + | |||
| * Make a shortcut of the " | * Make a shortcut of the " | ||
| ===== Update plus basic packages ===== | ===== Update plus basic packages ===== | ||
| + | |||
| The default package set is actually not bad. But this will update and install what's missing: | The default package set is actually not bad. But this will update and install what's missing: | ||
| - | | + | |
| - | sudo apt dist-upgrade | + | < |
| - | sudo apt install lynx links binutils zip unzip gdb | + | 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 ===== | ===== Symlinks ===== | ||
| + | |||
| To get to places easily: | To get to places easily: | ||
| - | | + | |
| - | sudo ln -s /mnt/c /c | + | < |
| + | ln -s / | ||
| + | |||
| + | </code> | ||
| ===== "Open Linux Shell Here" context menu ===== | ===== "Open Linux Shell Here" context menu ===== | ||
| - | It turns out there already is one by default, but it only shows if you //shift// right click. To make it always visible ([[https:// | + | |
| + | It turns out there already is one by default, but it only shows if you // | ||
| * Download and run " | * Download and run " | ||
| * Run regedit using the tool | * Run regedit using the tool | ||
| Line 37: | Line 71: | ||
| ===== Run explorer from this directory in bash ===== | ===== Run explorer from this directory in bash ===== | ||
| - | I'm used to saying '' | ||
| - | alias start=" | ||
| + | I'm used to saying '' | ||
| + | < | ||
| + | |||
| + | alias start=" | ||
| + | |||
| + | </ | ||
| ===== Keyboard scrolling ===== | ===== Keyboard scrolling ===== | ||
| + | |||
| By default, there' | By default, there' | ||
| < | < | ||
| + | |||
| # | # | ||
| Line 55: | Line 95: | ||
| # | # | ||
| + | |||
| + | </ | ||
| + | |||
| + | ===== Ensure Windows drives are writable ===== | ||
| + | |||
| + | I just upgraded to Ubuntu 22.04 WSL, and found that some IO requests to /mnt/c were getting permission denied. Upon investigating, | ||
| + | |||
| + | < | ||
| + | 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 ===== | ===== 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: | By default, WSL just mounts physical drives around at boot. This script mounts all drives Windows knows about to directories under /mnt: | ||
| Line 70: | Line 136: | ||
| fi | fi | ||
| done | done | ||
| + | |||
| </ | </ | ||
| + | |||
| + | |||
windows_subsystem_for_linux_setup.1619542746.txt.gz · Last modified: by tkbletsc
