If you are using UEFI firmware, which supports multiple bootloaders side-by-side (e.g. GRUB and Windows Boot Manager), change the BootNext
EFI variable to select one of them and reboot.
(That is, wake the machine; let it boot into the default OS; set BootNext; reboot into the other OS.)
Linux |
Windows |
efibootmgr |
bcdedit /enum firmware |
efibootmgr --bootnext NUM |
bcdedit /set {fwbootmgr} bootsequence GUID |
efibootmgr --bootorder NUM… |
bcdedit /set {fwbootmgr} displayorder GUID… |
reboot , systemctl reboot |
shutdown /r /t 0 |
For example, if GRUB is the default entry (and boots into Linux) but you want to select Windows Boot Manager just once, you can do:
# efibootmgr
BootCurrent: 0001
BootOrder: 0001,0000
Boot0000* Windows Boot Manager
Boot0001* Ubuntu
Boot001F USB HDD
# efibootmgr --bootnext 0000
# reboot
From Windows, the same can be done either through the graphical "Shift+Reboot" menu, or using bcdedit
to set its 'bootsequence' parameter (use the GUID from the 'identifier' field), both of which are translated to EFI BootNext.
This is usually as reliable as the F8/F11 firmware boot menu, so make sure that works first.
On the other hand, if you're using BIOS mode (and probably loading both Linux and Windows from the GRUB menu), something similar is available through GRUB's own configuration – in a typical grub.cfg, the equivalent to EFI BootNext would be $next_entry
, which could be set using:
# grub-editenv set next_entry ENTRY_ID
This is annoying to do from Windows, so it's easier to keep Linux as the default option.
Similarly, Windows Boot Manager also has a 'bootsequence' parameter on {bootmgr}
(not to be confused with {fwbootmgr} which represents EFI parameters), so if you have a GRUB entry added to Windows Boot Manager you can have Windows as the default OS and switch to Linux on demand. (I have not tested this.)