How To : Ubuntu + WinXP + DualBoot + VirtualBox

Discussions related to using VirtualBox on Linux hosts.
Grandmasterv
Posts: 5
Joined: 1. Oct 2007, 19:25

How To : Ubuntu + WinXP + DualBoot + VirtualBox

Post by Grandmasterv »

Hi Everyone.

I'm looking for instructions on how to best go about the following. I want to run WinXP in VirtualBox under Ubuntu most of the time with the option to real boot it to play video games. I have been reading the documentation about raw disk access and I think virtualbox is capable but I have not tried this kind of thing before.

System contains 3 hard disks. 1+2 in software raid mirror with Ubuntu and 3rd for windows. This is what I came up with as a plan:

1) Format 3rd disk using Fat32 (better for interacting with linux than NTFS?), install WinXP
2) Install Ubuntu on the disk 1+2 with software mirroring. Use Grub to dual boot with windows.
3) Install VirtualBox in Ubuntu and create the special image file for raw disk access pointing to my windows disk.

Anyone else here try this? Any caveats I should be expecting. Too bad virtual box does not offer 3d support like parallels on mac or I would be running it. Does anyone know if there is any other virtualization software for linux that does support 3d good enough for games like parallels?. Also I do not want to go the CEDEGA/Wine route for games as its buggy.

Thanks alot!

- V
Grandmasterv
Posts: 5
Joined: 1. Oct 2007, 19:25

Post by Grandmasterv »

Bump. 106 views and no replies.... I'm really interested in peoples ideas and experiences with similar configurations.
Ingo
Volunteer
Posts: 731
Joined: 22. Aug 2007, 10:13
Location: Germany

Post by Ingo »

You want to run your WinXP installation by booting into it and you want to run it in a virtual machine, right?
The User manual explicitly mentions not to do this. I have seen some posts here that described how to do this. And they all have at least the problem with the drivers in the different environments. They get error messages about drivers, you always have to register your "new" installation to Microsoft after booting into the other environment etc.
Only accessing (read, write) the installation thru an independent VM is of course no problem.
Grandmasterv
Posts: 5
Joined: 1. Oct 2007, 19:25

Post by Grandmasterv »

I read the manual but I guess I was confused on that part. Looks like the best solution is linux as the host with one windows installed as a VM and one as a dual boot... Seems like a waste of space to me but I guess thats the only option.

Thanks for the feedback.
kilou
Posts: 53
Joined: 14. May 2007, 10:16

Post by kilou »

Not sure if I understood everything correctly but I've been accessing my existing XP partition (dualboot) from virtualbox and could boot into it as a VM without problem. I had to create 2 hardware profiles, one for the VM (that gets drivers from virtualbox) and one standard one when I want to boot XP natively. I remember having to mess with the registry with a specific tool to allow the harddisk partition of XP to be accessed by the VM (raw disk access).

So I'd say it works but I didn't try to install anything in XP afterwards and of course you don't want to pause the VM in linux and reboot under XP cause it'll mess everything.

Am I wrong or it's supposed to work then?
Grandmasterv
Posts: 5
Joined: 1. Oct 2007, 19:25

Post by Grandmasterv »

Hmm seems kinda sketchy not being able to install or modify the system at all after setup. I really want to work with it without any limitations but seems like I cant. So it looks like I'm going to have a virtual windows install for any apps I want to use in linux and a real one for games.

Thanks for the info!
kilou
Posts: 53
Joined: 14. May 2007, 10:16

Post by kilou »

I haven't tried it but I don't think installing apps afterwards in XP would be a problem... Maybe those should be installed from the dualboot, not from the VM (but again this is a guess). For instance the VM tools were installed in XP from the VM.........and it works.

I don't see the point of using linux + XP in a VM + another dualboot XP. This is a big waste of place and time (you'll need to update the VM and the dualboot XP).
kilou
Posts: 53
Joined: 14. May 2007, 10:16

Post by kilou »

OK I just tried it now and it seems to work! I have Ubuntu 7.04 as host and XP is installed on another partition (dualboot) and accessed from Ubuntu with Virtualbox via a vmdk file. I had to create 2 hardware profiles in XP, one used when starting XP from boot and another when accessing it through the VM. I also had to patch XP registry with a utility called mergeide to allow the harddisk to be recognized in the VM.

Then in Ubuntu as root:

VBoxManage internalcommands createrawvmdk -filename /home/kilou/.VirtualBox/WinXP.vmdk -rawdisk /dev/sda

I launched VirtualBox as root too and registered the vmdk file with it. Created a new VM pointing to the virtual harddisk (vmdk file) and go! In the VM I access the dualboot menu that let me choose to boot XP and it works.

So I was in XP guest, connected to www.download.com and downloaded and installed DivX player. I did that from the VM and it did install correctly.

This is not an extensive trial but it sounds to work correctly and you can modify the install from the VM as well as from XP native. I'd say the "only" drawback of this setup is that you cannot save the state of the VM. You have to shut down windows properly everytime in the VM if you don't want to mess with problems. Also I'd like to find a way to automatically boot XP in the VM rather than accessing the dualboot menu and having to choose it manually.

