v2p for a computer idiot

This is for discussing general topics about how to use VirtualBox.

v2p for a computer idiot

Postby cat2005 » 21. May 2011, 20:12

I have a virtualbox Linux Ubuntu 10.10 install that I would like to convert to a physical "unit" (define "unit" however you wish). My host OS is Linux Ubuntu 9.04.

I would like to take that recently created physical "unit" and install it on my host computer. In a nutshell, what I want to do is convert that virtual 10.10 into a "real" 10.10, then replace my current "real" 9.04 with that "real" 10.10.

Every bit of research I found on google makes this look....uh.....um......confusing.

For a computer idiot (me), should I just skip the v2p exercise and go for a straight, fresh, physical install? Or is this v2p process easier than I surmise?

Thanks.
cat2005
 
Posts: 52
Joined: 11. Aug 2009, 03:45
Location: Kansas City, MO
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Linux & Windows

Re: v2p for a computer idiot

Postby Technologov » 21. May 2011, 20:54

If it was easy, it would already be integrated into VirtualBox.

The reality is that procedure is both difficult and risky. (can hose your own host OS)
Technologov
Volunteer
 
Posts: 3313
Joined: 10. May 2007, 16:59
Location: Israel

Re: v2p for a computer idiot

Postby cat2005 » 21. May 2011, 23:08

Mystery solved. Thanks!
cat2005
 
Posts: 52
Joined: 11. Aug 2009, 03:45
Location: Kansas City, MO
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Linux & Windows

Re: v2p for a computer idiot

Postby mpack » 23. May 2011, 12:42

I'm not so convinced it's terribly risky, not if you use decent tools and take a few precautions.

I would do a P2V migration of your old 9.04 host first; this will give you practice with Linux migrations plus the disk image you use to virtualize your existing host can then serve as a backup if all else fails. This ensures that you can't lose any data.

You can then try going in the other direction - a V2P, using an image of your 10.10 VMs disk. Worst that can happen is that this migration fails, leaving a host which won't boot etc. So you can then restore your old 9.04 host OS from the same image used to make the earlier P2V, or you can just give up and do a fresh install of 10.10. As mentioned above, you can't lose any data.
mpack
Site Moderator
 
Posts: 31459
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: v2p for a computer idiot

Postby NeBlackCat » 23. May 2011, 17:05

You could look at VBoot. It's a product (based on Grub2 and VirtualBox code) that lets you boot directly into a virtual disk image (VHD, VDI, VMDK, and also DD, ISO, etc).

So if you currently have a (say) Ubuntu1010.VDI which you use in your virtual machine, you simply tell grub.cfg about it, and boot your computer right into it. Of course the physical and virtual environments each present different hardware to that Ubuntu, but Linux is pretty good at handling that.

You could do something like this:

1) get a USB flash stick, install vboot on it, copy your Ubuntu 10.10 VDI (or whatever) onto it, edit vboot's grub.cfg so that it knows about the VDI, and reboot into it.

2) You are now physically booted into your Ubuntu 10.10 VDI, and running entirely from USB. Uninstall the VirtualBox client additions (if you had them installed) and install actual VirtualBox instead (all of that is happening "inside" the VDI).

3) From there, image your physical 9.04 installation to another single VDI at some other location, which you can do in a single command:
dd if=/dev/sda bs=1M | vboxmanage convertfromraw stdin Ubuntu904.VDI {size in bytes}

4) Edit your grub.cfg (USB stick) again to tell it about the new Ubuntu 9.04 VDI. You can now physically boot it to that, to test it!

5) Assuming all's well, you can reformat your hard drive (where 9.04 was) and simply copy the two VDIs onto it. Put vboot onto its boot partition too, and you can now physically boot into either Ubuntu at will. When booted into the 10.10 one, you can create a new VM that uses the 9.04 VDI, and run the latter virtually.

Sounds harder than it is! I really like vboot so far. I don't use lots of physical disks/partitions any more, just a small (v)boot partition, and big data partition with lots of virtual disks and ISOs that I boot into as needed. One of them is a Linux/VirtualBox "hypervisor" which lets me run the others virtually.

Of course you could always expand your 10.10 VDI back onto the physical hard drive, if you prefer to run that way.

EDIT: oh and BTW I use VHDs not VDIs (better under Windows).
NeBlackCat
 
Posts: 154
Joined: 3. Aug 2008, 13:37


Return to Using VirtualBox

Who is online

Users browsing this forum: No registered users and 9 guests