[SOLVED]How to set GRUB to boot windows first (by default)

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
jazbar_
Level 1
Level 1
Posts: 33
Joined: Thu Sep 15, 2016 1:24 pm

[SOLVED]How to set GRUB to boot windows first (by default)

Post by jazbar_ » Tue Sep 27, 2016 2:14 pm

I found this instruction for Ubuntu how to set dual OS GRUB boot sequence.

GRUB can be configured using the /etc/default/grub file. Before you make any changes to it, it may be a good idea to back it up by creating a copy:

sudo cp /etc/default/grub /etc/default/grub.bak

You can restore the copying the backup over the original:

sudo cp /etc/default/grub.bak /etc/default/grub

Open the file using the text editor with root privileges:

gksu gedit /etc/default/grub

The line GRUB_DEFAULT=0 means that GRUB will select the first menu item to boot. Change this to GRUB_DEFAULT=saved. This change will make it easier to change the default item later.

Save and close the file. Run this command to apply your changes to GRUB’s configuration:

sudo update-grub

The configuration change we made allows the grub-set-default and grub-reboot commands to be used at any time. These allow you to change the default boot item permanently or only for the next boot, respectively.

Run grub-set-default or grub-reboot (with sudo) with the number of the menu item to boot (the first item is 0). This command will change the default to the second item:

sudo grub-set-default 1
I tried with this command with no success. Please help.
Last edited by jazbar_ on Tue Sep 27, 2016 7:14 pm, edited 2 times in total.

User avatar
jimallyn
Level 18
Level 18
Posts: 8419
Joined: Thu Jun 05, 2014 7:34 pm
Location: Wenatchee, WA USA

Re: How to set GRUB to boot windows first (by default)

Post by jimallyn » Tue Sep 27, 2016 2:22 pm

It can be done by editing config files, but I have never done it that way. I have always used the GUI application Grub-Customizer for that.

https://launchpad.net/~danielrichter200 ... customizer
Image

“If the government were coming for your TVs and cars, then you'd be upset. But, as it is, they're only coming for your sons.” - Daniel Berrigan

hrmcrm
Level 4
Level 4
Posts: 227
Joined: Sun Jul 03, 2016 5:59 pm
Location: San Francisco

Re: How to set GRUB to boot windows first (by default)

Post by hrmcrm » Tue Sep 27, 2016 3:22 pm

jazbar_ wrote:I found this instruction for Ubuntu how to set dual OS GRUB boot sequence.
sudo grub-set-default 1
I tried with this command with no success. Please help.
What number did you use with the sudo grub-set-defaultcommand?
To set Windows as default, the command needs the sequence number from the grub start menu, where grub starts counting from 0.
On my Mint 18 KDE + Windows 10 dual-boot system, the Windows menu item is fifth in the list, so the correct command to set it as default would be sudo grub-set-default 4
Howard
ThinkPads 310ED, 600E, T23, X41, X60, T61, X201, E550

User avatar
austin.texas
Level 20
Level 20
Posts: 12053
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: How to set GRUB to boot windows first (by default)

Post by austin.texas » Tue Sep 27, 2016 4:03 pm

Those instructions are incomplete.
In addition to GRUB_DEFAULT=saved
You have to add this line:

Code: Select all

GRUB_SAVEDEFAULT="true"
Then save the file and run

Code: Select all

sudo update-grub
That will always boot the last OS that you booted, until you chose a different one.
You did not really say that was your goal. Is it?
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018

jazbar_
Level 1
Level 1
Posts: 33
Joined: Thu Sep 15, 2016 1:24 pm

Re: How to set GRUB to boot windows first (by default)

Post by jazbar_ » Tue Sep 27, 2016 4:32 pm

Neither line of codes posted in quote of a first post, work in my Terminal.

For example, if I write this command:

Code: Select all

gksu gedit /etc/default/grub
into Terminal nothing happens.

In my GRUB windows is 5th. line, so the number should be "4" since the first line Linux loader in config. file is marked with number "0" by default.

Code: Select all

sudo grub-set-default 4

User avatar
austin.texas
Level 20
Level 20
Posts: 12053
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: How to set GRUB to boot windows first (by default)

Post by austin.texas » Tue Sep 27, 2016 5:21 pm

jazbar_ wrote: if I write this command:

Code: Select all

gksu gedit /etc/default/grub
into Terminal nothing happens.
Then you do not have gedit installed. What text editor do you have installed?
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018

User avatar
Pjotr
Level 20
Level 20
Posts: 10775
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland)
Contact:

Re: How to set GRUB to boot windows first (by default)

Post by Pjotr » Tue Sep 27, 2016 5:26 pm

This should work:
https://sites.google.com/site/easylinux ... -boot-menu
(item 1, left column)

Note: I strongly advise to avoid Grub Customizer:
https://sites.google.com/site/easylinux ... Customizer
(item 6.2.b, right column)
Tip: 10 things to do after installing Linux Mint 19 Tara
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.

Cosmo.
Level 23
Level 23
Posts: 17829
Joined: Sat Dec 06, 2014 7:34 am

Re: How to set GRUB to boot windows first (by default)

Post by Cosmo. » Tue Sep 27, 2016 5:41 pm

jazbar_ wrote:For example, if I write this command:

Code: Select all

gksu gedit /etc/default/grub
into Terminal nothing happens.
This could have been avoided if we would know your Mint-version and the desktop environment. If you don't know open a terminal and enter:

Code: Select all

inxi -Sz
Paste the output here.

jazbar_
Level 1
Level 1
Posts: 33
Joined: Thu Sep 15, 2016 1:24 pm

Re: How to set GRUB to boot windows first (by default)

Post by jazbar_ » Tue Sep 27, 2016 6:28 pm

mic@MSI ~ $ inxi -Sz
System: Host: MSI Kernel: 4.4.0-21-generic x86_64 (64 bit)
Desktop: MATE 1.14.1 Distro: Linux Mint 18 Sarah

This version has a XED text editor.
Last edited by jazbar_ on Tue Sep 27, 2016 6:41 pm, edited 1 time in total.

Cosmo.
Level 23
Level 23
Posts: 17829
Joined: Sat Dec 06, 2014 7:34 am

Re: How to set GRUB to boot windows first (by default)

Post by Cosmo. » Tue Sep 27, 2016 6:29 pm

In this case replace gedit with xed in the command.

jazbar_
Level 1
Level 1
Posts: 33
Joined: Thu Sep 15, 2016 1:24 pm

Re: How to set GRUB to boot windows first (by default)

Post by jazbar_ » Tue Sep 27, 2016 7:08 pm

Thanks to all for your replies.

Now the windows is booting by default.

I followed instruction from my first post, since were easier than addition installation of software for changing boot sequence. Also I hadn't been quite sure about instruction from "austin.texas", is this line GRUB_SAVEDEFAULT="true" should be added or replaced with? I'm not fluid in English so many times missed the point.

User avatar
austin.texas
Level 20
Level 20
Posts: 12053
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: [SOLVED]How to set GRUB to boot windows first (by default)

Post by austin.texas » Tue Sep 27, 2016 7:36 pm

If you do gksu xed /etc/default/grub and change GRUB_DEFAULT=
then GRUB_SAVEDEFAULT="true" is NOT necessary.

If you do sudo grub-set-default 1
then GRUB_SAVEDEFAULT="true" is necessary.
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018

Post Reply

Return to “Installation & Boot”