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

Guest shutdown command is not reliable #12252

Open
1 of 2 tasks
leonbloy opened this issue Nov 9, 2024 · 3 comments
Open
1 of 2 tasks

Guest shutdown command is not reliable #12252

leonbloy opened this issue Nov 9, 2024 · 3 comments

Comments

@leonbloy
Copy link

leonbloy commented Nov 9, 2024

Windows Version

Microsoft Windows [Versión 10.0.22631.4317]

WSL Version

2.3.24.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

Linux version 5.15.153.1-microsoft-standard-WSL2 (root@941d701f84f1) (gcc (GCC) 11.2.0, GNU ld (GNU Binutils) 2.37) #1 SMP Fri Mar 29 23:14:13 UTC 2024

Distro Version

Ubuntu-22.04

Other Software

No response

Repro Steps

From inside my Ubuntu session, I run sudo shutdown now

I get a message of process terminated with code 1, and I'm invited to either close the terminal with Ctrl-D or press Enter to reboot.

In either case, when I start again the session, different issues (not deterministic) appear. In particular, if I immediately reboot and run sudo shutdown now again, I get

Failed to connect to bus: Connection refused
Failed to open initctl fifo: No such device or address
Failed to talk to init daemon.

Expected Behavior

I would expect that sudo shutdown now performs a complete and clean shutdown of my distro session, same as terminating the session from outside (with wsl). The host (wsl) should somehow get notified and perform its cleanup.

That is the behaviour of typical virtual machines hosts (eg: Virtualbox).

Actual Behavior

It seems that sudo shutdown now is not enough to perform a complete and clean shutdown from inside my Linux session.

It seems I'm still required to shutdown the sesion calling the outside command, with wsl -s DISTRO_NAME . This is not clean or ideal, I wish to be able to shutdown my virtual machine from inside - the Windows path is not always available from inside, and it's inconvenient to have to recall the session name (especially when I started the session from the terminal, for example).

Diagnostic Logs

No [response](WslLogs-2024-11-09_17-29-09.zip
)

Copy link

github-actions bot commented Nov 9, 2024

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'.

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.

Copy link

github-actions bot commented Nov 9, 2024

Diagnostic information
Issue was edited and new log file was found: https://github.com/user-attachments/files/17689277/WslLogs-2024-11-09_17-29-09.zip
Detected appx version: 2.3.24.0

@zcobol
Copy link

zcobol commented Nov 10, 2024

@leonbloy it's a container so shutdown won't do you any good! Just use exit!

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

No branches or pull requests

2 participants