0

I had an issue with my WSL after enabling systemd, it was stuck initializing. I have an arch distro set up, so this might be specific to that.

WSL-Version: 2.0.9.0
Kernelversion: 5.15.133.1-1
Windows 11

After searching for solutions online and looking at the services systemd was trying to start I found that "systemd-firstboot.service" was stuck on activating. I fixed this by killing the (irstboot) process it had started, after which

$ sudo systemctl status

Showed a degraded state, and restarting the service wasn't possible because the Firstboot condition wasn't met (which should have been the case before since I already used wsl before that)

I restarted my wsl with

PS $ wsl --shutdown
PS $ wsl

and voila systemd initialized without issue. I solved my issue with this, however is there another less crude way to solve this? What Parameter does systemd look at to determine if the system is booting for the first time?

1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Commented Dec 7, 2023 at 9:16

1 Answer 1

0

What Parameter does systemd look at to determine if the system is booting for the first time?

It checks whether /etc/machine-id is missing (or contains the value "uninitialized").

(Systemd itself will initialize it using systemd-machine-id-setup during boot, but I think WSL2 was supposed to do that automatically as well?)

You must log in to answer this question.

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