A big thank you to everyone involved getting NixOS available on WSL!
(again, this probably only needed for the 22.05-5c211b47 release)
Only a minor change is necessary:
Unfortunately this was only apparent after failing first and combing through the issues (see them listed below), hence this post.
There are 4 closed issues regarding this:
#67: 21.11-d89f18a1 fails after initial import with
nsenter: failed to parse pid: '-p'
- #69: nsenter: failed to parse pid: ‘-p’
- #73: wsl: nsenter: failed to parse pid: ‘-p’
- #87: nsenter: failed to parse pid: ‘-p’
My issue was exactly what can be seen in #87 so this is what I had to do to fix it:
List available distros (in case you didn’t use the Quick start’s default of
wsl -l -v
Shut down NixOS (or whatever processes were running trying to start it)
wsl -t NixOS
Delete the NixOS distro
wsl --unregister NixOS
Go to the TL;DR section above, and follow the steps from there.
wsl subcommands / options for reference:
--list, -l [Options] Lists distributions. Options: --all List all distributions, including distributions that are currently being installed or uninstalled. --running List only distributions that are currently running. --quiet, -q Only show distribution names. --verbose, -v Show detailed information about all distributions. --online, -o Displays a list of available distributions for install with 'wsl.exe --install'. --set-default, -s <Distro> Sets the distribution as the default. --terminate, -t <Distro> Terminates the specified distribution. --unregister <Distro> Unregisters the distribution and deletes the root filesystem.