How to reboot Ubuntu Server by command? Error 'Failed to reboot: Invalid argument. System has not been booted with systemd as init system (PID 1)'
I install Ubuntu on Windows 10 via Microsoft Store! and I can't reboot it I try Google and error:
[email protected]:~# sudo reboot now
Failed to write reboot parameter file: No such file or directory
[email protected]:~# sudo reboot -f
Rebooting.
Failed to reboot: Invalid argument
[email protected]:~# sudo reboot
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to talk to init daemon.
[email protected]:~# sudo reboot -h
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to talk to init daemon.
[email protected]:~# sudo reboot -h now
Failed to write reboot parameter file: No such file or directory
[email protected]:~# sudo shutdown -r now
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to talk to init daemon.
[email protected]:~# sudo shutdown -r -H +0
System has not been booted with systemd as init system (PID 1). Can't operate.
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to talk to init daemon.
[email protected]:~# sudo systemctl reboot
System has not been booted with systemd as init system (PID 1). Can't operate.
System has not been booted with systemd as init system (PID 1). Can't operate.
[email protected]:~#
How to reboot it? Thanks
I got the answer:
wslreboot
wsl --shutdown
Solution 1:
I think you have already logged in as super user and you don't need sudo
before your command. Anyway, please try this command and see if it works:
#/sbin/reboot
Or
#/sbin/shutdown -r now