Another thing is that installing drivers in XP will probably fail if done from the VM. But you can install any driver when dualbooting and using the correct hardware profile. I don't really see any problem with that.

So unless I didn't understand something it seems to work properly and you can use XP in the VM as you would use it from the dualboot. The nice thing is of course the ability to dualboot XP to run it natively for some specific applications :)
kilou
Posts: 53
Joined: 14. May 2007, 10:16

Post by kilou »

Ingo wrote:You want to run your WinXP installation by booting into it and you want to run it in a virtual machine, right?
The User manual explicitly mentions not to do this. I have seen some posts here that described how to do this. And they all have at least the problem with the drivers in the different environments. They get error messages about drivers, you always have to register your "new" installation to Microsoft after booting into the other environment etc.
Only accessing (read, write) the installation thru an independent VM is of course no problem.
I think he wants to access his existing XP install from Ubuntu. There is no point to boot into XP and then run the same XP in a VM :shock: It's just a matter of being careful to choose the correct OS in the boot menu when launching the VM....or find a way to automatically boot XP in the VM.
Grandmasterv
Posts: 5
Joined: 1. Oct 2007, 19:25

Post by Grandmasterv »

Thanks very much for the info Kilou! That is exactly what I want. I will live with the downside of having to shutdown the vm everytime. How do you make a different hardware profile for the vm? Should I make one before I try to boot xp in the virtual machine or after.

Thanks again.
kilou
Posts: 53
Joined: 14. May 2007, 10:16

Post by kilou »

You first need to create a second hardware profile by booting natively in XP and creating it from there (control panel/system/hardware/hardware profiles and create a copy of your current hw profile then rename it to something like VBox).
You should always use one hw profile when you boot XP natively and the other (VBox) when you run XP in the VM.

Then in XP native you must also patch the registry with the mergeide util to allow XP to boot on the harddisk driver provided by Vbox (at least this is what I understood...). You'll find plenty of info about this and other crucial points o the setup here:

http://forums.virtualbox.org/viewtopic. ... aterawvmdk

Don't worry you'll get probably error messages here and there but all solutions are in the above thread (including the link to the mergeide util).

For me it works now but I'd like the VM to automatically boot on XP and not present the boot menu. In the VM take great care not to boot the same OS you have as host!! This is why I'd like to boot XP automatically in the VM when I run Ubuntu as host. Still have to figure how to do that (probably with the -mbr parameter but...).

Really the bad thing about this is that you cannot save the state of a VM for a quick restart. You always have to shutdown XP totally and start it from scratch, as you would do in a dualboot. It's bad for seamless integratio for instance because you loose time when you have to boot XP in the VM. If XP were installed in a VM you could just restore a saved state (after login) and directly access you application within seconds. The other drawback is that you really have to shutdown XP in the VM before booting into it natively, otherwise it'll mess your XP install! In any case bakup your system!!
kilou
Posts: 53
Joined: 14. May 2007, 10:16

Post by kilou »

By the way I'm unsure it is not possile to save the state of the VM if accessing an existing XP partition and then booting natiely into it. I don't want to test it as backuping my system takes a while but could someone comment on this plz? Basically I'm accessing my existing XP installwith raw disk access in a VM and I'd like to save an opened XP session in virtualbox. When doing so XP state is saved but XP is not properly shut down in the VM. Now if I reboot the computer and boot into XP natively will it cause troubles since XP wasn't properly shut down in the VM (state saved)??????

Another thing Grandmastery, you might want to try the following:
install "mbr" package in your Linux host and run "install-mbr --force opensource.mbr". This will create a file called opensource.mbr in your home directory

Then create te VM with:

VBoxManage internalcommands createrawvmdk -filename /home/kilou/.VirtualBox/WinXP.vmdk -rawdisk /dev/sda -partitions 2,6 -mbr /home/kilou/opensource.mbr -relative

(change partition to access and paths according to your system).

This will allow to access only partition 2 and 6 (2 is my XP partition and 6 is the one with docs etc). The other nice thing is that the opensource.mbr will allow to direcly boot the VM into XP, no more boot menu in the VM. Great! Now the top of the top would be t automatically select the correct hardware profile when booting XP in the VM but I don't know if this is possible....
kilou
Posts: 53
Joined: 14. May 2007, 10:16

Post by kilou »

One issue: since I installed the vbox tools in the VM I cannot dualboot anymore (I can't type my password at the login prompt). I can only access XP from the VM but no more with dualboot despite the fact I use different hardware profiles to run the VM or to dualboot. Has anyone else experienced the same issue??
Seb
Posts: 1
Joined: 14. Nov 2007, 13:06

Post by Seb »

Hi,

I do have a dual boot XP/Ubuntu and I was about to try to access my XP installation from Ubuntu. However, as kilou experienced, is it a normal problem that after installing the vbox tools in the VM one can not dual boot anymore??

Thanks a lot,

Seb.
jprobichaud
Posts: 3
Joined: 23. Mar 2008, 08:08

Post by jprobichaud »

There seems to be an issue with agp440 being present while trying to boot within the VM. For those on this forum who were able to make the dual-boot working, what did you do about this issue? Or perhaps, you had a PCI video card and not an AGP one?
Post Reply