Ubuntu in WSL: Reboot Command is not working
I have been using WSL as a means to get access to Linux when developing software inside of the Windows 10: Pro Ed OS. But some of my preformated input lines that I use are not working because the reboot command doesn't seem to work when Ubuntu is running in the Windows Subsystem for Linux.
The preformatted input lines that I use are often executed using a bash variable that I assign the line to in the command line — i.e. $1, $2, $3. Usually though I create a Command-line Library (aka personal CLI for Linux navigation), which I will execute using a command that is supported through bin directory.
Here is an example of a traditional use case:
jay-dev@stack-overflow:~$ sudo apt update && sudo apt upgrade;sudo reboot;
Upon executing the $ sudo reboot command, Ubuntu prints the following:
jay-dev@stack-overflow:~$ sudo reboot
[sudo] password for andrew-chambers:
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
Failed to talk to init daemon.
jay-dev@stack-overflow:~$
What I am trying to find out, is if there is a viable solution.
The following bullets are 3 examples of what a viable solution may look like:
A
WSLConfiguration that allows for therebootcommand to execute successfully, which would mean, thatreboot, reboots Ubuntu.An alternative way of writing the
rebootcommand, that will cause it to execute in a way that will result in Ubuntu Rebooting.An alternative command altogether.
A way to write my own command that will reboot Ubuntu.
Closing & opening the terminal will not work, as I can't include that in any sort of preformatted way, or in any sort of code. (This much should be obvious)