virtualbox copy machine and disks

This are some procedures to follow if you want to copy one machine in Virtualbox into an other machine.

Method 1:

Export as a Open Virtual Machine Definition. (export appliance)
Then Import it again.
The very annoying thing is that by default the image files get copied into the personal VirtualBox directory ... which may not be nice to manage.
The files have to be released, copied, reloaded and linked again before the VM can see them.


Method 2: Physical copy of the hard disks

This method does not copy the machine definition ... which is no hard work to do anyway.
Supposing the hard disks that you want to copy are in one directory, just copy the directory and for the correct way of working, give the new disk image files a name corresponding to its use.
My personal standard is to prefix the directory containing the files with the name of the machine. (ex. UBUNTU_SOA). Each file in turn is also prefixed by this name.
Then the files need to get a UUID unique to all the files in the world (?).
This is required because VirtualBox uses this UUID in the registry of Virtual Media.
I found this info on this link.
The basic command when the file is already copied is:
VBoxManage internalcommands setvdiuuid "The name of the file to rename
If the files are not copied from their original location:
VBoxManage clonehd “the old name of the file” “the new name of the file

After this the disks can be defined as new virtual media names ... and since you followed the convetions ... the name and purpose of the files will be clear.


The command VBoxManage can be found in the installation directory of VirtualBox




No comments: