Petter Holt Juliussen • Mail | Mastodon | GitHub | Letterboxd

for later reference.

Windows Subsystem for Linux

2022-03-04

Install WSL

Enable Windows Subsystem for Linux

  1. Open Turn Windows features on or off
  2. Check Windows Subsystem for Linux
  3. Click OK and Restart

Enable Virtual Machine Platform

  1. Open PowerShell as administrator
  2. Enable VMP:
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
  1. Restart

CLI

wsl -l -v
wsl --set-default-version 2

wslconfig /l
wslconfig /setdefault Debian

wsl --unregister <distroName>

Mounts

$ sudo umount /mnt/c
$ sudo mount -t drvfs C: /mnt/c -o metadata,uid=1000,gid=1000,umask=22,fmask=111

Users

$ sudo usermod -a -G sudo <user>
debian config --default-user <user>

Shell

$ sudo apt-get install zsh

$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Ensure zsh is executed by default:

# ~/.bashrc, after the first comments:
if test -t 1; then
exec zsh
fi

Show full path:

# ~/.oh-my-zsh/themes/robbyrussell.zsh-theme
PROMPT+=' %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)'
#                       ^ replace c with ~
source ~/.zshrc