Cloning a VirtualBox host

VirtualBox is a very nice GPL alternative to vmWare if You are looking for a general-purpose x86 hardware virtualizer.

The VirtualBox Installation is very easy: in many case You have only to download the righ file (.rpm, .deb, etc…) and install it as a normal software package.

If You need to clone quickly a virtual host, stop this, then cd where your system are storing your virtual box hard disk and issue the command VBoxManage specifying the action (clonehd), the input file name (the virtual hard disk file), and the output file. E.G.

cd ~/.VirtualBox/HardDisks
VBoxManage clonehd vbox-lenny1.vdi vbox-lenny2.vdi

This command duplicates a registered virtual hard disk image to a new image file with
a new unique identifier (UUID), that will be shown at the end of the copy output:

VirtualBox Command Line Management Interface Version 2.2.2
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

0%…10%…20%…30%…40%…50%…60%…70%…80%…90%…100%
Clone hard disk created in format ‘VDI’. UUID: 42bf1adb-e7f7-4993-b8e8-739aca77e092

Then, from Your VirtualBox main console, start the new host wizard, followin the defaults just to the point to specify Your hard disk. Here check for “Use existing hard disk” and browse to look for the file You have just created with the VBoxManage clonehd command.
Remember You have to click on the “Add” icon to see and import your new hard disk file.

vbox-hd-clone

Then, just end the wizard and start your new virtual host.

Tags: ,

Leave a Reply