1

I have a dual boot system with Ubuntu 16.04 and Windows 7. Windows 7 is automatically booted (default in the bootloader). On both OS I have TeamViewer installed.

When I'm working remotely and want to switch to Ubuntu I have to reboot the PC but then automatically Windows is booted again (I'm not in front of the PC, so I cannot use the bootloader). How can I in such a case switch to Ubuntu, i.e. starting Ubuntu? And how can I switch back to Windows?

  • Basically your question seems to be about how to set the default OS to be loaded on (re)boot. For that it might be nice to list if you use BIOS or if you use UEFI. – Hennes Mar 27 '18 at 18:56
2

The answer depends on your current boot manager.


If this is the Windows boot manager, then this can be done by a command run in Admin mode similar to this :

bcdedit /bootsequence e {975a8204-9658-11dd-993e-9aea7965e9da}

The bootsequence parameter is defined as :

Specifies a one-time display order to be used for the next boot. This command is similar to the /displayorder option, except that it is used only the next time the computer starts. Afterwards, the computer reverts to the original display order.

You may find the identifier to use by running bcdedit without parameters.

You could this way setup Windows as the default boot, and run bcdedit when you wish to boot Linux.

For more information see this Microsoft tip.


If the boot manager is grub and you are using EFI as the BIOS, you may use under Linux the command efibootmgr :

efibootmgr -n XXXX

where XXXX is the item number of Windows from the boot list. To find out the number for your Linux installation(s), just use efibootmgr with no options (or efibootmgr -v if you want to see details). The number will be something like 0001 or 0002 in most cases.

You could then setup Linux as your default boot, just running Windows once by using this command.

| improve this answer | |
  • My boot manager is grub but I want Windows as my default boot and just running Linux once. Is this also possible? – machinery Mar 28 '18 at 16:15
  • bcdedit may be able to do it - this article says on an EFI system it manipulates the nvram rather than the BCD file. Otherwise, you may be able to use the free EasyUEFI - the command-line version is commercial ($29.95) but you may not need it. – harrymc Mar 28 '18 at 17:14
  • What about the case when multiple Windows installations are on different hard drives? Would bcdedit let you choose which one to boot in on reboot? – Temuri Apr 26 '19 at 20:36
  • @Temuri: Every installations you can boot from can be set by bcdedit. – harrymc Apr 27 '19 at 7:03
1

I've asked a similar question but the other way around.
Assuming you have remote access on both Operating Systems, if you change Ubuntu to be your default boot you can boot back to windows using grub-reboot (My similar question has more details).

| improve this answer | |
  • Thanks, that's looking interesting. Is this also possible the other way round? – machinery Mar 27 '18 at 19:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.