-
Notifications
You must be signed in to change notification settings - Fork 822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enabling systemd on wsl2 under 22h2 results in extreemly bad performance (suspect some kind of io issue) #9029
Comments
i should add, its pretty obvious that these are related, but as to what to do to resolve it im posting here in case someone else has encountered this or the devs have any ideas :D I am of course also exploring all avenues i can think of :D [ 64.333963] systemd-journald[53]: Failed to read journal file /var/log/journal/d15c41973ea392736c6e42d15dfa8736/user-1000.journal for rotation, trying to move it out of the way: Device or resource busy |
Thank you for reporting this @exitdown. Based on the output I'm wondering if systemd-journald is causing the delay. I wonder if disabling this unit will help with the boot time.
And see if that makes a difference ? |
it doesn't seem to. tried below and rebooted. same symtpom. attached my full dmesg for what its worth lol vinny@spendyz:/mnt/c/Users/vinny/Desktop$ sudo systemctl disable systemd-journald.service real 1m30.093s unfortunately it appears ubuntu jammy decided that logs aren't importnat /var/log/messages and var/log/syslog dont exist hahah. I'm going to look at installling some sort of syslog facility to see if we can find anything further, keen for any suggestions, thanks again! p.s windows is able to access my linux filesystem with no issues using the $wsl method. in fact, i tried to unmount it and was unsuccessful in figuring out how. as per link ot 9013
|
im thinking this may actually be just the symptom and the problem is more fundamental. services are started vinny@spendyz:/mnt/c/Users/vinny/Desktop$ ps axu | grep systemd but yeah. massive wait before doing anyuthing. lack of logging is hard. also just for completeness i also had a [network] entry generateresolvconf=false for reasons. Im gun disable that now and test just in case. will update if it changes anything |
Not sure if this helps: I switched to systemd=true a couple days ago, and it worked perfectly. However, I tried to install |
interesting, do you have any logs in /var/log/system.log etc, or a dmesg? woudl be interesting if you managed to induce the same issue, as that would give us something in common to look for haha |
Same issue here. I have to disable systemd to make wsl usable again. Of course, |
Same issue here after installing the ubuntu desktop. |
@fabiovin70 @j999yp @fty1777 just to help xref in case theres something obvious, can you guys all do this: from cmd: from linux: dmesg eg:
|
|
I'm having the same issue, I'm also running W11 and Docker Desktop. I know there are some other issues too, but ever since I've enabled systemd, Ubuntu has gotten very slow. Even the time required to run sudo apt-get update has gone from seconds to minutes and this was an otherwise clean installation of Ubuntu with only gnome installed and systemd enabled. EDIT: it's also worthwhile to note that if I disable systemd (by removing it from /etc/wsl.conf) Ubuntu is fast again.
|
I feel like this topic has kind lost the attention, but maybe rightfully so because there don't seem to be many people with this issue. I'm considering trying to run Ubuntu in Docker (running on wsl2) instead as a workaround. |
@exitdown: We have fixed an issue where systemd would time out at boot in WSL 1.0.0.0. Can you confirm if updating to 1.0.0 resolved the issue for you ? |
@OneBlue i use wsl for work so i cant test right now but will test asap and let you know! thanks! |
@OneBlue , I have updated to version 1.0.0 and retested, it didn't fix it for me. I can provide more logs/info/outputs if needed. |
Yes, please do. /logs |
Hello! Could you please provide more logs to help us better diagnose your issue? To collect WSL logs, download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:
The scipt will output the path of the log file once done. Once completed please upload the output files to this Github issue. Click here for more info on logging Thank you! |
@OneBlue unfortunately i still experience the same behavior once i properly enable the wsl.conf boot directive. |
@OneBlue I'm trying to gather the logs but my corp for some reason has decided to lock me out of my admin rights (required for the script) so it's going to be a while. I'll need to wait for them to get back to me... |
ill run the collection script once i finished for the day. |
The issue isn't fixed. I kept that script running while doing |
i think its a great idea for us to all post the logs being asked for as a consistent sample and xref could identify something obvious that individually we're missing. like p9p driver etc.. i gut feel think its something odd between open handles and ownership with windows. but im just inventing fancy sounding words and have no clue what im talking about. |
@OneBlue my logs attached too. |
I don't have any logs to contribute but here's what has solved it for me. Output of wsl --version
Enabling systemd caused it, when enabled, to use 100% CPU usage. After futzing around with various posts, the following seems to fix the issue.
Problem disappears. Other posts had suggested to mask the acpid service in systemd but uninstalling it does the same thing. |
@GoonerW Yes it worked. Thanks for the help! |
While it’s in a failing state, journalctl —verify complains about corruption in a couple of journal files. When in a fixed state, no such corruption is present.
|
@exitdown, can you share the content of acpid shouldn't start in WSL, it should be under the condition: |
For reference, on my unmodified Win10 system not having issues, the above configuration is present. systemd lists it as disabled
I can only assume that Win11 would have the same configuration as I doubt Ubuntu 22.04 would configure/install different versions of packages based on the underlying Windows version. |
interesting. so first thing my acpid.service doesnt exist cos i uninstalled it using apt-get. ill reinstal it to test. my output shows the config is enabled... which is definitely why its causing problems. vinny@spendyz:/usr/lib/systemd/system$ systemctl list-unit-files |grep acpi |
Is |
unsure, it didnt exist, i just reinstalled acpid, and am fighting with it now becauase its super slow again. will see if i can fix it - seeing stuff like this rn
|
GNU nano 6.2 /usr/lib/systemd/system/acpid.service [Unit] [Service] [Install] |
That is exactly what mine looks like. I wonder what's causing it to start under Win11 but not Win10? |
i dont see why its starting either...
|
commening out wantedby in all 3 acpid references still doesnt stop the issue. so im gun shrug, and go back to disabled systemd till i can be bothered uninstalling acpid again, then tryign to troubleshoot the lack of xserver availiabilty. i suspect it will relate to acpid.sockets lol |
I have a similar issue, but it persists even after disabling systemd. The main similarity is that dmesg shows that it is ususally the An interesting thing that I have accidentally noticed is that starting wsl as an admin (e.g. by opening the Ubuntu prompt in an Administrator Terminal) brings back the start-up time to the 4-5 seconds that I used to get before this issue began. Maybe others could also try if they get a similar behavior, as it might help in narrowing down the problem. |
implies relationship to permissions. perhaps write access, iowait for write access times out eventually causing the dmesg ? |
For me running wsl as Admin also reduces boot time by 9 seconds. I have systemd disabled. I had it enabled for short testing period. I do not know if this triggered the problem. Or if the problem did not exist before enabling systemd. UPDATE: After reboot of Windows - later today - WSL boot time is back to normal even without using Admin (not trying systemd again). |
Had the same issue with Ubuntu but works fine with "OracleLinux_8_5" after Ubuntu uninstall.
|
Recently I have the same issue where WSL2 is extremely slow starting up. Ranging from 30 seconds to 2 minutes. An excerpt from my
Versions:
I have also disabled the |
I did |
well shit. you fixed it! how could this have been so simple? ahahahaha after undoing all my changes everything works. i just had to also add in a "ConditionVirtualization=!container" directive in /lib/systemd/system/systemd-remount-fs.service and literally everythings working! so it was write issue to acpi events log? |
ill close this tommo, so far everythigns looking good. snaps are working ! <sarcasm> yayyyyy </sarcasm> |
closing. thanks to @Segment0895 |
I'm a 70 year old Aussie, 40 year IT experienced IT hack and frustrated Windows 11 Beta Insider running Ubuntu 22.04 on WSL2. I just used this forum to fix "failed to read server status: transport endpoint", slow logging in and systemctl status problems. This was after several attempts at re-installing systemd, trying genie, etc. etc. Best fix was "cd /etc/acpi/ && mv events events-OLD && mkdir events". I assume that this turns off acpi event logging that was timing out systemd. Thank you heaps "exitdown"! You have made my day mate! |
I added in add in a "ConditionVirtualization=!container" directive in /lib/systemd/system/systemd-remount-fs.service, did sudo systemctl daemon-reload, then sudo systemctl start systemd-remount-fs, then systemctl status systemd-remount-fs. Output was Condition check resulted in Remount Root and Kernel File Systems being skipped. To get the service mounted I then changed to to ConditionVirtualization=container in /lib/systemd/system/systemd-remount-fs.service. Then commented out LABEL=cloudimg-rootfs in /etc/fstab. Then sudo systemctl daemon-reload, then sudo systemctl start systemd-remount-fs, then systemctl status systemd-remount-fs. Output was then Aug 29 08:18:31 wsl-ubuntu-22.04-lts systemd[1]: Starting Remount Root and Kernel File Systems... |
Relevant information from https://github.com/arkane-systems/genie/wiki/Systemd-units-known-to-be-problematic-under-WSL There are two ways to solve this one: either find the device the root partition is mounted from (probably /dev/sdb, but check first), and label it appropriately: sudo e2label /dev/sdb cloudimg-rootfs |
This worked for me! /sbin/init went from 100% cpu to nothing, and sudo commands work quickly again - had the same Transport endpoint issue when doing sudo systemctl status systemd-journald previously but now it works |
Great to hear mlaughan that the fix helped. I'm pretty sure that systemd was consuming too many resources logging acpi events when running on WSL. |
Great to hear mlaughan that the fix helped. I'm pretty sure that systemd was consuming too many resources logging acpi events when running on WSL.
Get Outlook for Android<https://aka.ms/ghei36>
…________________________________
|
PS C:\Users\vinny> wsl.exe --status
Default Distribution: Ubuntu-18.04
Default Version: 2
PS C:\Users\vinny> wsl.exe --version
WSL version: 0.70.0.0
Kernel version: 5.15.68.1
WSLg version: 1.0.45
MSRDC version: 1.2.3575
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.674
PS C:\Users\vinny>
PS C:\Users\vinny> cmd /c ver
Microsoft Windows [Version 10.0.22621.674]
[ 2.332217] pci c8cf:00:00.0: BAR 0: assigned [mem 0x9ffe0c000-0x9ffe0cfff 64bit]
[ 2.332925] pci c8cf:00:00.0: BAR 2: assigned [mem 0x9ffe0d000-0x9ffe0dfff 64bit]
[ 2.333681] pci c8cf:00:00.0: BAR 4: assigned [mem 0x9ffe0e000-0x9ffe0efff 64bit]
[ 2.593421] systemd-journald[53]: Received client request to flush runtime journal.
[ 2.602469] systemd-journald[53]: File /var/log/journal/d15c41973ea392736c6e42d15dfa8736/system.journal corrupted or uncleanly shut down, renaming and replacing.
[ 49.167961] hv_balloon: Max. dynamic memory size: 8108 MB
[ 64.333963] systemd-journald[53]: Failed to read journal file /var/log/journal/d15c41973ea392736c6e42d15dfa8736/user-1000.journal for rotation, trying to move it out of the way: Device or resource busy
[ 92.928099] Failed to query system state: Transport endpoint is not connected
[ 92.928586] WSL (2) ERROR: InitCreateSessionLeader:1064: /sbin/init failed to start within
[ 92.928588] 10000ms
[ 92.929369] WSL (2) WARNING: /etc/resolv.conf updating disabled in /etc/wsl.conf
[ 92.942334] WSL (2): Creating login session for vinny
root@spendyz:/home/vinny#
root@spendyz:/home/vinny# uname -a
Linux spendyz 5.15.68.1-microsoft-standard-WSL2 #1 SMP Mon Sep 19 19:14:52 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
root@spendyz:/home/vinny# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy
root@spendyz:/home/vinny#
system takes about 2 min to become avaiable once starting, and about 2 min to sudo etc.
only exhibited after enabling systemd=true [boot] flag in wsl.conf
removing this flag issue goes away
id love to use systemd if possible, so any suggestions on troubleshooting steps would be greatly appreciated :D
thanks!
The text was updated successfully, but these errors were encountered: