0

I have a Dual boot system (Windows 7 and Ubuntu). Currently the default OS on startup is Ubuntu. I want to change the Default Boot OS from Ubuntu to Windows (Ubuntu-> Windows) i.e. on Startup Windows should boot by default. Boot sequence is to be changed from while I am on Ubuntu side. I know that this can be done from Windows side using BCDEDIT.exe. One possible solution is to load the registry (Mount windows file system and go to Windows/System32/config) and edit the registry values (using chntpw). But I don't know which values I should change.

Thanks

1 Answer 1

0

Open a terminal by pressing CTRL+ALT+T and type the following:

grep menuentry /boot/grub/grub.cfg  

You will get an output similar to this : enter image description here

 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 7 (loader) (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-A4AE5922AE58EE74' {

Now look for something like the last line:

menuentry 'Windows 7 (loader) (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-A4AE5922AE58EE74' {
    menuentry "Memory Tester (memtest86+)" --class memtest86 --class gnu --class tool {

From that we only need the Windows 7 (loader) (on /dev/sda1) part.

Next we need to edit /etc/default/grub and change the following two lines for what we need to achieve:

sudo gedit /etc/default/grub

Change the value of GRUB_DEFAULT to the name of the Windows system you want to always boot.

`GRUB_DEFAULT="Windows 7 (loader) (on /dev/sda1)"`

Then update grub,

sudo update-grub
1
  • 1
    Thanks Tarun for your answer. But I have installed Ubuntu using wubi. So currently I get windows boot loader instead of grub. So is there a way of changing entries in windows Boot loader from Ubuntu. We mount the windows registry from ubuntu and make changes in the registry using a tool 'CHNTPW'. But I don't know where exactly I need to change the entries. It's somewhere in HKEY_LOCAL_MACHINE\BCD00000000
    – ankit
    Jun 30, 2014 at 9:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .