DamionGans / ubuntu-wsl2-systemd-script

[Does not work anymore!] Script to enable systemd support on current Ubuntu WSL2 images
1.56k stars 382 forks source link

NOT WORKING!!! BUT WORKED :) #65

Open thusinh1969 opened 3 years ago

thusinh1969 commented 3 years ago

Script run OK. Restarted. Call systemctl:

blk-availability.service loaded active exited Availability of block devices dbus.service loaded active running D-Bus System Message Bus keyboard-setup.service loaded active exited Set the console keyboard layout polkit.service loaded active running Authorization Manager rtkit-daemon.service loaded active running RealtimeKit Scheduling Policy Service setvtrgb.service loaded active exited Set console scheme systemd-journal-flush.service loaded active exited Flush Journal to Persistent Storage systemd-journald.service loaded active running Journal Service systemd-logind.service loaded active running Login Service ● systemd-modules-load.service loaded failed failed Load Kernel Modules systemd-networkd-wait-online.service loaded active exited Wait for Network to be Configured systemd-networkd.service loaded active running Network Service systemd-sysctl.service loaded active exited Apply Kernel Variables systemd-tmpfiles-setup-dev.service loaded active exited Create Static Device Nodes in /dev systemd-tmpfiles-setup.service loaded active exited Create Volatile Files and Directories systemd-udev-trigger.service loaded active exited udev Coldplug all Devices systemd-udevd.service loaded active running udev Kernel Device Manager systemd-update-utmp.service loaded active exited Update UTMP about System Boot/Shutdown user@1000.service loaded active running User Manager for UID 1000

But I am able to install microk8s :) Weird !

Any hint ? Steve

def1nity commented 2 years ago

Had the same issue on wsl 2 + ubuntu 18.04...

First checked the service:

systemctl status systemd-modules-load.service ● systemd-modules-load.service - Load Kernel Modules Loaded: loaded (/lib/systemd/system/systemd-modules-load.service; static; vendor preset: enabled) Active: failed (Result: exit-code) since Fri 2022-02-04 11:40:46 EET; 8min ago Docs: man:systemd-modules-load.service(8) man:modules-load.d(5) Main PID: 57 (code=exited, status=1/FAILURE)

Feb 04 11:40:46 Prime systemd-modules-load[57]: Failed to lookup alias 'iscsi_tcp': Function not implemented Feb 04 11:40:46 Prime systemd-modules-load[57]: Failed to lookup alias 'ib_iser': Function not implemented Feb 04 11:40:46 Prime systemd[1]: systemd-modules-load.service: Main process exited, code=exited, status=1/FAILURE Feb 04 11:40:46 Prime systemd[1]: systemd-modules-load.service: Failed with result 'exit-code'. Feb 04 11:40:46 Prime systemd[1]: Failed to start Load Kernel Modules. Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.

Ran DEBUG for more info:

sudo SYSTEMD_LOG_LEVEL=debug /lib/systemd/systemd-modules-load

Found container virtualization wsl. apply: /etc/modules-load.d/modules.conf apply: /lib/modules-load.d/open-iscsi.conf load: iscsi_tcp Failed to lookup alias 'iscsi_tcp': Function not implemented load: ib_iser Failed to lookup alias 'ib_iser': Function not implemented

Problem is with /lib/modules-load.d/open-iscsi.conf

Opened it with text editor as sudo and commented both lines:

cat /lib/modules-load.d/open-iscsi.conf

iscsi_tcp

ib_iser

started service successfully:

systemctl start systemd-modules-load.service

==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units === Authentication is required to start 'systemd-modules-load.service'. Authenticating as: ,,, (wsl) Password: ==== AUTHENTICATION COMPLETE ===

wsl@Prime:~$ systemctl status systemd-modules-load.service

● systemd-modules-load.service - Load Kernel Modules Loaded: loaded (/lib/systemd/system/systemd-modules-load.service; static; vendor preset: enabled) Active: active (exited) since Fri 2022-02-04 11:49:22 EET; 6s ago Docs: man:systemd-modules-load.service(8) man:modules-load.d(5) Process: 738 ExecStart=/lib/systemd/systemd-modules-load (code=exited, status=0/SUCCESS) Main PID: 738 (code=exited, status=0/SUCCESS)

All good now :)