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

Unable to reboot windows with Bash On Windows #2533

Closed
panda2k opened this issue Sep 30, 2017 · 3 comments
Closed

Unable to reboot windows with Bash On Windows #2533

panda2k opened this issue Sep 30, 2017 · 3 comments
Labels

Comments

@panda2k
Copy link

panda2k commented Sep 30, 2017

When using the reboot command in Bash On Windows I get the error Failed to connect to bus: No such file or directory

@ryanerwin
Copy link

Since I could be running multiple Linux terminals (say one copy of Fedora and one copy of Ubuntu) simultaneously, would it be desirable that reboot in Ubuntu would also stop my Fedora session and reboot my entire computer?

This one doesn't make much sense to me, at least as WSL is now...

Once WSL supports an Init daemon and automatically bringing up a bunch of services, this would make a lot more sense... At least to use reboot to restart all processes related to that WSL instance.

Continuing to rely on shutdown.exe would probably make more sense for rebooting the entire system.

@benhillis
Copy link
Member

@ryanerwin - Agreed. If we eventually do support running system I would expect the reboot command to terminate just the current WSL distribution, not reboot the entire Windows machine.

@therealkenc
Copy link
Collaborator

therealkenc commented May 28, 2018

Per Ben, rebooting Windows from within WSL with the reboot(8) command per the issue title was declined by-design. For shutting down the instance (contrast rebooting Windows) see #3253. Workaround (put in your .bashrc or similar):

alias reboot='powershell.exe -command reboot-computer'

Or if you are a good person and haven't given yourself Windows Administrator privileges:

alias reboot='runas.exe /noprofile /user:Administrator "powershell.exe -command reboot-computer"'

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

No branches or pull requests

4 participants