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 [2019/08/02 11:51] – 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 " | ||
- | ===== Basic packages ===== | + | ===== Update plus basic packages ===== |
- | The default package set is actually not bad. But here' | + | |
- | sudo apt install lynx links binutils zip unzip gdb | + | The default package set is actually not bad. But this will update and install |
+ | |||
+ | < | ||
+ | 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 in bash ===== | ||
+ | |||
+ | I'm used to saying '' | ||
+ | < | ||
+ | |||
+ | alias start=" | ||
+ | |||
+ | </ | ||
===== Keyboard scrolling ===== | ===== Keyboard scrolling ===== | ||
+ | |||
By default, there' | By default, there' | ||
< | < | ||
+ | |||
# | # | ||
Line 37: | 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 ===== | ||
+ | |||
+ | By default, WSL just mounts physical drives around at boot. This script mounts all drives Windows knows about to directories under /mnt: | ||
+ | |||
+ | < | ||
+ | for DRV in `wmic.exe logicaldisk get name | grep : | awk ' | ||
+ | MNT=/ | ||
+ | if mount | grep -q $MNT ; then | ||
+ | echo $MNT already mounted | ||
+ | else | ||
+ | sudo mkdir -p $MNT | ||
+ | sudo mount -t drvfs $DRV $MNT | ||
+ | fi | ||
+ | done | ||
+ | |||
+ | </ | ||
+ | |||
windows_subsystem_for_linux_setup.1564771868.txt.gz · Last modified: 2019/08/02 11:51 by tkbletsc