I created a script sometime ago that works quite well. I have one vdi which 
I use as a base vm, it's the "Guest.vdi" below.

Also, I keep my vms under a /VirtualBox directory

#!/bin/sh
# Usage: clonevm.sh <name> <memory> <hostdev>
if [ "$1" = "" ] || [ "$2" = "" ] || [ "$3" = "" ] || [ "$4" = "" ]; then
        echo "Usage: clonevm.sh <name> <memory> <hostdev> <vrdp port>\n"
        exit
fi

echo "mkdir /VirtualBox/Machines/$1; mkdir /VirtualBox/Machines/$1/Logs; 
mkdir /VirtualBox/Snapshots/$1"
mkdir /VirtualBox/Machines/$1; mkdir /VirtualBox/Machines/$1/Logs
echo "VBoxManage createvm -name $1 -register -settingsfile 
/VirtualBox/Machines/$1/$1.xml "
VBoxManage createvm -name $1 -register -settingsfile 
/VirtualBox/Machines/$1/$1.xml
echo "VBoxManage clonevdi /VirtualBox/VDI/Guest.vdi /VirtualBox/VDI/$1.vdi"
VBoxManage clonevdi /VirtualBox/VDI/Guest.vdi /VirtualBox/VDI/$1.vdi
echo "VBoxManage modifyvm $1 -hda /VirtualBox/VDI/$1.vdi "
VBoxManage modifyvm $1 -hda /VirtualBox/VDI/$1.vdi
echo "VBoxManage modifyvm $1 -snapshotfolder /VirtualBox/Snapshots/$1"
VBoxManage modifyvm $1 -snapshotfolder /VirtualBox/Snapshots/$1
echo "VBoxManage modifyvm $1 -memory $2M -ostype ubuntu -macaddress1 
auto -nic1 hostif -hostifdev1 $3 -clipboard disabled"
VBoxManage modifyvm $1 -memory $2M -ostype ubuntu -macaddress1 auto -nic1 
hostif -hostifdev1 $3 -clipboard disabled -acpi on -ioapic on -pae 
on -hwvirtex on -vrdp on -vrdpport $4

----- Original Message ----- 
From: "dick hoogendijk" <[email protected]>
To: <[email protected]>
Sent: Wednesday, January 21, 2009 11:39 AM
Subject: Re: [vbox-users] Clone Virtual Machine


> On Tue, 20 Jan 2009 00:58:12 +0100
> Jens Franik <[email protected]> wrote:
>
>> > It's not a problem to manually change UUID of vdi image in the
>> > favourite HEX editor. UUID begins at offset 188h and ends at 1a7h
>> > if I not mistaken. I successfully attached and used VDI images with
>> > UUID changed by hands
>>
>> I  love  to  edit  the Bits (since i did on C64 of Commodore which has
>> been my first Computer).
>>
>> Ich will check this too, thank you for the detailed information!
>
> I think it's much much easier to just copy the vdi and then run the
> following command:
>
> VBoxManage internalcommands setvdiuuid newfile.vdi
> example:
>
> $ VBoxManage internalcommands setvdiuuid /store/vdi/wxptst.vdi
> VirtualBox Command Line Management Interface Version 2.1.0
> (C) 2005-2008 Sun Microsystems, Inc.
> All rights reserved.
>
> UUID changed to: f245bbe5-9609-49f4-b72f-9d854949d3f3
>
> Works like a charm and is very safe ;-)
>
> -- 
> Dick Hoogendijk -- PGP/GnuPG key: 01D2433D
> + http://nagual.nl/ | SunOS sxce snv105 ++
> + All that's really worth doing is what we do for others (Lewis Carrol)
>
> _______________________________________________
> vbox-users mailing list
> [email protected]
> http://vbox.innotek.de/mailman/listinfo/vbox-users
> 


_______________________________________________
vbox-users mailing list
[email protected]
http://vbox.innotek.de/mailman/listinfo/vbox-users

Reply via email to