Ubuntu / Vista dual boot

and keeping previous Ubuntu

You need this:
  • Ubuntu Dapper Drake Live-CD
  • Windows Vista Beta2 DVD (or a fast connection to download it)
  • Some time to spare

This tutorial guides you through the steps of installing Windows Vista on a computer which already have an Ubuntu installation.

I wrote this tutorial because I haven't found a "Ubuntu/Vista dual-boot" that works when Ubuntu is already installed. There are only tutorials saying "Install Vista first, then Ubuntu!".

But if you have a working Ubuntu and you don't want to reinstall everything?! Then read this...

Ubuntu Logo

Most of you out there have propably heard of Windows Vista: the next generation of Windows from MS that is going to replace XP as desktop standard. It is still in beta stage and is not for stable enough to use as your primary os. That is why you should have a dual-boot install.

Windows Vista Logo

Microsoft has made Vista a public beta, meaning that you can download it for free(!) and try out (but only use it for a year or so...)

As primary OS I use the brilliant Linux distribution Ubuntu Dapper Drake. Now I wanted to make my computer able to start both Ubuntu and Windows Vista...

Before leaving Ubuntu you have to prepare your harddrive. It can be done with gparted. In a Terminal:

> sudo apt-get install gparted
> sudo gparted

Or if you prefer to do it in a gui:

There are lots of guides to help you partition your harddrive. resize your partitions and leave room (unallocated) for Vista. It needs at least 15 GB space. I recommend 20+ GB. I installed Vista on a second harddrive, but a single drive with lot of space would do it.

Vista is easy to install, almost as easy as Ubuntu. During the install choose the empty space to create a new ntfs partition.

By experience I know that Microsoft don't care about the user; they will just run over you. The installer for Vista is a good example of that. It deleted my Ubuntu loader (GRUB). Next time I booted the machine it loaded Vista. I got no option to start Ubuntu. The same will happen to you, my friend. But do not fear! Ubuntu is a Linux distro, and you can always make Linux work again.

Well, hopefully Vista is working now. You can play around with it for a while if you want. I got addicted to a small game called Inkball...

Here is more info about GRUB's way of naming the disks.

Now stop playing! You must have your Ubuntu to work again. Microsoft erased GRUB and replaced it with it's own crappy loader (wich cannot load Linux). It's time to get GRUB back into the MBR. Find your Ubuntu Live-CD (other Live discs may also work) and boot it. Then launch a terminal:

> sudo grub

