VBoxManage internalcommands sethduuid path_to_vhd
VBoxManage clonedhd source_vhd_file dest_vhd_file
VBoxManage internalcommands sethduuid path_to_vhd
有以上两种方法,第一种是先拷贝,然后修改,第二种使用tool拷贝,拷贝过程中,自动修改uuid,然后在virtualbox 中new来增加
这样就可以设置一台主机然后批量复制
VirtualBox can be a handy tool when playing with configurations and testing things out. You can create a base image, make several copies and start playing around and messing things up. Since you made copies you can always go back to your original and start from ground zero.
Creating a copy of an existing Virtual machine in VirtualBox is just about as simple as copying a file. However we will need to assign a new UUID to the copied virtual machine. This will require us to issue a few commands in the terminal.
Copying a Virtual Machine File:
Navigate to your home directory
Press “CTRL + H”
(To Show Hidden Files)
Open folder .VirtualBox
Open folder HardDisks
Right click on the virtual machine you would like to copy and select copy
Right click in the folder and select paste
Right Click on the copied file and Rename it to what every you feel appropriate.
Changing the UUID of the copied Virtual machine file:
VirtualBox can not have more then one virtual machine with the same UUID. If you just make a copy and not assign a new UUID you will get an error message similar to below.
disk '/.VirtualBox/HardDisks/ubuntu.vdi' with UUID {77d55d86-800c-4667-9e60-678f81a50913} already exists
Lets assign a new UUID so we can start using are copied virtual machine.
Go to Applications > Accessories > Terminal
Type the following command
cd .VirtualBox/HardDisks
Then Issue the following command changing the end part (ubuntu 10 test.vdi ) to match the new virtual machine name. Note: If you have a space in the name you will need to add “” around the name of your new virtual machine.
vboxmanage internalcommands setvdiuuid "ubuntu 10 test.vdi"
Importing the copied virtual machine into VirtualBox:
launch VirtualBox
Select New
Select Next
Create a Name and select the operating system that best matches your guest OS.
Set the amount of Ram you would like the machine to use
Select use existing hard disk - Click on Folder Icon
Select Add
Browse to your new copy you created
Click on Select
Click Next
Click Finish
You should be should be all set. You can now make setting changes before launching your newly copied virtual machine. Once you have it configured the way you want it, fire it up and test it out.
Hope you found this helpful!