Académique Documents
Professionnel Documents
Culture Documents
- Ask Ubuntu
Ubuntu
Community
Ask!
Developer
Design
Discourse
Hardware
Shop
More
sign up
Questions
Tags
Tour
log in
tour
help
search
Users
Ask Question
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.
How do I set the bootloader so that in my dualboot with Windows 7/Ubuntu 11.04, Windows start up as
standard instead of Ubuntu?
grub2
45
Linked
7
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.
add comment
16 Answers
ACTIVE
OLDEST
VOTES
There are two ways of doing this using editing a grub file.
58
Related
0
http://askubuntu.com/questions/52963/how-do-i-set-windows-to-boot-as-the-default-in-the-boot-loader[21/4/2014 8:58:25 ]
grub2 - How do I set Windows to boot as the default in the boot loader? - Ask Ubuntu
# /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
In my preferred way, I made these changes from the standard grub file:
I changed the value of GRUB_DEFAULT to "saved"
GRUB_SAVEDEFAULT=true
GRUB_DEFAULT=saved
http://askubuntu.com/questions/52963/how-do-i-set-windows-to-boot-as-the-default-in-the-boot-loader[21/4/2014 8:58:25 ]
grub2 - How do I set Windows to boot as the default in the boot loader? - Ask Ubuntu
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
Pos
^X Exit
Spell
^O WriteOut
^R Read File
^Y Prev Page
^K Cut Text
^C Cur
^J Justify
^W Where Is
^V Next Page
^U UnCut Text
^T To
This incredibly complex, but excellently written answer makes a mockery of your username, sir. Well done!
Scaine Nov 27 '11 at 12:13
1 Keep it simple is based on the Einstein quote: "Things should be as simple as possible, but not too simple."
(The last three words are omitted when some quote this). Thanks for the kudo... keepitsimpleengineer
Nov 28 '11 at 20:24
love it help me a lot , but as i saw , GRUB customizer it much easy :P XD Rani.Shemer Dec 2 '11 at
20:38
This is an absolutely brilliant answer. Thanks so much for providing all that useful context; it's really, really
appreciated. twome Apr 13 '13 at 9:02
add comment
38
With a bit of command line trickery, you can get the default of grub to always be a particular grub entry for example Windows - no matter when a new kernel is installed.
In a terminal type:
fgrep menuentry /boot/grub/grub.cfg
This will display all your grub entries - for example
http://askubuntu.com/questions/52963/how-do-i-set-windows-to-boot-as-the-default-in-the-boot-loader[21/4/2014 8:58:25 ]
grub2 - How do I set Windows to boot as the default in the boot loader? - Ask Ubuntu
Highlight the entry you want to default to - for example Windows 7 in the screen-shot. Right click and
choose copy
Type
gksu gedit /etc/default/grub
Change the entry
GRUB_DEFAULT=0
to
GRUB_DEFAULT="Windows 7 (loader) (on /dev/sda2)"
i.e. paste the entry you want (including the quotes)
Save, then type
sudo update-grub
source
share improve this answer
add comment
12
You need to edit the /etc/default/grub file to set Windows as your default OS.
First Step. Determine the Windows OS' position in the grub menu. To do this, open a terminal by
pressing Ctrl+Alt+T and type the following:
grep menuentry /boot/grub/grub.cfg
This will list the grub menu entries. I'll use my grub menu as an example:
menuentry 'Ubuntu, with Linux 2.6.38-8-generic' --class ubuntu --class gnu-linux -class gnu --class os {
menuentry 'Ubuntu, with Linux 2.6.38-8-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 7 (loader) (on /dev/sda1)" --class windows --class os {
You will then select the Windows partition, in my case "Windows 7 (loader) (on /dev/sda1)" including the
double quotes and copy it.
Second Step. Open the /etc/default/grub file. To do this, type the following on the terminal:
gksudo gedit /etc/default/grub
It will open the /etc/default/grub file with gedit. Look for the GRUB_DEFAULT=0 line and change it's value
from 0 to the selected Windows menu entry by pasting it. .
GRUB_DEFAULT="Windows 7 (loader) (on /dev/sda1)"
http://askubuntu.com/questions/52963/how-do-i-set-windows-to-boot-as-the-default-in-the-boot-loader[21/4/2014 8:58:25 ]
grub2 - How do I set Windows to boot as the default in the boot loader? - Ask Ubuntu
Alternatively, you can use an integer value specifying the index position of the Windows OS, take note
that index starts counting at 0, so in my example, the Windows OS value would be 4, therefore you can
also set
GRUB_DEFAULT=4
After which, you need to update grub by typing
sudo update-grub
share improve this answer
add comment
Use startup manager, which you can start from the dash. There you can use the OS to start with in the
dropdown menu.
2 Sorry I just saw that you said that startup manager is not working in the 64bit version. you can try instead
grub customizer Install Grub Customizer in ubuntu Open the terminal and run the following command sudo
add-apt-repository ppa:danielrichter2007/grub-customizer sudo apt-get update sudo apt-get install grubcustomizer Once you install you can open from Applications -> System Toiols -> Grub Customize dago
Nov 26 '11 at 17:50
add comment
http://askubuntu.com/questions/52963/how-do-i-set-windows-to-boot-as-the-default-in-the-boot-loader[21/4/2014 8:58:25 ]
grub2 - How do I set Windows to boot as the default in the boot loader? - Ask Ubuntu
the above menu will be different to yours, so choose wisely and select the Windows 7 entry and from the
top Menu bar , select the ^ arrow to move it upward to have the top position , while booting.
For booting into Windows directly select the preference and reduce the boot-time to load windows.
add comment
1 This method needs to be modified to always correctly identify the correct menu entry (for windows). This
method will only work in the simplest setup, and may NOT survive a kernel update or other changes. See:
ubuntuforums.org/showthread.php?t=1195275 david6 Nov 27 '11 at 5:52
http://askubuntu.com/questions/52963/how-do-i-set-windows-to-boot-as-the-default-in-the-boot-loader[21/4/2014 8:58:25 ]
grub2 - How do I set Windows to boot as the default in the boot loader? - Ask Ubuntu
1 Today only the newest kernel has 2 entries (recovery and normal boot), all other kernel's are grouped in
"other kernels" (or something similar, I don't recall the name). So I have to disagree, it survives kernel
updates. imbaer Nov 27 '11 at 10:40
I added the comment because your example used =6 david6 Nov 27 '11 at 20:35
That's right, it should be =5. imbaer Nov 28 '11 at 8:40
add comment
Alt
Ctrl
Remember that you can't move single entries out of their respective group like Ubuntu can't be moved
out of Linux group.
share improve this answer
Nice, didn't know there was a GUI for GRUB2 configuration. +1 on this one ;) ruffEdgz May 17 '12 at
13:43
add comment
Grub-Customizer:
Is a very easy to use graphical GRUB2 settings manager. For now, it only allows you to edit the GRUB2
http://askubuntu.com/questions/52963/how-do-i-set-windows-to-boot-as-the-default-in-the-boot-loader[21/4/2014 8:58:25 ]
grub2 - How do I set Windows to boot as the default in the boot loader? - Ask Ubuntu
menu entries: reorder, rename or add/remove entries. It will also allow changes to background image and
menu timeout. Since these are actually scripts which generate the boot.cfg file, Grub Customizer changes
the actual script order and then generates a new boot.cfg so if you then run "sudo update-grub", your
customization won't be overwritten.
share improve this answer
add comment
Updating GRUB
Just run this command:
$ sudo update-grub
Now just restart, and the Windows entry should be highlighted as the default!
share improve this answer
add comment
From my experience, I noticed that it's not so easy to change boot priority for Win7/Ubuntu 11.04. Utility,
like Startup Manager seems like isctrying to change the default boot system, yet nothing happens after
restart (11.04 continue to boot by default). I such case I suggest Grub Customiser Grub Customised on
WebUpd8, which works well with Grub2. I just removed all absolete boot options (there are many),
leaving only 11.04 and Win7. And then changed a boot priority. Now, everything works well :)
http://askubuntu.com/questions/52963/how-do-i-set-windows-to-boot-as-the-default-in-the-boot-loader[21/4/2014 8:58:25 ]
grub2 - How do I set Windows to boot as the default in the boot loader? - Ask Ubuntu
Good luck.
share improve this answer
I have used Startup Manager on my parents' desktop dual-booting Windows XP and Ubuntu 10.04 LTS, and
aside from the fact that you have to re-run it every time you upgrade to a new kernel, it has worked nicely.
WarriorIng64 Jul 14 '11 at 18:54
Hi ! I suppose it's a matter of how Grub2 treat new kernel installs. It does not take in account new grub2
menu inserts :) Vincenzo Jul 16 '11 at 8:28
add comment
This is actually quite easy to do. First, you need to find out what Grub names your Windows entry. You
can do that by looking in /boot/grub/grub.cfg or by running this command:
sudo cat /boot/grub/grub.cfg | grep -i Windows | sed -e 's/^.* "//g' -e 's/".*$//g'
What that command does is search for Windows in /boot/grub/grub.cfg and remove the text
outside of the " characters.
The command will output something like Microsoft Windows XP Professional (on /dev/sdb2) .
Now, open /etc/default/grub by running:
gksudo gedit /etc/default/grub
and change:
GRUB_DEFAULT=0
to
GRUB_DEFAULT="Name of your Windows menu entry"
Lastly, run:
sudo update-grub
to regenerate the Grub menu. And that's it! Future upgrades won't mess this up. Your Windows menu
entry will always be selected by default.
share improve this answer
add comment
@ Daniel Guzman You seem new to Linux/Ubuntu.(judging from your choice of keeping windows the default
OS.I am sorry if i am wrong) So when you carry out the above procedure,be careful and take care that you
do not mess up with anything other than what is written.You might get into trouble. :) Nirmik May 16 '12
at 20:12
I could be wrong but didn't 11.10 use grub2 and isn't the /etc/grub/default more of an older grub1
change? Just wondering. ruffEdgz May 16 '12 at 21:29
11.10 uses grub2, my examples are from 12.04. But it's the same tomodachi May 20 '12 at 13:22
http://askubuntu.com/questions/52963/how-do-i-set-windows-to-boot-as-the-default-in-the-boot-loader[21/4/2014 8:58:25 ]
grub2 - How do I set Windows to boot as the default in the boot loader? - Ask Ubuntu
add comment
i do not know what ubuntu you have installed, so I am not sure that your OS is using grub2 or the old
grub, but it is more likely that you have grub2.
So, this is what you have to do for grub2:
grep menuentry /boot/grub/grub.cfg
This command gives you an output saying what startup possibilities / OSes you have.
this is a sample output:
menuentry 'Ubuntu, with Linux 2.6.38-8-generic' --class ubuntu --class gnu-linux -class gnu --class os {
menuentry 'Ubuntu, with Linux 2.6.38-8-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 7 (loader) (on /dev/sda1)" --class windows --class os {
As you may can observe, Windows 7 is on the 5th line of the output.
Next, you open the /etc/default/grub file with your text editor and sudo priviledges and modify the
GRUB_DEFAULT value to (the number of the line where you have Windows 7 minus one, because the
grub option index starts from 0)
So, if windows 7 is on the 5th line, you need GRUB_DEFAULT=4
if windows 7 is on the 7th line, you need GRUB_DEFAULT=6
To save the changes, type sudo update-grub . AND this is everything.
share improve this answer
add comment
Next time you boot your machine, count in shich position Windows 7 is placed in GRUB menu. (remember
you have to count from 0 - i.e. if Windows is in the third row, then its position is 2 and so on). Boot into
ubuntu, open a terminal and write
sudo gedit /etc/default/grub
then modify the line
GRUB_DEFAULT="0"
to
GRUB_DEFAULT="N"
where N is the position (starting from 0) of Windows7 entry in grub menu. Tell me if you need more info
about this.
share improve this answer
So if my windows is placed in position 2 then i will write "2" in the command where you wrote "N"?
Rasmus Peter Mathiesen Jul 13 '11 at 17:42
if it's in the second row, then you have to put 1 (the first row is numbered 0) Juan Sebastian Totero Jul
13 '11 at 17:47
thus the formula for "N" is: <line its on in human numbering> - 1 Thomas W. Jul 13 '11 at 17:53
http://askubuntu.com/questions/52963/how-do-i-set-windows-to-boot-as-the-default-in-the-boot-loader[21/4/2014 8:58:25 ]
grub2 - How do I set Windows to boot as the default in the boot loader? - Ask Ubuntu
1 Right right, thats what i ment ;) Rasmus Peter Mathiesen Jul 13 '11 at 17:54
1 Actually it doesn't, because when upgrading warns you the file it's installing has changed, and prompts you
if you want to change it, modify it or install a new one. Never had problems upgrading.
Juan Sebastian Totero Jul 14 '11 at 9:53
show 1 more comment
I use grub customizer to do that. You can have it automatically boot into a certain OS every time or just
boot into whichever OS was booted last. It is easy to install and use.
In ubuntu, open your package manager; under settings you should find "Configure Software Sources."
Click on that and enter your password. Now click on the second tab entitled "Other Software" and press
the add button toward the bottom. Enter in the PPA for grub customizer :
ppa:danielrichter2007/grub-customizer
Click OK and a couple of new lines will show up; close the Software Sources dialog now and push the
check for updates button on your package manager if it didn't already start to update the available
packages. Type into the search function : "grub-cus" and you will see the grub customizer at the top of
the list. Mark it for installation then click apply to start the process. Agree to install any dependencies so
they get installed automatically as well.
After installation, you can find grub-customizer by typing "grub" into the search dialog or you can also
find it in the menu under Applications>Settings>Grub-Customizer.
Alternately you could just open a terminal and run the following commands:
sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt-get update
sudo apt-get install grub-customizer
You may want to pick out a pretty picture to use as background to your grub boot menu.
Here are some links if you want to learn more before starting:
Launchpad PPA for Grub Customizer
Guide on How to Geek with walk through and pictures
share improve this answer
add comment
-1
Normally when I have to "mess up" the Grub I use "Grub Customizer", it has a GUI so you can see easily
what you are changing. Just type this into the terminal:
sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt-get update
sudo apt-get install grub-customizer
Then search in the Dash for grub customizer and change the predefined entry to Windows.
share improve this answer
82
I haven't used this, but I think this should be merged in to the other question as an answer if this closes.
hbdgaf Apr 6 '13 at 22:57
it is not necesarry to install software for changing the grub order. you can do it also with grub-customizer,
but it is more difficult than by command line, i think fromnaboo Apr 6 '13 at 23:56
add comment
Not the answer you're looking for? Browse other questions tagged
grub2
http://askubuntu.com/questions/52963/how-do-i-set-windows-to-boot-as-the-default-in-the-boot-loader[21/4/2014 8:58:25 ]
or ask your
grub2 - How do I set Windows to boot as the default in the boot loader? - Ask Ubuntu
own question.
question feed
about
help
badges
blog
chat
data
legal
privacy policy
jobs
TECHNOLOGY
advertising info
mobile
CULTURE /
RECREATION
SCIENCE
OTHER
Mathematics
Stack Apps
Theoretical Computer
Science
Area 51
Mi Yodeya (Judaism)
Travel
Physics
Home Improvement
Christianity
MathOverflow
Arqade (gaming)
more (7)
Programmers
Database Administrators
Photography
Server Fault
Drupal Answers
Super User
SharePoint
Graphic Design
Web Applications
WordPress Development
User Experience
Seasoned Advice
(cooking)
Webmasters
Game Development
TeX - LaTeX
Geographic Information
Systems
Mathematica
more (14)
Electrical Engineering
Android Enthusiasts
Information Security
feedback
LIFE / ARTS
Stack Overflow
Ask Ubuntu
contact us
more (11)
Skeptics
Bicycles
Role-playing Games
more (21)
site design / logo 2014 stack exchange inc; user contributions licensed under cc by-sa 3.0 with attribution required
rev 2014.4.18.1558
http://askubuntu.com/questions/52963/how-do-i-set-windows-to-boot-as-the-default-in-the-boot-loader[21/4/2014 8:58:25 ]
Community
Ask!
Developer
Design
Discourse
Hardware
Shop
More
sign up
Questions
Tags
Tour
log in
tour
help
search
Users
Ask Question
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.
12.10
grub2
dual-boot
Linked
71
windows-7
27
user138310
31
1
1
add comment
Related
marked as duplicate by vasa1, hhlp, con-f-use, Stephen Myall, Chris Wilson Mar 7 '13
at 13:09
This question has been asked before and already has an answer. If those answers do not fully address
your question, please ask a new question.
2 Answers
ACTIVE
OLDEST
VOTES
I dont know if you can change the order of the menu in an easy way, but you can set the default entry.
in terminal
sudo gedit /etc/default/grub
I dont know what your grub menu looks like but lets say:
Ubuntu
Memory test
Windows 7
in this case if you want windows 7 to boot by default you replace GRUB_DEFAULT=0 with
GRUB_DEFAULT=2
save file and in terminal:
sudo update-grub
reboot
share improve this answer
http://askubuntu.com/questions/265010/how-do-i-edit-grub-menu[21/4/2014 8:59:41 ]
The menu entry of "Windows 7" in /boot/grub/grub.cfg may look like this:
...
menuentry "Windows 7 (/dev/sda1)" { #it's depend on your config
...
You can also write GRUB_DEFAULT="Windows 7 (/dev/sda1)" to /etc/default/grub to avoid the
order problem in grub.cfg .
share improve this answer
49
Just what I was looking for today! Thanks a lot bro :) Spirit Dec 7 '13 at 13:34
add comment
Not the answer you're looking for? Browse other questions tagged
grub2
dual-boot
windows-7 or ask your own question.
about
help
badges
blog
chat
data
legal
privacy policy
jobs
advertising info
TECHNOLOGY
mobile
SCIENCE
OTHER
Mathematics
Stack Apps
Mi Yodeya (Judaism)
Theoretical Computer
Science
Travel
Physics
Home Improvement
Christianity
MathOverflow
Arqade (gaming)
more (7)
Programmers
Database Administrators
Photography
Drupal Answers
Super User
SharePoint
Graphic Design
WordPress Development
User Experience
Geographic Information
Systems
Mathematica
Webmasters
Game Development
TeX - LaTeX
more (14)
Electrical Engineering
Android Enthusiasts
Information Security
feedback
CULTURE /
RECREATION
Server Fault
Ask Ubuntu
contact us
12.10
LIFE / ARTS
Stack Overflow
Web Applications
12.04
Seasoned Advice
(cooking)
more (11)
Skeptics
Bicycles
Role-playing Games
more (21)
site design / logo 2014 stack exchange inc; user contributions licensed under cc by-sa 3.0 with attribution required
rev 2014.4.18.1558
http://askubuntu.com/questions/265010/how-do-i-edit-grub-menu[21/4/2014 8:59:41 ]