Monday, October 6. 2008
NAME
VBoxClone - clones virtual box vms with autogenerated settings
SYNOPSIS
VBoxClone <source> <destination>
DESCRIPTION
this bash script duplicates virtual box vms to new vms with all settings
beside of the mac addresses of the network adapter. this behavior should
emulate VMWare's "clone vm".
BUGS
plenty.
TODO
- we need to sysprep windows vms (new SID)
- more sanity checks
EXAMPLE
[root@vboxsrv:/space/vbox] # ./VBoxClone lala
usage: ./VBoxClone <source> <destination>
[root@vboxsrv:/space/vbox] # ./VBoxClone lala test
ERROR: vm 'lala' does not exist?
[root@vboxsrv:/space/vbox] # ./VBoxClone winXP winXP03
VDI_FOLDER: '/space/vbox'
VM_FOLDER: '/space/vbox'
Cloning Primary master: '/space/vbox/winXP/winXP.vdi'
VirtualBox Command Line Management Interface Version 2.0.2
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Creating VM 'winXP03'...
Adding hda '/space/vbox/winXP03/winXP03-0.vdi' ('7cd48e3a-bf0a-4611-bb61-d375dd73e9f7')
[root@vboxsrv:/space/vbox] # diff -NrU0 winXP/winXP.xml winXP03/winXP03.xml
--- winXP/winXP.xml 2008-10-01 14:08:48.000000000 +0200
+++ winXP03/winXP03.xml 2008-10-06 08:29:07.000000000 +0200
@@ -4 +4 @@
- <Machine uuid="{152b8d66-831d-4488-8ce1-d9d547234f0a}" name="winXP" OSType="winxp" lastStateChange="2008-09-30T13:50:17Z">
+ <Machine uuid="{cf5293f4-94b8-4615-9250-7957df510af9}" name="winXP03" OSType="winxp" lastStateChange="2008-10-06T08:29:05Z">
@@ -41 +41 @@
- <Adapter slot="0" enabled="true" MACAddress="080027CE488E" cable="true" speed="0" type="82543GC">
+ <Adapter slot="0" enabled="true" MACAddress="0800274ACD37" cable="true" speed="0" type="82543GC">
@@ -44,3 +44,3 @@
- <Adapter slot="1" enabled="false" MACAddress="08002747B375" cable="true" speed="0" type="Am79C973"/>
- <Adapter slot="2" enabled="false" MACAddress="08002763F4C7" cable="true" speed="0" type="Am79C973"/>
- <Adapter slot="3" enabled="false" MACAddress="0800273AAE3C" cable="true" speed="0" type="Am79C973"/>
+ <Adapter slot="1" enabled="false" MACAddress="080027D32A13" cable="true" speed="0" type="Am79C973"/>
+ <Adapter slot="2" enabled="false" MACAddress="080027C8D8A1" cable="true" speed="0" type="Am79C973"/>
+ <Adapter slot="3" enabled="false" MACAddress="08002704256B" cable="true" speed="0" type="Am79C973"/>
@@ -63 +63 @@
- <HardDiskAttachment hardDisk="{a84807e5-b452-4713-a9e9-b6ed24570bfe}" bus="IDE" channel="0" device="0"/>
+ <HardDiskAttachment hardDisk="{7cd48e3a-bf0a-4611-bb61-d375dd73e9f7}" bus="IDE" channel="0" device="0"/>
download version 0.1: VBoxClone_v0.1
|