Grub2 can be set to boot any system by default, but to change the order they appear in would be difficult.
It is also possible to hide the grub boot menu (for your sister) and only show it by pressing the shift key. I recommend caution here. Details here.
There are two ways setting the default boot using editing a grub file.
These are described in the Ubuntu Communuity Documentation Grub2 page
The two ways are
Boot which ever operating system you booted last time, the "saved method"
This is the on I use. It lets me decide which one I going to use and will allow me to reboot into that system, handy when I'm updating.
Boot a specific operating system by default, your exact question
To start we need to find out what we are booting, open a terminal (dash, type terminal, … ) and type in grep menuentry /boot/grub/grub.cfg
user@YourComputer:~$ grep menuentry /boot/grub/grub.cfg
menuentry 'Ubuntu, with Linux 2.6.35-31-generic' --class ubuntu --class gnu-linux --class gnu --class os {
menuentry 'Ubuntu, with Linux 2.6.35-31-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
menuentry 'Ubuntu, with Linux 2.6.35-30-generic' --class ubuntu --class gnu-linux --class gnu --class os {
menuentry 'Ubuntu, with Linux 2.6.35-30-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
menuentry "Memory test (memtest86+)" {
menuentry "Memory test (memtest86+, serial console 115200)" {
menuentry "Windows NT/2000/XP (loader) (on /dev/sda1)" {
menuentry "Ubuntu, with Linux 2.6.32-34-generic (on /dev/sdb1)" {
menuentry "Ubuntu, with Linux 2.6.32-34-generic (recovery mode) (on /dev/sdb1)" {
menuentry "Ubuntu, with Linux 2.6.32-33-generic (on /dev/sdb1)" {
menuentry "Ubuntu, with Linux 2.6.32-33-generic (recovery mode) (on /dev/sdb1)" {
menuentry "Windows Vista (loader) (on /dev/sdc1)" {
From mine you can see why I prefer the "saved" method.
Now you are ready to edit the grub file…
- Note: If you would rather use a GUI editor like Gnome Text editor, see the note at the end.
Type in the terminal sudo nano -B /etc/default/grub and your password if asked
user@YourComputer:~$ sudo nano -B /etc/default/grub
and the nano editor will open, thus (for mine)...
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
GRUB_DEFAULT=saved
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX_DEFAULT="delayacct"
GRUB_CMDLINE_LINUX=""
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480
GRUB_GFXMODE=1280x800
GRUB_GFXPAYLOAD_LINUX=1280x800x8
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_LINUX_RECOVERY="true"
# Uncomment to get a beep at grub start
GRUB_INIT_TUNE="480 440 1"
GRUB_SAVEDEFAULT=true
GRUB_BACKGROUND=/usr/share/images/grub/Apollo_17_The_Last_Moon_Shot_Edit1.tga
In my preferred way, I made these changes from the standard grub file:
- I changed the value of GRUB_DEFAULT to "saved"
GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true
In the way you are asking far to this
- Change the value of GRUB_DEFAULT to the name of the Windows system you want to always boot. This will be found in the previous
grep …
output prior. For my system if I wanted to only allways boot my Window XP, I set GRUB_DEFAULT to "Windows NT/2000/XP (loader) (on /dev/sda1)", everything between the "'s.
GRUB_DEFAULT="Windows NT/2000/XP (loader) (on /dev/sda1)"
You could set GRUB_DEFAULT to the line number in the menu entry list (with 0 being the first), but when the kernel in Ubuntu is updated grub adds the new kernel to the top of the list, you would have to change the number, since Windows is the last one in the menu entry list. You can see this in my menu entry list.
Important last step
Now you have to run update-grub to update the system generated grub.cfg file in the /boot/grub directory.
Type into your computer sudo update-grub and your password if asked…
user@YourComputer:~$ sudo update-grub
Generating grub.cfg ...
Found background: /usr/share/images/grub/Apollo_17_The_Last_Moon_Shot_Edit1.tga
Found linux image: /boot/vmlinuz-2.6.35-31-generic
Found initrd image: /boot/initrd.img-2.6.35-31-generic
Found linux image: /boot/vmlinuz-2.6.35-30-generic
Found initrd image: /boot/initrd.img-2.6.35-30-generic
Found memtest86+ image: /boot/memtest86+.bin
Found Windows NT/2000/XP (loader) on /dev/sda1
Found Ubuntu 10.04.3 LTS (10.04) on /dev/sdb1
Found Windows Vista (loader) on /dev/sdc1
done
Notes on nano
nano is especally easy to use in the terminal. Move around with the arrow keys. Type in you addtions, delete the unwanted.
The " -B" (or " --backup") option backs up the previous version of it to the current filename suffixed with a ~. Very handy in case of the dreaded Fat pfinger effect.
When you are though, Crtl-O will allow you to save your edits by hitting Enter.
Closing nano without saving, Ctrl-X
These and other options are shown at the bottom of the terminal screen with the ^ indicating Ctrl
^G Get Help ^O WriteOut ^R Read File ^Y Prev Page ^K Cut Text ^C Cur Pos
^X Exit ^J Justify ^W Where Is ^V Next Page ^U UnCut Text ^T To Spell
Notes about nano, sudoeditor, and other editors.
Some in the Ubuntu community suggest sudoedit instead of nano. I recommend nano (which is the default sudoedit editor in later distributions of Ubuntu) instead of sudoedit because the default can be overridden in non-obvious ways (unless you are an administrator). sudoedit is safer in that it automatically saves a backup copy of the edited file, but the "-B
" command line option in nano does the same thing. nano is safer than other editors like vi or emacs because it doesn't have scary shell escapes.
If you prefer not to use the nano editor and prefer the Gnome Text Editor, instead of sudo nano -B use gksu gedit. I generally do this for large files, and /etc/default/grub
could easily be considered a large file. Thus type in gksu gedit /etc/default/grub instead of sudo nano -B /etc/default/grub. Note that the Gnome text editor does not automatically make a backup!
Notes on my grub file
I made some changes to grub for my personal needs. Such as the background picture of the moon launch. How to do these are discussed at the Ubuntu Community Documentation page on Grub2, recommended.
Good luck!