31

I have Ubuntu and Windows 10 with dual boot in a scratch computer (I'm too inexperienced to use anything else). The problem is, every time I try to shutdown from Ubuntu, the computer just reboots and loads the GRUB screen, so that means I can only turn off the computer from Windows 10 and not from Ubuntu.

Can I turn off my PC from the GRUB screen? I do not want to have to turn off from Windows 10 every time I shut down the PC from Ubuntu.

karel
  • 110,292
  • 102
  • 269
  • 299
J. Doe
  • 473
  • 1
  • 4
  • 10
  • 2
    You can simply power off your computer while it is in the GRUB menu by touching the power button. Unless you have a very old computer, this will trigger an ACPI event that tells the system to shut down and turn off, so it would not be a hard reset anyway. However, the more interesting question is why Ubuntu reboots instead of powering off. – Byte Commander Feb 22 '17 at 18:12
  • Indeed. Seems like something's wrong with the way Ubuntu shuts down. I verified that mantaining the power button pressed for a couple of seconds powers down the computer without triggering a warning in windows. Pressing `c` and then entering `halt` in the prompt also worked for me. – J. Doe Feb 22 '17 at 19:03
  • Actually I meant tapping the power button shortly, not holding it until it cuts the power... – Byte Commander Feb 22 '17 at 20:17
  • Tapping the power button shortly is completely ignored from the GRUB screen for some reason. – J. Doe Feb 22 '17 at 23:38

5 Answers5

36

From this interesting thread on ubuntuforums.org:

In the GRUB menu, press C and then enter halt.

Also as noted in the link, it is safe to simply press the power button while at the GRUB menu.

Byte Commander
  • 105,631
  • 46
  • 284
  • 425
WinEunuuchs2Unix
  • 99,709
  • 34
  • 237
  • 401
  • For me I needed to use this to shut down a VM that was stuck in a boot loop and wasn't responding to the hypervisor's shutdown commands. – AJMansfield May 17 '19 at 03:11
5

In the GRUB command line, the equivalent of poweroff is halt:

grub> halt
Zanna
  • 69,223
  • 56
  • 216
  • 327
whbb98
  • 51
  • 1
  • 2
1

As per this page, you can do it by adding custom menu options.
sudo gedit /etc/grub.d/40_custom

Add these options:

 menuentry "Reboot" {
      reboot
}

menuentry "Shut Down" {
      halt
}

Update:
sudo update-grub

Reboot:
reboot

Nav
  • 979
  • 11
  • 24
1

Have you tried to shutdown your computer from Ubuntu with one of these commands ? poweroff or sudo shutdown -h now ?? Your script responsible for shutting your computer off is maybe corrupt. If it is the case, these commands would do the job.

To explicitly answer your actual question (shutting down from the grub), I would hold the power button manually. I do so when I accidentally turn on my computer and finally don't want to :)

Johannes Lemonde
  • 1,561
  • 1
  • 11
  • 20
  • I tried the usual `sudo shutdown` and other variations but it rebooted the computer. `poweroff` and takes me to the grub screen instead of shutting down the computer. `sudo shutdown -h now` does the same. For some reason, the computer turns off and then suddenly turns on again. – J. Doe Feb 22 '17 at 19:13
0

In my case halt in GRUB hangs up the system and nothing happens. So I have to press the power key to poweroff the computer.

Zanna
  • 69,223
  • 56
  • 216
  • 327