3

I'm running a fully upgraded Windows 11 Enterprise host (version 22H2, build 22621.1702) and I have installed enabled WSL in the normal fashion (https://www.windows11.dev/ce7in/how-to-install-wsl2-and-linux-distros-on-windows-11-6od)

systemd is setup to start on boot in the /etc/wsl.conf file but it seems not to be working:

sudo systemctl status
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down

When I start a distro it prompts me in the first lines of the shell the following:

Windows Subsystem for Linux is now available in the Microsoft Store!
You can upgrade by running 'wsl.exe --update' or by visiting https://aka.ms/wslstorepage

If I try to run wsl.exe --update in the windows shell I get the following:

wsl.exe --update
Installing: Windows Subsystem for Linux
A specified logon session does not exist. It may already have been terminated.

Whats going on here?

Note: All of the above is run as Windows administrator.

6
  • 1
    Edit your question instead of answering the following question as a comment. I will not be notified of comments being submitted. What build of Windows 10 are you using exactly. You can use “winver” to determine this information. Likewise, is the machine connected to the internet, which is a requirement for the current version of WSL installed through the Windows Store. While it’s possible to install the current version of WSL on an offline install, it’s more complicated than you might think. The answers to these questions are necessary and important. Your probably running a WSL1 instance.
    – Ramhound
    Commented May 24, 2023 at 12:13
  • I already suspect you didn’t install the current version of WSL since only the version installed from the Microsoft Store supports systemd, which should be possible on Enterprise versions of Windows 11, but more complicated. Which is the reason understanding which build you have installed is important
    – Ramhound
    Commented May 24, 2023 at 12:17
  • Since I don’t have a lot of time download the msxi bundle package then install it with “ Add-AppxPackage Microsoft.WSL_1.1.3.0_x64_ARM64.msixbundle”, after you uninstall WSL through optional windows features it’s absolutely unnecessary.
    – Ramhound
    Commented May 24, 2023 at 12:30
  • @Ramhound, it says twice in my post that I'm running Windows 11. I have edited the post and included the version. The host is online. Commented May 25, 2023 at 6:55
  • If I download the latest version of WSL (github.com/microsoft/WSL/releases/tag/1.2.5) it asks me if I want to reinstall if I try the prior release 1.2.4 it says that I already have a newer version installed. So It's safe to say that WSL is at the newest version. Commented May 25, 2023 at 7:02

1 Answer 1

2

Your article doesn't mention the need to, in the Start > Turn Windows Features on and off dialog, to enable "Windows Subsystem for Linux". The Windows feature of "Virtual Machine Platform" might be enough. Better do this, if it wasn't done.

You rather need to follow the Microsoft article of Systemd support is now available in WSL!

Here are some important points from the article.

Ensuring you are on the right WSL version

This change is only available in the Microsoft Store version of WSL version 0.67.6 and higher. You can check your version number by running wsl --version. If that command fails then you are running the in-Windows version of WSL and need to upgrade to the Store version.

Set the systemd flag set in your WSL distro settings

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
6
  • Only the version of WSL installed through the Windows Store supports systemd, that version of WSL, does not require you to enable the optional Windows Feature Windows Subsystem for Linux. In fact, trying to install both versions of WSL will cause conflicts. I am not sure what exactly is your recomendation. The author already confirmed they modified wsl.conf to include the line you suggested.
    – Ramhound
    Commented May 24, 2023 at 14:05
  • Right, the old version should be uninstalled before installing the Store version.
    – harrymc
    Commented May 24, 2023 at 14:11
  • As mentioned in my post I have already altered the /etc/wsl.conf which also should imply that I must have enabled the "Windows Subsystem for Linux" feature. What I did forget to mention is that the command wsl --version doesn't work either. My wsl.exe version does not have that option, which circles around to the whole problem, that I can't seem to upgrade WSL. Commented May 25, 2023 at 6:46
  • @harrymc - that comment was for your post :-) As you can also see in the comments on my original question post I have the very latest WSL msix bundle installed. Commented May 25, 2023 at 7:05
  • I don't know what went wrong, and I'm trying not to make any suppositions. I suggest to uninstall your WSL version, clean up everything, turn off its feature, reboot a couple of times, then reinstall from the Microsoft Store.
    – harrymc
    Commented May 25, 2023 at 8:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .