Can I just copy and rename a VirtualBox vm?

14

3

I want to create a new vm starting from an existing virtualbox vm.

Can I just copy and paste and rename the existing one?

user3183

Posted 2009-08-20T00:12:05.897

Reputation: 3 059

could someone edit this question to fix the 'virutalbox' mistyping? it doesn't help when searching for virtualbox. – igorsantos07 – 2009-08-20T01:17:04.237

Answers

18

No, Virtualbox will not allow you to register two VDI files with the same UUID.

Cannot register the hard disk '/home/lee/fedora-10-x86-1.vdi' with UUID {06f39a14-97e6-478c-93b9-0ade6dba48d8} because a hard disk '/home/lee/fedora-10-x86-1.vdi' with UUID {06f39a14-97e6-478c-93b9-0ade6dba48d8} already exists in the media registry ('/home/lee/.VirtualBox/VirtualBox.xml').

You will need to clone the VDI file, this copies the original VDI file and assigns a new UUID.

From the gui:

Shutdown the VM and hit 'Ctrl+Shift+C' or click the 'clone' button. (It looks like a sheep.)

Windows:

VBoxManage.exe clonevdi "<Full_path_to_org_vdi>" "<Full_path_to_new_vdi>"

Linux:

VBoxManage clonevdi <Full_path_to_org_vdi> <Full_path_to_new_vdi>

I found a tutorial here describing the process.

lyarwood

Posted 2009-08-20T00:12:05.897

Reputation: 1 804

Indeed. I recently got caught by that :( – theotherreceive – 2009-08-21T03:34:20.823

1Alternatively you can copy the vdi hard disk with windows/linux and then change UUID with command: vboxmanage internalcommands sethduuid <FULL_PATH_TO_VDI>. – SuB – 2013-09-27T17:55:17.070

2

VirtualBox 4.1 added clone functionality via GUI yesterday.

jocull

Posted 2009-08-20T00:12:05.897

Reputation: 162

2

I have created a simple script to clone a VirtualBox machine. It can create a clone from any snapshot. See my blog post where you can download the script.

Lukas Cenovsky

Posted 2009-08-20T00:12:05.897

Reputation: 1 269