views:

11877

answers:

7

I installed VirtualBox on my Ubuntu Hardy Heron installation, and I would like to use it to virtualize Windows for those rare occasions that I actually need to do something there.

Unfortunately, I don't have an installation disk at the moment, but I do have Vista already installed on a partition (it came with the machine).

Is there a way I can easily copy this partition into a .vdi virtual image?

A: 

You can do this if you're using Microsoft's virtualization program, but I don't know that you can pack Windows into a .vdi file, but there is a way to run Windows as-is off of your physical partition:

http://dotneverland.blogspot.com/2008/08/running-your-physical-windows-xp.html

There's an old version of Dot Net Rocks that was all about running Virtual Machines. A lot of it is not relevant to your specific situation, but it's a good listen, and they talk about this type of migration (ie, the tools you'll need to run on the physical machine to migrate it, etc).

http://www.dotnetrocks.com/default.aspx?showNum=114

DannySmurf
A: 

Thanks for the response DannySmurf! Unfortunately it doesn't quite help with my situation... I've already seen this solution elsewhere, and it's not quite what I'm looking for.

The solution from dotneverland in particular is risky because it is running from the actual partition rather than a virtual disk. This means if I accidentally boot into Ubuntu, I am hosed... with Ubuntu as my default boot, I would rather not even have the opportunity to accidentally do this.

Also, this requires me to install the newest VirtualBox, but I don't particularly like installing things from outside the regular repositories, so even if running from the actual partition were an option, I would prefer to avoid this solution.

My hope is there is a way to create a .vdi file from the partition, then I can get rolling right away. I'm a bit perplexed why this isn't built into VirtualBox, but maybe they have some good reasons (or they just haven't gotten to it yet).

Mike Stone
A: 

I don't think I've actually seen exactly that from any of the virtual machine vendors. The reason, I think, is simple (assuming that the majority of virtual machines run are going to be Windows): you can't simply take an existing Windows installation and move it whole-hog onto a new machine (even onto a new virtual machine). Swapping out important components (motherboard, for example) will make the installation extremely unstable; Windows, when installed, is installed to work with the components that were there when it was installed, and moving it without a significant amount of driver prep among other things (which the MS migration tools are designed to address) will leave you with a mess.

This is amplified when you move a physical machine to a virtual machine (where you are, in effect, swapping out every hardware component).

DannySmurf
It's perfectly possible, even if windows is indeed a dog about the whole thing.http://www.virtualbox.org/wiki/Migrate_Windows
RJFalconer
A: 

Well, but if the virtualization is really doing it's job, I would imagine it would act as if all that hardware is there, but it just so happens that when it tries to access it, it is getting into the VM sandbox instead.... then again, I could be totally misunderstanding how virtualization works.

Mike Stone
Virtualization software doesn't necessarily virtualize access to your exact hardware; instead, it presents guests with whatever virtual hardware its developers have decided to provide. For example, VMware presents VMs with an AMD PCnet32 network adapter and BusLogic SCSI adapter (by default), regardless of the network and SCSI hardware your host has.
Josh Kelley
+1  A: 

You can download the free version of vmware converter which can do a physical to virtual machine conversion. I believe VirtualBox can run vmware VMs.

Ferruccio
+1  A: 

I'm in the process of doing this myself.

As Ferruccio says, vmware converter is one option. This will not work if your windows boot.ini is also loading another operating system, even if vista is the default.

There's a VirtualBox guide just for this but it was written for XP. Still but may be worth trying.

This "create new partition, xcopy stuff in" approach" guide (specifically post 5) is what I was planning on trying next.

Good luck, keep us updated!

RJFalconer
A: 

Another option is to access the raw partition using vbox.

http://forums.virtualbox.org/viewtopic.php?f=7&t=20793&p=89806&hilit=raw+partition+vista#p89806

edit: Sorry missed DannySmurf's reply.