After enabling Systemd per this answer in Ubuntu 22.04, sudo systemctl status
shows State: degraded
.
Additionally:
$ sudo systemctl --failed
UNIT LOAD ACTIVE SUB DESCRIPTION
● systemd-sysusers.service loaded failed failed Create System Users
LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.
1 loaded units listed.
How can I transition from degraded
to running
?
This is due to the current use of a symlink from
/dev/shm
to/run/shm
in WSL. There are several related Github issues:Among other things, this will cause any Systemd service that makes use of
LoadCredentials=
to fail. This impacts several other services on other distributions, butsystemd-sysusers
is the only default service under Ubuntu 22.10, at least, to make use of this.The workaround, as documented in #8996, is to create a new Systemd service that corrects the problem before any other Systemd units make use of that shared memory device.
Add the following:
Exit Ubuntu,
wsl --terminate <distro_name>
(orwsl --shutdown
), and restart.Confirm that
sudo systemctl status
now showsrunning
. If not:sudo systemctl status fix_wsl2_shm.service
shows that the service was loaded.findmnt /dev/shm
shows that it is mounted, or ifls -ld /dev/shm
shows that it is a symlink.