Dual boot linux and Windows Vista from Windows bootloader

In Windows Vista Microsoft changed the loader tools. There is no way to use boot.ini file any more. It was easy and clean way to add linux as secondary system ,but not any more.

To add linux as secondary system in multiboot menu we have to follow the procedure below:

  • Install linux on a separate partition (lets say hda2 and swap on hda3 - it does not matter where).
  • While installing linux tell it to install the boot loader in the partition boot sector not hard drive master boot record. This way linux will be able to start when first sector of its own partition its loaded and executed. It will not override windows loader so we wont mess Vista up.
  • Run your new linux from rescue drive or live cd like knoppix or ubuntu install cd. You have to access the new linux partition from linux environment to copy the first sector into a file.
  • Copy the first sector of linux partition into a regular file with dd command like this:
    dd if=/dev/hda2 bs=512 count=1 of=bootsec.lin
    

    This will make copy of linux boot loader into a bootsec.lin file.

  • Copy the bootsec.lin onto a Vista drive via network pen drive or whatever other way. You need this file on Windows Vista start partition
  • Run your Vista
  • Run cmd command as administrator. You can create shortcut on the desktop to cmd.exe. Then you right click on it and pick run as administrator. Otherwise you wont have permissions to change the boot process.
  • Run bcdedit tool and take a look on the current configuration
    bcdedit /enum
    
  • Add new entry into vista loader table with description Linux_in_hda2 (just for us)
    bcdedit /create /application BOOTSECTOR /d "Linux_in_hda2"
    

    This command will show you a new ID of the boot record entry like {c4c13df3-7949-11dc-98f8-81e4e48608ff} or something similar. You have to copy this ID into clipboard and paste in following commands. Dont use the id in example commands as it wont work, use the ID your system gave you.

  • Make sure your bootsec.lin is in c: and point new boot entry to it:
    bcdedit /set {c4c13df3-7949-11dc-98f8-81e4e48608ff} PATH \bootsec.lin
    bcdedit /set {c4c13df3-7949-11dc-98f8-81e4e48608ff} device boot
    
  • Make it a last entry on the list (it wont be default system)
    bcdedit /displayorder {c4c13df3-7949-11dc-98f8-81e4e48608ff} /addlast
    
  • Verify your new loader config

    bcdedit /enum 
    

Next time you start your computer you will see a nice menu where you can select windows vista or linux system. It should not affect your windows at all nor linux should be uncomfortable with it.

Comments

Post new comment

Image CAPTCHA