Skip to content

Latest commit

 

History

History
65 lines (46 loc) · 1.72 KB

README.md

File metadata and controls

65 lines (46 loc) · 1.72 KB

Windows Subsystem for Linux

How to install WSL2?

winget does not support it, run as follows

How to open current directory in WSL2 with Windows Explorer?

In WSL shell

explorer.exe .

How to move on Windows folder from WSL2?

z "$(wslpath 'G:\GoogleDrive')"

Login shell has been broken in WSL2

wsl --user root

Setup NixOS on WSL2

Use NixOS.
You should remember that does not have /etc/nixos/hardware-configuration.nix and the default username is nixos.

wsl.exe --install --no-distribution
curl -OL "https://github.com/nix-community/NixOS-WSL/releases/download/2311.5.3/nixos-wsl.tar.gz"
wsl.exe --import NixOS $env:USERPROFILE\NixOS\ nixos-wsl.tar.gz
wsl.exe --distribution "NixOS"
sudo nix-channel --update
sudo nixos-generate-config
# Remove the entry for /mnt/wslg/distro if that has empty `device = "";`. See https://github.com/Misterio77/nix-starter-configs/issues/49

nix --extra-experimental-features 'nix-command flakes' shell 'github:NixOS/nixpkgs/nixos-24.05#git' \
  --command sudo nixos-rebuild switch \
  --flake 'github:kachick/dotfiles#wsl' \
  --show-trace
sudo reboot now

Setup Ubuntu on WSL2

wsl.exe --install "Ubuntu-24.04"
wsl.exe --distribution "Ubuntu-24.04"

Setup nix and activate home-manager as written in README with kachick@wsl

Disable cgroup v1 as putting .wslconfig and restart for setting up podman

winit-conf.exe generate -path=windows/WSL/.wslconfig  > %UserProfile%\.wslconfig
wsl.exe --shutdown