Open Galmeno opened 4 years ago
You're right, there appears to be a bug. I'll fix this in my branch at diddledan/ubuntu-wsl2-systemd-script and file a PR shortly.
Maybe I'm wrong, I can't replicate this....
I flushed it, but I had other configs. Might depend on user running it.
fresh install of ubuntu 20.04 on wsl2, get's the endless loop for me as well
sleep: cannot read realtime clock: Invalid argument
Sleeping for 1 second to let systemd settle
sleep: cannot read realtime clock: Invalid argument
Sleeping for 1 second to let systemd settle
sleep: cannot read realtime clock: Invalid argument
This is not closed.
Same issue here. Fresh ubuntu 20 (wsl2). I tried the same installation on ubuntu 18, I don't get any loop - instead, there is an error and the terminal automatically closes.
I've mentioned it here: https://github.com/DamionGans/ubuntu-wsl2-systemd-script/issues/37#issuecomment-683871548
Just ran the script on Ubuntu-20.04 and I'm seeing the loop as well. I installed ubuntu-desktop and gnome before running the script. I will try uninstalling and running the script before installing anything in hopes that this fixes it. I'll return with the results of the retry.
No luck. Fresh 20.04-LTS install -> "apt update" -> "apt upgrade" -> "sudo bash ubuntu-wsl2-systemd-script.sh" leads to infinite "Sleeping for 1 second to let systemd settle" loop.
Any progress on this one? I'm still stuck on the endless systemd loop.
Got past the endless loop - missed the fact that Windows installs WSL1 by default and that I need to manually update it to WSL2. Now that this is complete, I'm banging my head against the wall of trying to get a GNOME session to start.
Just to say it happens here as well. Brand new laptop, freshly installed "Ubuntu" package from the app store and copied the lines on the Readme. but more like @MeachamusPrime , I don't have any other output in between.
same here, endless loop Ubuntu 20.04-LTS
Same here. WSL2, Ubuntu 18.04.
It seems bash.bashrc
is being called twice. I put a log statement in bash.bashrc
before calling start-systemd-namespace
# Start or enter a PID namespace in WSL2
echo "bash.bashrc: Calling /usr/sbin/start-systemd-namespace"
source /usr/sbin/start-systemd-namespace
and the output is:
C:\Users\Zardosht> wsl
bash.bashrc: Calling /usr/sbin/start-systemd-namespace
Sleeping for 1 second to let systemd settle
Last login: Sat Mar 6 19:32:14 CET 2021 on pts/0
Welcome to Ubuntu 18.04.5 LTS (GNU/Linux 5.4.72-microsoft-standard-WSL2 x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
System information as of Sat Mar 6 19:39:30 CET 2021
System load: 0.02 Processes: 10
Usage of /: 4.5% of 250.98GB Users logged in: 0
Memory usage: 0% IP address for eth0: 172.21.65.172
Swap usage: 0%
6 packages can be updated.
0 of these updates are security updates.
To see these additional updates run: apt list --upgradable
New release '20.04.2 LTS' available.
Run 'do-release-upgrade' to upgrade to it.
bash.bashrc: Calling /usr/sbin/start-systemd-namespace
I got an infinite loop too (with Ubuntu 20.04 LTS)
Same here ubuntu 20.04, using wsl2 (end goal to run gnome desktop)
Same here using WSL2 Ubuntu-20.04
This comment should help solve this issue.
How about I suggest we go ahead and we all first before using this script follow the instructions first in the comment created by @zardosht before we do anything else.
Issue still persists with Ubuntu 20.04 WSL2 as of August 2021. Never ending loop of "Sleep for 1 second to let systemd settle." Nothing to do but uninstall Ubuntu, reinstall, and don't try running this script again...
Not sure what config files I should try making changes to in order to revert back or fix the issue.
Hi! I had the same problem and then ended up completely abandoning this solution. Then I stumbled upon https://forum.snapcraft.io/t/running-snaps-on-wsl2-insiders-only-for-now/13033 which almost worked out of the box. A comment on this Reddit thread (comment by inspectulation) addresses some of the problems when trying to run this on Ubuntu 20.04: https://www.reddit.com/r/bashonubuntuonwindows/comments/gc8lle/usrsbindaemonize_no_such_file_or_directory/
After updating the scripts with the recommendations from the Reddit Thread, it worked! I created a new repo and put all of the scripts and documentation there: https://github.com/andraspatka/k3s-wsl The first part of the README.md explains how to set up systemd. You can ignore the part about k3s, that's not relevant to this topic.
Please note, that my repo is more of a documentation and doesn't (yet?) include any fancy bash script which automates the whole thing. But at least it works :)
The output of ps -efw looks like this:
UID PID PPID C STIME TTY TIME CMD
root 1 0 4 23:45 ? 00:00:00 /lib/systemd/systemd --system-unit=basic.target
root 2 0 0 23:45 pts/0 00:00:00 /bin/login -p -f
root 58 1 1 23:45 ? 00:00:00 /lib/systemd/systemd-journald
root 82 1 1 23:45 ? 00:00:00 /lib/systemd/systemd-udevd
root 83 82 0 23:45 ? 00:00:00 /lib/systemd/systemd-udevd
root 84 82 0 23:45 ? 00:00:00 /lib/systemd/systemd-udevd
systemd+ 85 1 1 23:45 ? 00:00:00 /lib/systemd/systemd-networkd
root 86 82 0 23:45 ? 00:00:00 /lib/systemd/systemd-udevd
root 87 82 0 23:45 ? 00:00:00 /lib/systemd/systemd-udevd
root 88 82 0 23:45 ? 00:00:00 /lib/systemd/systemd-udevd
root 89 82 0 23:45 ? 00:00:00 /lib/systemd/systemd-udevd
root 90 82 0 23:45 ? 00:00:00 /lib/systemd/systemd-udevd
root 91 82 0 23:45 ? 00:00:00 /lib/systemd/systemd-udevd
root 92 82 0 23:45 ? 00:00:00 /lib/systemd/systemd-udevd
root 93 82 0 23:45 ? 00:00:00 /lib/systemd/systemd-udevd
root 94 82 0 23:45 ? 00:00:00 /lib/systemd/systemd-udevd
root 95 82 0 23:45 ? 00:00:00 /lib/systemd/systemd-udevd
root 96 82 0 23:45 ? 00:00:00 /lib/systemd/systemd-udevd
root 97 82 0 23:45 ? 00:00:00 /lib/systemd/systemd-udevd
root 98 82 0 23:45 ? 00:00:00 /lib/systemd/systemd-udevd
root 99 82 0 23:45 ? 00:00:00 /lib/systemd/systemd-udevd
root 100 82 0 23:45 ? 00:00:00 /lib/systemd/systemd-udevd
root 101 82 0 23:45 ? 00:00:00 /lib/systemd/systemd-udevd
root 102 82 0 23:45 ? 00:00:00 /lib/systemd/systemd-udevd
root 103 82 0 23:45 ? 00:00:00 /lib/systemd/systemd-udevd
andras 324 2 1 23:45 pts/0 00:00:00 -bash
systemd+ 349 1 1 23:45 ? 00:00:00 /lib/systemd/systemd-resolved
systemd+ 350 1 1 23:45 ? 00:00:00 /lib/systemd/systemd-timesyncd
root 354 1 0 23:45 ? 00:00:00 /usr/lib/accountsservice/accounts-daemon
message+ 355 1 0 23:45 ? 00:00:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
root 356 1 0 23:45 ? 00:00:00 (savelog)
root 358 1 0 23:45 ? 00:00:00 /usr/sbin/irqbalance --foreground
root 359 1 1 23:45 ? 00:00:00 /usr/bin/python3 /usr/bin/networkd-dispatcher --run-startup-triggers
syslog 360 1 0 23:45 ? 00:00:00 /usr/sbin/rsyslogd -n -iNONE
root 361 1 16 23:45 ? 00:00:00 /usr/lib/snapd/snapd
root 362 1 1 23:45 ? 00:00:00 /lib/systemd/systemd-logind
root 363 1 1 23:45 ? 00:00:00 /usr/lib/udisks2/udisksd
root 379 1 0 23:45 ? 00:00:00 /usr/sbin/cron -f
daemon 388 1 0 23:45 ? 00:00:00 /usr/sbin/atd -f
root 404 1 0 23:45 ? 00:00:00 (agetty)
root 406 1 55 23:45 ? 00:00:01 /usr/local/bin/k3s server
root 421 1 0 23:45 ? 00:00:00 /usr/lib/policykit-1/polkitd --no-debug
root 422 1 1 23:45 ? 00:00:00 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
root 541 406 23 23:45 ? 00:00:00 containerd
andras 551 324 0 23:45 pts/0 00:00:00 ps -efw
Please let me know if this fixes the problem for you guys :)
Also, if your Ubuntu 20.04 in WSL is crashing, you can just simply delete the /usr/sbin/start-systemd-namespace
and /usr/sbin/enter-systemd-namespace
scripts. After that it should start as expected. I used this method a few times until I got the scripts right for Ubuntu 20.04
You can access the Ubuntu file system from Windows under \\wsl$
(enter it into Windows Explorer) or if that doesn't work then under C:\Users\<username>\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState
Source: https://askubuntu.com/questions/759880/where-is-the-ubuntu-file-system-root-directory-in-windows-subsystem-for-linux-an
I will check out your implementation @andraspatka - thx for sharing your approach (especially k3s intrigues me). Just to add to your comment:
While cd C:\Users\<username>\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\usr\sbin
works via CMD.exe - it did not under Powershell on a fresh install of Windows 10 Pro Stable/19044.1237 21H2.
The UNC \\wsl$
did neither resolve in Explorer.exe, nor in Powershell.
It was possible to del start-systemd-namespace
and del enter-systemd-namespace
to get rid of the loop, which might help the one or the other who did already put data into such install to recover it. Nonetheless (just for curiosity sake) i tried to apply your steps in https://github.com/andraspatka/k3s-wsl on top of that, but it didn't work out, a reset of Ubuntu via app-settings for Ubuntu in the System-setting was necessary (just a note - for those that like me like to work through the mudhole - that it was not succesful, lol).
Will try your tutorial now on a fresh WSL2 Ubuntu 20.04.
EDIT: While it was successful, it started to spit a proc/xx/ns-error after installing Docker Desktop for Windows. I cam e across a similar result before together with the Endless startup loop and could solve it only by using a custom kernel. If anyone has an idea or insights into the why, i would like to be enlightened - it is over my head, i gladly admit.
20.04 LTS, same issue 'Sleeping for 1 second to let systemd settle' . I have no choice but to uninstall and reinstall it."/(ㄒoㄒ)/~~
Running this made ubuntu endlessly loop with echo pausing one second to let ubuntu start.