WSL icon indicating copy to clipboard operation
WSL copied to clipboard

wsl2 Unable to run systemd

Open lzh-programmer opened this issue 1 year ago • 5 comments

Windows Version

Microsoft Windows [版本 10.0.22631.5335]

WSL Version

WSL 版本: 2.5.7.0

Are you using WSL 1 or WSL 2?

  • [x] WSL 2
  • [ ] WSL 1

Kernel Version

6.6.87.1-1

Distro Version

centos7.9

Other Software

No response

Repro Steps

run wsl

NAME STATE VERSION

  • CentOS Running 2 rocky8 Stopped 2

Expected Behavior

[ 0.956240] Freeing unused kernel image (rodata/data gap) memory: 868K [ 0.956552] Run /init as init process [ 0.956725] with arguments: [ 0.956903] /init [ 0.957244] with environment: [ 0.957513] HOME=/ [ 0.957699] TERM=linux [ 0.957870] WSL_ROOT_INIT=1 [ 0.958069] WSL_ENABLE_CRASH_DUMP=1 [ 0.966661] scsi 0:0:0:0: Direct-Access Msft Virtual Disk 1.0 PQ: 0 ANSI: 5 [ 0.971774] sd 0:0:0:0: Attached scsi generic sg0 type 0 [ 0.972234] sd 0:0:0:0: [sda] 795536 512-byte logical blocks: (407 MB/388 MiB) [ 0.972673] scsi 0:0:0:1: Direct-Access Msft Virtual Disk 1.0 PQ: 0 ANSI: 5 [ 0.972854] sd 0:0:0:0: [sda] Write Protect is on [ 0.973489] sd 0:0:0:0: [sda] Mode Sense: 0f 00 80 00 [ 0.973942] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA [ 0.975740] sd 0:0:0:0: [sda] Attached SCSI disk [ 0.977534] sd 0:0:0:1: Attached scsi generic sg1 type 0 [ 0.977710] sd 0:0:0:1: [sdb] 381000 512-byte logical blocks: (195 MB/186 MiB) [ 0.978316] sd 0:0:0:1: [sdb] Write Protect is on [ 0.978647] sd 0:0:0:1: [sdb] Mode Sense: 0f 00 80 00 [ 0.979116] sd 0:0:0:1: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA [ 0.981157] sd 0:0:0:1: [sdb] Attached SCSI disk [ 0.986208] scsi 0:0:0:2: Direct-Access Msft Virtual Disk 1.0 PQ: 0 ANSI: 5 [ 0.991304] sd 0:0:0:2: Attached scsi generic sg2 type 0 [ 0.991409] sd 0:0:0:2: [sdc] 2097160 512-byte logical blocks: (1.07 GB/1.00 GiB) [ 0.992043] sd 0:0:0:2: [sdc] 4096-byte physical blocks [ 0.992385] sd 0:0:0:2: [sdc] Write Protect is off [ 0.992648] sd 0:0:0:2: [sdc] Mode Sense: 0f 00 00 00 [ 0.993059] sd 0:0:0:2: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 0.994606] sd 0:0:0:2: [sdc] Attached SCSI disk [ 1.132604] EXT4-fs (sda): mounted filesystem 00000000-0000-0000-0000-000000000000 ro without journal. Quota mode: none. [ 1.136727] EXT4-fs (sdb): mounted filesystem 00000000-0000-0000-0000-000000000000 ro without journal. Quota mode: none. [ 1.185861] tun: Universal TUN/TAP device driver, 1.6 Setting up swapspace version 1, size = 1 GiB (1073741824 bytes) no label, UUID=5413d750-93a3-4dcc-a6ec-c6ac6dfc238e [ 1.197625] Adding 1048576k swap on /dev/sdc. Priority:-2 extents:1 across:1048576k [ 1.211715] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this. [ 1.214494] Bridge firewalling registered [ 2.129590] hv_netvsc fc232fd7-4443-4791-a539-deef713ec4d4 loopback0: renamed from eth5 [ 2.720158] scsi 0:0:0:3: Direct-Access Msft Virtual Disk 1.0 PQ: 0 ANSI: 5 [ 2.725861] sd 0:0:0:3: Attached scsi generic sg3 type 0 [ 2.725973] sd 0:0:0:3: [sdd] 2147483648 512-byte logical blocks: (1.10 TB/1.00 TiB) [ 2.726882] sd 0:0:0:3: [sdd] 4096-byte physical blocks [ 2.727249] sd 0:0:0:3: [sdd] Write Protect is off [ 2.727533] sd 0:0:0:3: [sdd] Mode Sense: 0f 00 00 00 [ 2.727971] sd 0:0:0:3: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 2.729864] sd 0:0:0:3: [sdd] Attached SCSI disk [ 2.748220] EXT4-fs (sdd): mounted filesystem 6544f54a-c8ec-4051-95db-dffc3f7a253d r/w with ordered data mode. Quota mode: none. [ 2.967225] WSL (2 - init-systemd(CentOS)) WARNING: hostname set to lzh.server in /etc/wsl.conf [ 2.997965] Failed to get D-Bus connection: Operation not permitted Inserted module 'autofs4' Failed to create symlink /sys/fs/cgroup/net_cls: Operation not permitted freeze_wait_upgrade: 0 [ 3.251696] Failed to get D-Bus connection: No such file or directory [ 3.510232] Failed to get D-Bus connection: No such file or directory [ 3.763984] Failed to get D-Bus connection: No such file or directory

Actual Behavior

systemctl

Failed to get D-Bus connection: No such file or directory

#systemctl

Diagnostic Logs

No response

lzh-programmer avatar Jun 03 '25 11:06 lzh-programmer

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs

Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The script will output the path of the log file once done.

If this is a networking issue, please use collect-networking-logs.ps1, following the instructions here

Once completed please upload the output files to this Github issue.

Click here for more info on logging If you choose to email these logs instead of attaching to the bug, please send them to [email protected] with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

github-actions[bot] avatar Jun 03 '25 11:06 github-actions[bot]

run /lib/systemd/systemd --system --log-level=debug.

Yes, systemd is functioning properly now.

lzh-programmer avatar Jun 04 '25 03:06 lzh-programmer

/logs

OneBlue avatar Jun 04 '25 18:06 OneBlue

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:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

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

If you choose to email these logs instead of attaching to the bug, please send them to [email protected] with the number of the github issue in the subject, and in the message a link to your comment in the github issue.

Thank you!

This issue has been automatically closed since it has not had any author activity for the past 7 days. If you're still experiencing this issue please re-file it as a new issue.

Thank you!