修改Ubuntu启动菜单使windows XP/Vista/win 7变为默认启动系统
很多朋友在电脑上装了Windows和ubuntu双系统,电脑是一个人用的还好;假如是公用的,其他用户在启动时看到多系统启动界面会不知所措,对于自己而言,这样的启动也会给自己浪费很多时间。所以,将默认启动的系统改为Windows是很有必要的。
在ubuntu系统中打开终端,输入:sudogedit/boot/grub/menu.lst
这时会弹出文本编辑器,内容如下:
-----------------------------------------------------------------------------------------------------------------------------------
#menu.lst-See:grub(8),infogrub,update-grub(8)
#grub-install(8),grub-floppy(8),
#grub-md5-crypt,/usr/share/doc/grub
#and/usr/share/doc/grub-doc/.
##defaultnum
#SetthedefaultentrytotheentrynumberNUM.Numberingstartsfrom0,and
#theentrynumber0isthedefaultifthecommandisnotused.
#
#Youcanspecify'saved'insteadofanumber.Inthiscase,thedefaultentry
#istheentrysavedwiththecommand'savedefault'.
#WARNING:Ifyouareusingdmraiddonotchangethisentryto'saved'oryour
#arraywilldesyncandwillnotletyoubootyoursystem.
default0
##timeoutsec
#Setatimeout,inSECseconds,beforeautomaticallybootingthedefaultentry
#(normallythefirstentrydefined).
timeout10
##hiddenmenu
#Hidesthemenubydefault(pressESCtoseethemenu)
#hiddenmenu
#Prettycolours
#colorcyan/bluewhite/blue
##password['--md5']passwd
#Ifusedinthefirstsectionofamenufile,disableallinteractiveediting
#control(menuentryeditorandcommand-line)andentriesprotectedbythe
#command'lock'
#e.g.passwordtopsecret
#password--md5$1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
#passwordtopsecret
#
#examples
#
#titleWindows95/98/NT/2000
#root(hd0,0)
#makeactive
#chainloader+1
#
#titleLinux
#root(hd0,1)
#kernel/vmlinuzroot=/dev/hda2ro
#
#
#Putstaticbootstanzasbeforeand/orafterAUTOMAGICKERNELLIST
###BEGINAUTOMAGICKERNELSLIST
##linesbetweentheAUTOMAGICKERNELSLISTmarkerswillbemodified
##bythedebianupdate-grubscriptexceptforthedefaultoptionsbelow
##DONOTUNCOMMENTTHEM,Justeditthemtoyourneeds
####StartDefaultOptions##
##defaultkerneloptions
##defaultkerneloptionsforautomagicbootoptions
##Ifyouwantspecialoptionsforspecifickernelsusekopt_x_y_z
##wherex.y.ziskernelversion.Minorversionscanbeomitted.
##e.g.kopt=root=/dev/hda1ro
##kopt_2_6_8=root=/dev/hdc1ro
##kopt_2_6_8_2_686=root=/dev/hdc2ro
#kopt=root=UUID=2d1136cb-416a-4329-8c6d-703537a2d578ro
##Setupcrashdumpmenuentries
##e.g.crashdump=1
#crashdump=0
##defaultgrubrootdevice
##e.g.groot=(hd0,0)
#groot=(hd0,7)
##shouldupdate-grubcreatealternativeautomagicbootoptions
##e.g.alternative=true
##alternative=false
#alternative=true
##shouldupdate-grublockalternativeautomagicbootoptions
##e.g.lockalternative=true
##lockalternative=false
#lockalternative=false
##additionaloptionstousewiththedefaultbootoption,butnotwiththe
##alternatives
##e.g.defoptions=vga=791resume=/dev/hda5
#defoptions=quietsplashlocale=zh_CN
##shouldupdate-grublockoldautomagicbootoptions
##e.g.lockold=false
##lockold=true
#lockold=false
##XenhypervisoroptionstousewiththedefaultXenbootoption
#xenhopt=
##XenLinuxkerneloptionstousewiththedefaultXenbootoption
#xenkopt=console=tty0
##altoptionboottargetsoption
##multiplealtoptionslinesareallowed
##e.g.altoptions=(extramenusuffix)extrabootoptions
##altoptions=(recovery)single
#altoptions=(recoverymode)single
##controlshowmanykernelsshouldbeputintothemenu.lst
##onlycountsthefirstoccurenceofakernel,notthe
##alternativekerneloptions
##e.g.howmany=all
##howmany=7
#howmany=all
##shouldupdate-grubcreatememtest86bootoption
##e.g.memtest86=true
##memtest86=false
#memtest86=true
##shouldupdate-grubadjustthevalueofthedefaultbootedsystem
##canbetrueorfalse
#updatedefaultentry=false
####EndDefaultOptions##
titleUbuntu,kernel2.6.20-16-generic
root(hd0,7)
kernel/boot/vmlinuz-2.6.20-16-genericroot=UUID=2d1136cb-416a-4329-8c6d-703537a2d578roquietsplashlocale=zh_CN
initrd/boot/initrd.img-2.6.20-16-generic
quiet
savedefault0
titleUbuntu,kernel2.6.20-16-generic(recoverymode)
root(hd0,7)
kernel/boot/vmlinuz-2.6.20-16-genericroot=UUID=2d1136cb-416a-4329-8c6d-703537a2d578rosingle
initrd/boot/initrd.img-2.6.20-16-generic1
titleUbuntu,memtest86+
root(hd0,7)
kernel/boot/memtest86+.bin
quiet2
###ENDDEBIANAUTOMAGICKERNELSLIST
#Thisisadivider,addedtoseparatethemenuitemsbelowfromtheDebian
#ones.
titleOtheroperatingsystems:
root3
#ThisentryautomaticallyaddedbytheDebianinstallerforanon-linuxOS
#on/dev/sda1
titleMicrosoftWindowsXPProfessional
root(hd0,0)
savedefault
makeactive
chainloader+14
-----------------------------------------------------------------------------------------------------------------------------------
在上面的内容中原本的default值为0,意即启动排行第一的操作系统,这里代表的就是titleUbuntu,kernel2.6.20-16-generic。
现在对其进行修改,将其值改到与Windows相对应,Windows对应的索引号为4,那么就将default后的值改为4,以后启动的默认系统即为Windows了。
另外,启动界面的等待时间也可通过修改timeout后面的值进行修改。