Monday, April 14, 2008

Booting Ubuntu with Vista Boot Loader

Make sure you have grub installed in the same partition as the Ubuntu, not in MBR. Now boot into any linux Live CD and do this:

$sudo dd if=/dev/sdX of=ubuntu.bin bs=512 count=1

Here X is the drive number where ubuntu is installed. Now copy the ubuntu.bin file in your Vista's \Boot folder.

Now boot into Vista and run bcdedit.exe as administrator.

C:\Windows\system32>bcdedit.exe /enum


will show you current entries in the boot menu.

C:\Windows\system32>bcdedit.exe /create {legacy} /d "Ubuntu Linux"
C:\Windows\system32>bcdedit.exe /set {legacy} device partition=C:
C:\Windows\system32>bcdedit.exe /set {legacy} path \Boot\ubuntu.bin
C:\Windows\system32>bcdedit /displayorder {legacy} {current}


Now reboot the system and see the new entry in the boot loader.

More detailed info can be found here.

12 comments:

Unknown said...

its saying legacy is already taken. i understand this is because im triplebooting xp, 7 (bcd is same as vista) and ubuntu 9, but how can i get around this?

Rophiroth said...

I can't make my ubuntu.bin correctly. my ext3 partition with ubuntu 9 is in SDA5 and the .bin show me only 0000000...* 000222.

I test make the .bin with my SDA3(who is the extended) and there make a file larger tan only 0000... but doesn't work too. It gave me an error when try to boot.

Any suggestion?

Abu Zaher Md Faridee said...

@Ro: Is your GRUB in the same partition as the Ubuntu? Basically what you need to point with /dev/sdaX is the partition where your GRUB is installed. Also are you using grub2 or the normal one?

Abu Zaher Md Faridee said...

@Chris: There are some GUI tools that can help you in this situation, I assume there is a way around if the legacy is already taken.

Unknown said...

which tool? easybcd? (it failed, but i can give it another shot i suppose)

also, wheres the techy fun in using a gui??! heheh

Rophiroth said...

@Abu: i'm using the default grub of ubuntu 9, i guess my grub is in my ext3 partition, there is a % to be in other place?.

I have 2 ntsf(vista and xp) and 1 ext3(ubuntu 9).

thnx u for your time :)

Unknown said...

you can put your bootloader of the grub either on the mbr or on the partition...it really doesnt matter where, unless you try to have windows recognize the operating system, which will have to be on the partition.

Abu Zaher Md Faridee said...

@Chris: Yeah, EasyBCD, I tried it once I garbled things up and was in a hurry. It worked fine for me. But I agree, GUI kills the techy fun. :)

@Ro: When you installed Ubuntu, did you tell it to install Grub? (there might be a check box or something in the installer) and if so did you explicitly tell it to install it to the partition or the MBR. The default action is probably the MBR, which WON'T work for us. I know there should be a logical explanation for this but right now I'm in a Mac and don't have Vista installed, so can't check now :(

Rophiroth said...

thanks you man, if i found more info i'll post.

PD: can I in grub put a link and jump vista loader directly to windos vista(or 7)?

Unknown said...

@ro
want the simple answer? no. i did some research into that and chainloaders, but im pretty sure it doesn't work, because when you install 7 after vista (or visa versa) they both share a bootloader.

Unknown said...

now what about setting the grub timer to 0, go straight into window's bootloader, and find a way to have that load linux? now you have what i was asking about :D

Anonymous said...

Cool post as for me. I'd like to read something more about this topic.
BTW look at the design I've made myself A level escorts

Back to Blogging

After a failed attempt last year to get back to blogging, I'm trying it again this year. I really wanted to get back, but got busy will...