how to set grub to start windows by default permanently

Asked by ndv

I have set up for a friend a dual boot solution windows/ubuntu in order to ease his transition from windows to linux, however he still wants to boot windows by default.
at the moment I have set it up without problem, but I know that at the first kernel update a new kernel will be listed in /boot/grub/menu.lst and the configuration will change.
I can I set up brub/ubuntu to boot chainloader +1 by default regardless the number of entry in menu.lst?
i have also tried to configure the parameter "howmany" from "all" to 1 in order to keep a consistent grub configuration, but after a kernel upgrade grub didn't honour the parameter, Moreover I discovered it was overwritten by a default "#howmany=all" line.
thanks
ndv

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu grub Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Paolo Naldini (hattory) said :
#1

Edit your /boot/grub/menu.lst and find this sentence:
# Set the default entry to the entry number NUM. Numbering starts from 0, and # the entry number 0 is the default if the command is not used. ... default 0 ...

So, If you have a grub similar to this:
Ubuntu, kernel 2.6.20-12-generic
Ubuntu, memtest86+
0ther Operating Systems:
Microsoft Windows XP Home

You just need to change:
default 0
with
default 3

The important is not to consider "0ther Operating Systems:" line in the count.

Revision history for this message
ndv (ndv-excite) said :
#2

Thanks Paolo for your answer,
I had done precisely what you explained already, but my question was:
in case of kernel upgrade the kernel listed will be 4 and not 2 anymore (2 kernels and 2 recovery kernels) thus I'd have to edit again menu.lst and ensure to change the value "default" from (say) 3 to 5.
next upgrade ubuntu will automagically add another copuple of kernels respawning the problem (from, say, 5 to 7).

I have already had a look into menu.lst and I also had set the value "howmany" to 1 believing in grub (or update procedure) to honour the parameter (it shall list just n kernels), but it is wiped every time a kernel is upgraded.

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

so my question is still open:
I'd like to specify a particular kernel or chainloader regardless of the number of kernels added before the line I specify and that can endure a kernel upgrade.

===
Thanks
NDV

Revision history for this message
Artem Popov (artfwo) said :
#3

Hello, NDV!

You can try putting the chainloader-entry above all the uncommented "Ubuntu"-entries and set the "default" option to 0. In this case, the first entry should remain the same even after the kernel upgrades.

Can you help with this problem?

Provide an answer of your own, or ask ndv for more information if necessary.

To post a message you must log in.