How to select which operating system starts first on a dual-boot installation (Windows7 and Ubuntu 12.04)
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.
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
sudo -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
- In a terminal, use