How to select which operating system starts first on a dual-boot installation (Windows7 and Ubuntu 12.04)
Asked
Active
Viewed 2,169 times
2 Answers
1
Edit /etc/default/grub
, in terminal
...
gksudo gedit /etc/default/grub
and edit/add these two parameters near the top of the file...
GRUB_DEFAULT=saved <--- this line requires an edit
GRUB_SAVEDEFAULT=true <--- this line needs to be added
...so that GRUB will remember your last selected OS as the default OS.
Then, in terminal
...
sudo update-grub

heynnema
- 70,711
0
I am assuming you are using Grub2 to boot. More details can be found at https://help.ubuntu.com/community/Grub2/Setup#Configuring_GRUB_2.
- Boot your computer; when Grub appears, tap a key to prevent loading the default OS
- Look at the list of available options for booting; take note of the line number of the OS you want to boot by default; line numbers start at 0
- Boot into the OS that manages Grub; I am going to guess this would be Ubuntu
- In a terminal, open
/etc/default/grub
withsudo -H gedit /etc/default/grub
(or other text editor) - Look for the line that starts with either "GRUB_DEFAULT=" or "#GRUB_DEFAULT="; if the latter, remove "#"
- Replace whatever is after "=" with the line number of the OS you want to boot by default
- Save
- In a terminal, use
sudo update-grub

Andrew Shum
- 509
-
NEVER run a GUI app with sudo alone. The -H parameter assures it won't mess with file permissions where it shouldn't. Also there's no need to open nautilus as root just to open and editable file when you can open it directly in the way I just edited in. – Nov 16 '17 at 02:43