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

systemd Not Booting Up in WSL 2 Despite Configuration in wsl.conf #11681

Closed
1 of 2 tasks
owlcode3 opened this issue Jun 11, 2024 · 9 comments
Closed
1 of 2 tasks

systemd Not Booting Up in WSL 2 Despite Configuration in wsl.conf #11681

owlcode3 opened this issue Jun 11, 2024 · 9 comments

Comments

@owlcode3
Copy link

owlcode3 commented Jun 11, 2024

Windows Version

Microsoft Windows [Version 10.0.21996.1]

WSL Version

WSL 2

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.10.102.1

Distro Version

Ubuntu-22.04

Other Software

No response

Repro Steps

1. Install WSL and Ubuntu 22.04:

2. Configure wsl.conf:

  • Edited the /etc/wsl.conf file to include the following configuration:

[boot] systemd=true

3. Restart WSL:

  • Executed the following command in PowerShell as an administrator to shut down WSL:

wsl --shutdown

4. Start WSL and Verify systemd:

  • Opened the Ubuntu terminal and ran:

ps -p 1 -o comm=

Expected Behavior

The command should output systemd, indicating that systemd is running as the init system.

Actual Behavior

The output is not systemd, and running systemctl status returns the following error:

System has not been booted with systemd as init system (PID 1). Can't operate. Failed to connect to bus: Host is down

Diagnostic Logs

No response

Tasks

No tasks being tracked yet.
Copy link

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 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 wsl-gh-logs@microsoft.com 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'.

View similar issues

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@owlcode3
Copy link
Author

I can't get the log

@OneBlue
Copy link
Collaborator

OneBlue commented Jun 11, 2024

Closing since this issue doesn't have logs

@OneBlue OneBlue closed this as completed Jun 11, 2024
@owlcode3
Copy link
Author

owlcode3 commented Jun 12, 2024

Here I've collected the logs as requested.
WslLogs-2024-06-12_11-52-06.zip

Steps to reproduce the issue:

  1. Set the default WSL version to 2: wsl --set-default-version 2
  2. Attempt to start WSL: wsl
  3. Check the status of systemd: systemctl status
  4. sudo systemctl status snapd

The error message encountered was: System has not been booted with systemd as init system (PID 1). Can't operate. Failed to connect to bus: Host is down

Copy link

The log file doesn't contain any WSL traces. Please make sure that you reproduced the issue while the log collection was running.

Diagnostic information
Appx package is not installed
Found no WSL traces in the logs

@owlcode3
Copy link
Author

I've edited my last comment to include the new log file as requested. Please let me know if there are any further details needed.

@owlcode3
Copy link
Author

owlcode3 commented Jun 12, 2024

Can this issue be reopen? I’ve added the log as requested

@owlcode3
Copy link
Author

@OneBlue please can you reopen the issue as I've provided the log as requested

@toshydev
Copy link

If you open the wsl.conf with vim, what is the format showing in the bottom left corner?
If it's showing [dos] you need to convert it to UNIX format by using a tool like dos2unix or by deleting and rewriting it inside the wsl with vim or nano.

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

3 participants