Skip to content
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

Distro not booting with systemd enabled #9850

Closed
1 of 2 tasks
quater opened this issue Mar 27, 2023 · 2 comments
Closed
1 of 2 tasks

Distro not booting with systemd enabled #9850

quater opened this issue Mar 27, 2023 · 2 comments

Comments

@quater
Copy link

quater commented Mar 27, 2023

Windows Version

Microsoft Windows 10 Pro 10.0.19045 N/A Build 19045

WSL Version

1.1.3.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.90.1-microsoft-standard-WSL2

Distro Version

Ubuntu 22:04

Other Software

No response

Repro Steps

The Problem

I cannot get WSL 2 to run the Ubuntu 22.04 distro with systems.

The Steps

I have followed the steps as documented
https://devblogs.microsoft.com/commandline/systemd-support-is-now-available-in-wsl/
https://ubuntu.com/blog/ubuntu-wsl-enable-systemd

  1. Connect to Ubuntu 22.04 instance terminal and create the wsl.conf file with the command sudo nano /etc/wsl.conf.
  2. I added the text below and saved the file.
[boot]
systemd=true
  1. In the Powershell terminal, I run the command wsl --shutdown
  2. In the Powershell terminal, I connected to the terminal with wsl -d Ubuntu-20.04
  3. Run the command ps 1
$ ps 1
    PID TTY      STAT   TIME COMMAND
      1 ?        Ss     0:00 /sbin/init

The History

In August 2022, I got this freshly installed laptop, and right started to use WSL. The first thing I did was to enable WSL2, but I did not check whether there are new versions of WSL2 available.

Recently I had the need to install a service that required systemd. I then learned that WSL2 can run the distro with systemd. I then followed the steps provided at https://devblogs.microsoft.com/commandline/systemd-support-is-now-available-in-wsl/ but it did not work. To see whether it's an issue with WSL2, I tried to get the WSL version by running wsl --version but that did not work either. Eventually, I learned that I can upgrade WSL2 with the command wsl --update command. Once done, the wsl --version command started to work, which now displays 1.1.3.0.

However, WSL2 refuses to run Ubuntu 22.04 or 20.04 with systemd as process 1. I then unregistered the distros in the hope that this will make it work by forcing them to download a new WSL distro but that did not work either.

Is there a bug with this particular version of Windows 10?

Host Name:                 C00415
OS Name:                   Microsoft Windows 10 Pro
OS Version:                10.0.19045 N/A Build 19045
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Member Workstation
OS Build Type:             Multiprocessor Free
Registered Owner:          <obfuscated>
Registered Organization:   <obfuscated>
Product ID:                00331-10000-00001-AA298
Original Install Date:     12/08/2022, 09:59:41
System Boot Time:          27/03/2023, 08:32:33
System Manufacturer:       LENOVO
System Model:              20XWS0Y700
System Type:               x64-based PC
Processor(s):              1 Processor(s) Installed.
                           [01]: Intel64 Family 6 Model 140 Stepping 1 GenuineIntel ~1201 Mhz
BIOS Version:              LENOVO N32ET79W (1.55 ), 27/07/2022
Windows Directory:         C:\WINDOWS
System Directory:          C:\WINDOWS\system32
Boot Device:               \Device\HarddiskVolume1
System Locale:             en-au;English (Australia)
Input Locale:              en-us;English (United States)
Time Zone:                 (UTC+10:00) Brisbane
Total Physical Memory:     32.487 MB
Available Physical Memory: 20.353 MB
Virtual Memory: Max Size:  37.351 MB
Virtual Memory: Available: 25.338 MB
Virtual Memory: In Use:    12.013 MB
Page File Location(s):     C:\pagefile.sys
Domain:                    <obfuscated>
Logon Server:              <obfuscated>
Hotfix(s):                 17 Hotfix(s) Installed.
                           [01]: KB5011487
                           [02]: KB5022502
                           [03]: KB5003791
                           [04]: KB5012170
                           [05]: KB5015684
                           [06]: KB5023696
                           [07]: KB5011352
                           [08]: KB5011651
                           [09]: KB5014032
                           [10]: KB5014035
                           [11]: KB5014671
                           [12]: KB5015895
                           [13]: KB5016705
                           [14]: KB5018506
                           [15]: KB5020372
                           [16]: KB5022924
                           [17]: KB5005260
Network Card(s):           5 NIC(s) Installed.
                           [01]: Intel(R) Wi-Fi 6 AX201 160MHz
                                 Connection Name: Wi-Fi
                                 DHCP Enabled:    Yes
                                 DHCP Server:     <obfuscated>
                                 IP address(es)
                                 [01]: <obfuscated>
                                 [02]: <obfuscated>
                                 [03]: <obfuscated>
                                 [04]: <obfuscated>
                           [02]: Bluetooth Device (Personal Area Network)
                                 Connection Name: Bluetooth Network Connection
                                 Status:          Media disconnected
                           [03]: PANGP Virtual Ethernet Adapter Secure
                                 Connection Name: Ethernet 2
                                 DHCP Enabled:    No
                                 IP address(es)
                                 [01]: 192.168.231.138
                           [04]: Hyper-V Virtual Ethernet Adapter
                                 Connection Name: vEthernet (WSL)
                                 DHCP Enabled:    No
                                 IP address(es)
                                 [01]: <obfuscated>
                                 [02]: <obfuscated>
                           [05]: Realtek USB GbE Family Controller
                                 Connection Name: Ethernet 5
                                 Status:          Media disconnected
Hyper-V Requirements:      A hypervisor has been detected. Features required for Hyper-V will not be displayed.

Expected Behavior

Distro to run /lib/systemd/systemd as process 1.

Actual Behavior

Process 1 runs with init daemon.

$ ps 1
    PID TTY      STAT   TIME COMMAND
      1 ?        Ss     0:00 /sbin/init

Diagnostic Logs

No response

@elsaco
Copy link

elsaco commented Mar 27, 2023

@quater please check with systemctl status if systemd is running. Using the same Windows build (10.0.19045.2728) this is sample output on my system:

[elsaco@RIPPER ~]$ systemctl status --user
● RIPPER
    State: running
    Units: 138 loaded (incl. loaded aliases)
     Jobs: 0 queued
   Failed: 0 units
    Since: Sun 2023-03-26 21:22:33 PDT; 34s ago
  systemd: 253.1-3-arch
   CGroup: /user.slice/user-1000.slice/user@1000.service
           └─init.scope
             ├─120 /usr/lib/systemd/systemd --user
             └─121 "(sd-pam)"

[elsaco@RIPPER ~]$ ps 1
    PID TTY      STAT   TIME COMMAND
      1 ?        Ss     0:00 /sbin/init

Notice that PID=1 is init not systemd

@quater
Copy link
Author

quater commented Mar 27, 2023

@elsaco Thanks for your response and the suggestion. Yes, I see it's running.

$ systemctl status --user
● C00415
    State: running
     Jobs: 0 queued
   Failed: 0 units
    Since: Mon 2023-03-27 14:35:03 AEST; 2s ago
   CGroup: /user.slice/user-1000.slice/user@1000.service
           └─init.scope
             ├─692 /lib/systemd/systemd --user
             └─693 (sd-pam)

$ ps 1
    PID TTY      STAT   TIME COMMAND
      1 ?        Ss     0:00 /sbin/init

So my expectation was wrong for the first process to be systemd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants