wsl --install only works if WSL is not installed at all:
The above command only works if WSL is not installed at all, if you run wsl --install and see the WSL help text, please try running wsl --list --online to see a list of available distros and run wsl --install -d to install a distro. To uninstall WSL, see Uninstall legacy version of WSL or unregister or uninstall a Linux distribution.
You will need to edit the wsl.conf file to ensure systemd starts up on boot.
Add these lines to the /etc/wsl.conf (note you will need to run your editor with sudo privileges, e.g: sudo nano /etc/wsl.conf):
[boot]
systemd=true
And close out of the nano editor using CTRL+O to save and CTRL+X to exit.
Final steps
With the above steps done, close your WSL distro Windows and run wsl.exe --shutdown from PowerShell to restart your WSL instances. Upon launch you should have systemd running. You can check this with the command systemctl list-unit-files --type=service which should show your services’ status.
Installing WSL has gotten easier, need to update the sections.
See Install Ubuntu on WSL2 and get started with graphical applications.
This is important as not mentionned on that page above: https://learn.microsoft.com/en-us/windows/wsl/install
wsl --install
only works if WSL is not installed at all:So need to do this before trying:
Also add enabling systemd:
https://devblogs.microsoft.com/commandline/systemd-support-is-now-available-in-wsl/