# Modifying GRUB in Kubuntu



## JT44 (Sep 4, 2007)

I installed Kubuntu, and despite telling it not to install GRUB, it installed it anyways.

How can I modify GRUB so that Windows is the default (and first listed) o/s?


----------



## CouchMaster (May 26, 2003)

Modify the menu.lst with gedit (I believe it's gedit in Ubuntu) as root then save - make sure you save the original as a backup too. If you search these forums you will find the specific commands to do so.
Wubi would have done it for you...


----------



## lotuseclat79 (Sep 12, 2003)

JT44 said:


> I installed Kubuntu, and despite telling it not to install GRUB, it installed it anyways.
> 
> How can I modify GRUB so that Windows is the default (and first listed) o/s?


In line with what CouchMaster said, if you do not have a line in the menu.lst that is:
default=0 
or 
default=1
then insert a default=0 line and if Windows is the first one in the Grub boot menu, then it will be the default boot OS. Yo might also want to put in a line as follows:
timeout=15
to give yourself 15 seconds to decide which OS to boot up.

-- Tom


----------



## JT444 (Sep 24, 2007)

Man, I am having a horrible password day. I forgot my password for this site, and I can't log in as root. Why? Because #$*%& Kubuntu _didn't ask to create a root password_. And no, I can't log in using a blank password. So I can't edit menu.lst.

I do realize what my problem is when I tried reinstalling Kubuntu a few minutes ago. It wouldn't let me not install Grub, so I installed it in the only logical place - on the second partition of the hard drive where Linux was installed. I figured after the MBR loaded up and I selected Kubuntu (how I have it set), it would go to Grub on the Linux partition. For some reason, it's now coming before the MBR... but the MBR is still there and in tact!

If I'm not being clear, please tell me. I'm extremely confused. Grub has placed itself before the MBR, if I uninstall Linux and wipe that partition I can't access Windows, and I have no root password.


----------



## CouchMaster (May 26, 2003)

Wow, sudo, or sudo su, or maybe just su should allow you to edit the menu.lst - Ubuntu doesn't create a 'root' password - you log on with a user name and a user password and if a password is asked for by anything it's the user one. Sudo means superuser.


----------



## darkelf_18 (Jul 26, 2003)

here is a GUI for editing GRUB... http://ubuntuforums.org/showthread.php?t=228104


----------



## saikee (Jun 11, 2004)

Ubuntu family is different from the mainstream Linux by not installing a root account and forces the user to use the distro from the position of an ordinary user. That is its way of making the system super secure against attack. It is effective and possibly the most secure arrangement a Linux can offer.

To edit system setting requires root privileges and this can be achieve by any of the following

(1) Invoke a temporary root terminal by typing 

```
sudo su
```
 You will automatically become a root user at terminal.

(2) Prefix each system command with "sudo"

(3) Create a root account in Ubuntu family by typing 

```
sudo passwd
```
 then followed by typing the root password twice. This works only once when the root password has not been installed. Once installed the root user account can be triggered by command "su". This is a weird arrangement in a distro that an ordinary user can "create/amend" the root password.

The above ways are what I do with every member of the Ubuntu family.


----------



## ManiDhillon (Sep 26, 2007)

JT44 said:


> I installed Kubuntu, and despite telling it not to install GRUB, it installed it anyways.
> 
> How can I modify GRUB so that Windows is the default (and first listed) o/s?


Press Alt+F2 to bring up command console. Then enter the following in it.

```
kate /boot/grub/menu.lst
```
Be sure to check to open the options to run it as root. In password field you can enter your user password.

This is my menu.lst


```
# menu.lst - See: grub(8), info grub, update-grub(8)
#            grub-install(8), grub-floppy(8),
#            grub-md5-crypt, /usr/share/doc/grub
#            and /usr/share/doc/grub-doc/.

## default num
# 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.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not change this entry to 'saved' or your
# array will desync and will not let you boot your system.
default		0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout		10

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

Pretty colours
color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line)  and entries protected by the
# command 'lock'
# e.g. password topsecret
#      password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title		Windows 95/98/NT/2000
# root		(hd0,0)
# makeactive
# chainloader	+1
#
# title		Linux
# root		(hd0,1)
# kernel	/vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
##      kopt_2_6_8=root=/dev/hdc1 ro
##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=2a71bfd7-67bf-40ec-b5ed-1f1ebd0b0faa ro

## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,3)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
##      alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
##      lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
##      lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(recovery) single
# altoptions=(recovery mode) single

## 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

## should update-grub create memtest86 boot option
## e.g. memtest86=true
##      memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## ## End Default Options ##

title		Kubuntu Feisty Fawn 7.04
root		(hd0,3)
kernel		/boot/vmlinuz-2.6.20-15-generic root=UUID=2a71bfd7-67bf-40ec-b5ed-1f1ebd0b0faa ro quiet splash
initrd		/boot/initrd.img-2.6.20-15-generic
quiet
savedefault

title		Kubuntu, Kernel 2.6.20-15-generic (Recovery Mode)
root		(hd0,3)
kernel		/boot/vmlinuz-2.6.20-15-generic root=UUID=2a71bfd7-67bf-40ec-b5ed-1f1ebd0b0faa ro single
initrd		/boot/initrd.img-2.6.20-15-generic

title		Kubuntu, memtest86+
root		(hd0,3)
kernel		/boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
# title		Other operating systems:
# root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hda1
title		Windows Vista Basic
root		(hd0,0)
savedefault
makeactive
chainloader	+1
```
*To use Windows as default OS change the 8th line default 0 with savedefault . This will fix your issue. Don't copy my file coz every HDD has different boot configs.*


----------

