Link to home
Start Free TrialLog in
Avatar of Tek Info
Tek Info

asked on

Configuring Linux to boot first with the Windows option

Linux Mint was installed on an older computer, while still keeping Windows 10.
When it boots it automatically has the option for Linux first and then Windows afterward.
If nothing is done, it boots in Linux.
I want to reverse that.
How can I configure it so that the option is Windows first and if nothing is done it will boot in Windows ?
Avatar of noci
noci

Lookup the grub.cfg in /boot/grub/


Adding the followin to the file will remember you your last choice and use that by default...

GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true

Open in new window


Select a menu:

GRUB_DEFAULT="menuid>submenuid"

Open in new window

where menuid is the number of the choise.

f.e. choose 2nd option   

GRUB_DEFAULT="2"      

Open in new window

And if there is a submenu below it and select 3rd entry:


GRUB_DEFAULT="2>3"

Open in new window


If GRUB_DEFAULT=saved has been put in the grub.cfg file you can:

Also from the linux command reboot same option line: 

grub-reboot "2>3" 

Open in new window


Or set a default:

grub-set-default  '2'

Open in new window


check [b]man grub[/b], [b]man grub-reboot[/b], [b]man grub-set-default[/b] 

Along the path noci provided, while booted into Linux,int, look at the grub.cfg or grub.conf

Look at the number if instance, default potentially is 1 while the Windows one is listed first.
The order of entries is how you set which boots if a choice is not made.

Setting it to 0 will make Windows the default.
Avatar of Tek Info

ASKER

Thanks very much to both of you.
Forgive my asking since I don't have much experience in Linux, how could I open this file to make modifications to it?
Thanks again.
Nano is a text editor that is easy to use. If you do not have it, run apt-get nano

i second that. nano is most easy for novice users.

apt-get install nano

Sid not fully..
Boot into windows. Then open up system configuration app (search in left) once that is open select the boot tab. Now select the os you want as default then click set as default button. Click apply then ok and reboot. It should reboot to the default os that you selected.

@joinaunion:

That is the way to remove grub... and replace it with the windows boot loader. and not boot linux until GRUB is reinstated...

AFAICT windows doesn't use grub.    It isn't about choosing between various windows versions.

I understand. Obviously it is a dual boot environment. In that case you can set windows to boot first.
As far as I know you can install linux subsystem on windows now.

Linux subsystem on windows != linux..    it looks a lot LIKE linux and is in a slightly better shape than wine (Windows emulator on Linux etc.).

cygwin also has linux commands running on windows...  also looks a lot like linux and also not is...

Then again there is nothing against running Linux native and running Windows in a VM.. 


So it depends. 

Windows boot loader cannot restore grub as boot loader or boot linux from scratch, so restoring the windows boot loader is most probably not what the user want. 

To restore grub one first has to boot a linux from CD and then restore the grub loader.


The grub loader is capable to boot a LOT of OS's one of which is Windows, other are Linux (in all their flavors), BSD (in all flavours) which includes MAC afaik.

So i guess grub is the best option to go from.  Setting the default for grub can be done in various ways. depending on the sue case of the asker one is better then another.  

(Upgrading Linux might change the order of entries so depending on that might also no be the best option). 

This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.