I set Bash to be the primary shell on Windows when I SSH, using the following:
New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\WINDOWS\System32\bash.exe" -PropertyType String -Force
Now, when I SSH into my Windows machine, I get a Bash shell (as I wanted). Ordinarily, if I want to reboot a Linux computer during an ssh session I can just type reboot
in the terminal. But when I ssh into a Bash shell on Windows Subsystem for Linux and type reboot
I get an error message:
System has not been booted with systemd as init system (PID 1). Can't operate. Failed to connect to bus: Host is down
I want to be able to reboot my Windows machine (not just the ssh-session) so that my computer returns to the grub menu (I am dual booting). Is there a way for me to do this? Can I, for example, type a command to spawn a Powershell session through ssh? Thanks!
/r
Shutdown and Restart.