grub> root (<press tab>

Now you will see a list of available harddrives if you have several (In my case hd0,hd1). Choose the one where you have ubuntu (probably hd0)

grub> root (hd0,<press tab>

This time you should see a list of partitions and their filesystems on the drive. This is what it may look like:

grub> root (hd0,
 Possible partitions are:
   Partition num: 0, Filesystem type unknown, partition type 0x7
   Partition num: 2, Filesystem type is ext2fs, partition type 0x83

Note the number of your Ubuntu partition (with ext2fs filesystem). Also remember (or write down) the partition number with an unknown filesystem 0x07; that is your Vista on an ntfs partition. Now set grub's root to the right partition (In my case (hd0,2)) and then install grub to mbr.

grub> root (hd0,2)
grub> setup (hd0)
grub> quit

Now restart your computer! You should see GRUB loading and you are able to boot Ubuntu. The last you have to do now is to add Vista to the GRUB list. Once again, fire up a terminal:

> gksudo gedit /boot/grub/menu.lst

At the bottom of the file add the following:

title  Microsoft Windows Vista Beta 2
root   (hd0,0)  #Remember Vistas partition number?
chainloader +1

Save the file and restart your machine to see if it's working. Hopefully it is. It worked fine for me. Now enjoy your dual boot system!

If you have comments or questions about this howto, visit this forum ubuntuforums.org

Reader Comments

Posted by Erik Eloff http://www.eloff.se
on September 2 2006 20:32

Just trying the comments function I added now...

Posted by zia
on September 11 2006 17:45

I Use vista and ubuntu too
Nice, but here other problem
grub> root (hd0,
Possible partitions are:
Partition num: 0, Filesystem type unknown, partition type 0x7
Partition num: 1, Filesystem type unknown, partition type 0x7
Partition num: 4, Filesystem type is fat, partition type 0xb
Partition num: 5, Filesystem type unknown, partition type 0x82

that's mean I can't find my ubuntu partition, any solution please???

Posted by Erik Eloff
on September 15 2006 20:33

Hello Zia!

I can't tell you exatly wich partition that is the right one, since you have no type 0x83 (ext3). That is the Ubuntu standard filesystem.

0x7 is a windows ntfs disk, and probalby not Ubuntu.

I would try with number 4.

Test this:
root (hd0,4)
cat /etc/fstab

If you get any output this is the disk. If you get a "File not found" it's wrong

Posted by Louis
on September 27 2006 06:01

going to try

Posted by Stefan
on October 17 2006 11:49

Works like a charm! I can finally boot Fedora 5 again :D

Posted by rameez
on January 13 2007 19:25

i want pictures of how to dual boot Ubuntu

Posted by Usman
on January 25 2007 13:57

Hey Eric,

You might want to add that you have to set the "boot" flag on the unallocated/unrecognized partition after you create it using gparted if you plan on installing vista on the same hd as ubuntu. Otherwise, vista will keep saying that it does not meet the criteria when you try to install it on that partition.

Posted by adam
on January 26 2007 05:48

Any ideas on when I try to run the command 'setup' after I specify the root drive I receive: Error 11: Unrecognized Device String. Thanks for any help!

Posted by Angel http://none
on January 26 2007 20:29

Usman, what do you mean? Sorry, just converted to Linux, but still kind of need vista.

10 Posted by greg
on February 13 2007 05:36

I tried your method, but I didn't know where to put grub. I have Vista on (hd0,0) and Ubuntu 6.10 (edgy) on (hd1,0). What can I do to get my Ubuntu to boot?

11 Posted by Pablo Miranda http://www.2pelex.com
on February 21 2007 20:15

This howto was wonderfull, i have now in my pc vista,xp,ubuntu, thanks Erik!!!

12 Posted by Justin Smith
on March 14 2007 06:33

I'm having some troubles. Some distros such as Sabayon will automatically place Vista in GRUB, and even when I place it in there manually I get the same error, "BOOTMGR is missing, press Ctrl+Alt+Del to restart" Any ideas? I've been scouring the web for a solution, no luck, even with fresh installs.

13 Posted by Pixel Eater
on March 26 2007 09:48

Thank you, this was the best explanation I found for this. Now to repair XP's ntloader, lol.

14 Posted by Cole http://www.cole-web.com
on April 7 2007 03:02

Thanks so much for this! I'm fairly new to Linux, and this was easy to understand and I learned a lot :) Thanks!

15 Posted by Sean
on April 18 2007 16:28

Hey, thanks for the howto - I was curious if I already had Ubuntu installed then installed Vista on a different partition before I read this page..Can I get my Ubuntu to boot again or do I need to re-install? - Thanks!

16 Posted by Robin http://robinvista.blogspot.com
on June 2 2007 05:20

Can you please help in giving out instructions for installing Ubuntu on my notebook which runs Windows Vista. I have a hidden partiton on my laptop which can restore Vista and other application without using any cd's in 10 minutes. I don't want to loose this. I am using Windows Vista installed on the laptop and want to Install Ubuntu without loosing anything. How can I do this?

17 Posted by Alucardus http://www.outlawgamesstudio.com
on June 4 2007 01:19

Going to try this with Vista Ultimate Edition and Ubuntu 7.04 "Fiesty" tonight after I get home from work, I'll post a comment if it works, or a vomment if it doesn't. ;)

Don't forget!! Dell now shipping select systems with Ubuntu 7.04 "Fiesty"

"Can you tell I work for Dell?"

Dell L2 XPS Tech PHX

18 Posted by AriciU http://gjwrjg
on June 22 2007 11:39

Unfortunately i followed this guide and lost the Vista bootloader.

I entered everything fine in the menu.lst but i get a GRUB Error 18: Selected cylinder exceeds maximum suported by BIOS

This did not happen back when i had XP and i was triple booting (vista, xp and ubuntu) thru it so there is no problem with my BIOS being old and can't recognise high capacity disk drives and stuff like that.

19 Posted by Al Wajunga
on July 19 2007 19:08


I have a dual boot Ubuntu and Windows Vista system on one hard drive. Grub works very nice and I also setup one logical 5GB NTFS partition so that I could share files between Linux and Windows. The trouble is that I can write to the partition with Windows but not with Linux. I've tried changing permissions (from read to read and write, it is owned by unknown) however I can't seem to do that within Ubuntu Linux. Note, I don't even know how to login as root in Ubuntu. I'm a bit new to Ubuntu so maybe I'm missing something obvious. Do you have any suggestions?


20 Posted by madjayhawk
on October 23 2007 20:36

Do not use "Setup (hd0)" because it will corrupt or remove your Vista loader. If you corrupted the Vista loader and Vista will not boot, use Vista disk and do a repair. You might have to do it a couple of times for it to restore the loader.

Use "Setup (hd0,0)" instead.

21 Posted by Ram
on December 24 2007 17:01

I was having xp & ubuntu, i had removed xp (hd0,0) and installed vista. I did as above instead of >grub setup(hd0) i did >grub setup(hd0,0) as per the last post. I could not start vista as it was coming back to grub again and again. After repairing the vista boot loader, i did exactly as per the above and can boot vista & ubuntu.
Thanks a lot pal.


22 Posted by abhishek http://eloff.se
on June 9 2008 19:47

hey i installed vista 1st and later ubuntu latest desktop edition nw i cant go back to vista as it automatically loads ubuntu any solution please

23 Posted by wholesale jewelry http://www.bjbead.com
on November 5 2008 03:56

good website,thanks for sharing

24 Posted by dan
on December 15 2008 00:20

Good info.

When in grub, simply pressing tab didn't work for me, it just came back blank.

I used the following command from inside grub to find the correct setting:

grub > find /boot/grub/stage1

25 Posted by Araceli
on March 14 2009 23:25

Well, I tried installing Ubuntu onto my laptop that had Vista already. Everything seemed to go well until I could not figure out how to get Ubuntu to recognize my wireless driver. So, as disappointing as it was, I had to uninstall Ubuntu...
dtv antenna

26 Posted by poker odds calculators http://www.aboutpokerodds.com
on March 27 2009 12:41

Most of you out there have probably heard of Windows Vista: the next generation of Windows from MS that is going to replace XP as desktop standard. It is still in beta stage and is not for stable enough to use as your primary os. That is why you should have a dual-boot install.There are lots of guides to help you partition your hard drive. re size your partitions and leave room (unallocated) for Vista.The installer for Vista is a good example of that. It deleted my Ubuntu loader.Next time I booted the machine it loaded Vista.I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own word press blog now. Really the blogging is spreading its wings rapidly.Your write up is a fine example of it.