Monday, February 13, 2012

Copy/Clone/Migrate VM VirtualBox

Pergh this is tough.. seriuosly.. alrite here is the situation:-

Situation
You have install Virtual Machine VirtualBox at your machine (laptop/desktop). You even have create multiple snapshot of the VM. Now you want to Copy/Clone/Migrate the VM into another machine. The word Copy, Clone, Migrate actually bring different meaning in each. To avoid confusion I use the term copying to refer to copying a VM to different host machine and the term cloning to refer to creating a copy on the same host. Well migrate, will be same as copying...

Solution - To Copy/Migrate
1. Make sure NO snapshop available at the VM. If you do, you can delete the previous snapshot. Dont worry, the latest setting will still there as long as you dont delete the "current state" snapshot. Beware of that!!
2. Copy the .vdi file from (C:\Users\Administrator\.VirtualBox\HardDisks) to anywhere you like (even the external HDD).Make sure the VM were closed when you start copy!!
3. The new machine, install the VirtualBox.
4. To start create the new VM to the new machine:- From the VirtualBox window select File → Virtual Disk Manager (Ctrl+D) menu command. Press the Add button and select the copied disk image file (the one you copied just now). From the VirtualBox window select Machine→New… (Ctrl+N) menu command. Work your way through the Create New Virtual Machine wizard till you get to the Virtual Hard Disk page then press the Existing… (not the New…) button and select the disk image VDI file that you previously cloned or copied.
5. That’s it, you should now be able to start and run your new VM

Solution - To Clone
1. Open a Command Prompt window on the host machine.
2. Change to the VirtualBox VDI directory (normally C:\Documents and Settings\\.VirtualBox\VDI).
3. Now run the VBoxManage command with the clonevdi command option. The following example transcript shows the creation of a copy of Ubuntu 8.04.vdi named Ubuntu 8.04 clone.vdi and registers the new disk:

C:\Documents and Settings\srackham\.VirtualBox\VDI> "C:\Program
Files\Sun\xVM VirtualBox\VBoxManage.exe" clonevdi "Ubuntu 8.04.vdi"
"Ubuntu 8.04 clone.vdi"
[press enter here]VirtualBox Command Line Management Interface
Version 2.0.4 (C) 2005-2008 Sun Microsystems, Inc. All rights
reserved.

0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

C:\Documents and Settings\srackham\.VirtualBox\VDI>