CLONING A VIRTUAL MACHINE IN ORACLE VM...

55
CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.." HOST COMPUTER HIGH-LEVEL EXECUTIVE SUMMARY: In "Oracle VM VirtualBox", you cannot copy a virtual machine by using "My Computer", "Computer", "Windows Explorer", or a command prompt window. In "Oracle VM VirtualBox", you cannot copy a virtual hard drive directly by using "My Computer", "Computer", "Windows Explorer", or a command prompt window. To clone a virtual hard drive or a virtual machine, you have to use either the "Clone" function in "Oracle VM VirtualBox Manager" or a command line utility called "vboxmanage". TECHNICAL DETAILS If you use "My Computer", "Computer", "Windows Explorer", or a command prompt window to copy a virtual machine or a virtual hard drive, the "Oracle VM VirtualBox" program will usually refuse to let you use the newly-created virtual machine or newly-created virtual hard drive.

Transcript of CLONING A VIRTUAL MACHINE IN ORACLE VM...

Page 1: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX"

IN A "WINDOWS.." HOST COMPUTER HIGH-LEVEL EXECUTIVE SUMMARY: In "Oracle VM VirtualBox", you cannot copy a virtual machine by using "My Computer", "Computer", "Windows Explorer", or a command prompt window. In "Oracle VM VirtualBox", you cannot copy a virtual hard drive directly by using "My Computer", "Computer", "Windows Explorer", or a command prompt window. To clone a virtual hard drive or a virtual machine, you have to use either the "Clone" function in "Oracle VM VirtualBox Manager" or a command line utility called "vboxmanage".

TECHNICAL DETAILS If you use "My Computer", "Computer", "Windows Explorer", or a command prompt window to copy a virtual machine or a virtual hard drive, the "Oracle VM VirtualBox" program will usually refuse to let you use the newly-created virtual machine or newly-created virtual hard drive.

Page 2: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

TWO METHODS TO CLONE A VIRTUAL MACHINE There are two methods for cloning a virtual machine. Let's call them "Method 1" and "Method 2". "Method 1" is a lot easier than "Method 2". We will show you the steps for these two methods soon. When you follow either "Method 1" or "Method 2" to clone a virtual machine, the new virtual machine that you create will have a new, unique "UUID.BIOS" (= "machine entry UUID" = "computer UUID" = "motherboard UUID"). "Method 1" creates a cloned virtual machine with a virtual hard drive that has the same "hard drive UUID" as the virtual hard drive of the original virtual machine. "Method 2" creates a cloned virtual machine with a virtual hard drive that has a "hard drive UUID" that is different from the virtual hard drive of the original virtual machine. If you need to look at them, in "Oracle VM VirtualBox", all "UUID.BIOS" (= "machine entry UUID" = "computer UUID" = "motherboard UUID") (for all of the virtual machines) are listed in the VirtualBox.xml file in the .VirtualBox folder in your Windows profile folder.

Page 3: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

METHOD 1: USING THE "CLONE" FUNCTION IN "ORACLE VM VIRTUALBOX MANAGER": To start the "Clone" function of the "Oracle VM VirtualBox Manager", you can either use the right mouse button to click on a virtual machine or click on "Machine" from the top menu bar: When you use the right mouse button to click on any virtual machine, the pop-up context menu has a "Clone.." selection it it:

*

Page 4: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."
Page 5: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

When you click on a virtual machine to highlight it and then click on "Machine" in the top menu bar, the pull-down menu has a "Clone.." selection in it:

Page 6: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."
Page 7: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

"Method 1" works on version 4.1 of "Oracle VM VirtualBox". "Method 1" does not work for any version of "Oracle VM VirtualBox" prior to version 4.1.

When you follow either "Method 1" to clone a virtual machine, the new virtual machine that you create will have a new, unique "UUID.BIOS" (= "machine entry UUID" = "computer UUID"). However the new virtual hard drive of the newly-created virtual machine will have the same "hard drive UUID" as the original virtual hard drive of the original, source virtual hard drive. Since both the original and the cloned virtual hard drives have the same "hard drive UUID", you will not be able to use these virtual drives in the same virtual machine at a future date. When the original virtual machine and the cloned virtual machine have virtual hard drives that have the same "hard drive UUID", this may cause problems in situations when a duplicate "hard drive UUID" can cause trouble. See http://k68.system74.net/index.php/article/printer/clone-hard-disk-in-virtualbox In "Oracle VM VirtualBox", all "machine entry UUID"s (="BIOS UUID" = "System UUID") (for all of the virtual machines) are listed in the VirtualBox.xml file in the .VirtualBox folder in your Windows profile folder. For a good, concise description of "Method 1", see http://linux.putalin.com/2011/08/how-to-clone-a-virtual-machine-on-virtualbox/

Page 8: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

"FULL CLONE" VERSUS "LINKED CLONE" When using "Method 1", you can create either a "full clone" or a "linked clone". A "full clone" is totally independent of the original virtual machine that you use to create the cloned virtual machine. A "linked clone" will depend on the original virtual machine that you used to create the cloned virtual machine so that changes to configuration settings in the original virtual machine "cascade" to the cloned virtual machine. See http://www.theregister.co.uk/2011/07/19/oracle_virtualbox_4_1/

METHOD 2: USING THE VBOXMANAGE COMMAND FROM A WINDOWS "COMMAND PROMPT" TO CLONE A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX": "Method 2" works in versions 3.x, 4.0, and 4.1 of "Oracle VM VirtualBox". When you follow this procedure to clone a virtual machine, the new virtual machine that you create will have a new, unique "UUID.BIOS" (= "machine entry UUID" = "computer UUID" and the virtual hard drive of the new virtual machine will have a new, unique "hard drive UUID". Therefore, "Method 2" creates a cleaner, more unique virtual machine than the easier "Method 1": When you use "Method 2" to clone a virtual machine, you can use the original machine's hard drive file and the cloned machine's new hard drive file in the same virtual machine at a future point in time. In "Oracle VM VirtualBox", all "machine entry UUID"s (for all of the virtual machines) are listed in the VirtualBox.xml file in the .VirtualBox folder in your Windows profile folder.

Page 9: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

SOME GREAT ADVICE FROM OTHERS ABOUT USING "METHOD 2": See http://srackham.wordpress.com/cloning-and-copying-virtualbox-virtual-machines/ and http://www.sysprobs.com/clone-virtual-machine-sun-virtualbox-simple-steps and http://geekozoid.blogspot.com/2009/05/how-to-duplicate-clone-virtual-machine.html and http://www.modhul.com/2009/06/17/how-to-clone-or-copy-a-virtualbox-virtual-disk/ and http://lukehayler.com/2011/01/cloning-virtualbox-virtual-disk-images-vdi-files/ and http://www.keithohudson.com/?p=385 and http://www.my-guides.net/en/guides/general-software/155-how-to-copy-and-transfer-or-backup-a-virtualbox-virtual-machine-vdi and http://www.oracledistilled.com/virtualbox/cloning-a-virtualbox-vm/ and http://joshuahoover.com/2010/04/01/cloning-virtualbox-images/ and http://umairj.com/191/cloning-a-virtual-machine-in-virtualbox/

METHOD 2--STEP-BY-STEP:

It is usually not a good idea to use "Windows Explorer" or "My Computer" to copy an existing .vdi "virtual hard drive", since the resulting hard drive file will have the same "hard drive UUID" as the original source .vdi "virtual hard drive".

Page 10: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

Instead, you can copy the existing .vdi "virtual hard drive" using the "vboxmanage clonehd" command at the "command prompt": Syntax: vboxmanage clonehd <full path name of source .vdi virtual hard disk file> <at least one space> <full path name of new target .vdi virtual hard disk file> For example: Type cmd into the search or run box of the "Windows" start menu. If you are running "Windows 7" in the host computer, use the right mouse button to click on "cmd" in the left-most side of the "Start menu"; then click on "Run as administrator" in the pop-up context menu. If you are running "Windows XP" or "Windows Vista" in the host computer, press once on the Enter key of the keyboard. A command prompt Window will be displayed:

Page 11: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

cd "Program Files" <Enter>

cd Oracle

Page 12: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

cd virtualbox

You should now be at C:\Program Files\Oracle\VirtualBox\ Now run the "vboxmanage clonehd" command.

Page 13: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

* For example: vboxmanage clonehd "l:\Users\testuser\.VirtualBox\HardDisks\Windows XP Professional.vdi" "l:\Users\testuser\.VirtualBox\HardDisks\Windows XP Professional-copy02.vdi" vboxmanage clonehd "l:\Users\testuser\.VirtualBox\HardDisks\Windows XP Professional.vdi" "L:\Users\testuser\.VirtualBox\HardDisks\Windows XP Professional-copy01.vdi" 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% Clone hard disk created in format 'VDI'. UUID: 210f5b3f-f04f-4d03-a84d-079a3e2d4 441 The newly created .vdi "virtual hard drive" will have a new, unique UUID.

Page 14: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

Microsoft Windows [Version 6.1.7601]

Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\testuser>dir

Volume in drive C is HP-ST3750528AS

Volume Serial Number is 669A-6BF4

Directory of C:\Users\testuser

03/26/2011 06:05 PM <DIR> .

03/26/2011 06:05 PM <DIR> ..

04/01/2011 10:46 AM <DIR> .VirtualBox

01/28/2011 07:47 PM <DIR> AppData

03/03/2011 09:41 PM <DIR> Contacts

04/01/2011 01:40 AM <DIR> Desktop

03/25/2011 09:13 AM <DIR> Documents

04/01/2011 12:30 AM <DIR> Downloads

03/03/2011 09:41 PM <DIR> Favorites

02/15/2011 08:54 AM 72,080 g2mdlhlpx.exe

03/03/2011 09:41 PM <DIR> Links

03/03/2011 09:41 PM <DIR> Music

03/29/2011 10:49 PM <DIR> Pictures

03/03/2011 09:41 PM <DIR> Saved Games

03/03/2011 09:41 PM <DIR> Searches

03/03/2011 09:41 PM <DIR> Videos

04/01/2011 12:10 AM <DIR> Virtual Machines

1 File(s) 72,080 bytes

16 Dir(s) 197,250,412,544 bytes free

C:\Users\testuser>l:

Page 15: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

L:\>cd users

L:\Users>dir

Volume in drive L is L_WCAWZ0043341

Volume Serial Number is 20BE-DE9B

Directory of L:\Users

03/29/2011 12:39 AM <DIR> .

03/29/2011 12:39 AM <DIR> ..

03/29/2011 04:41 AM <DIR> testuser

0 File(s) 0 bytes

3 Dir(s) 1,349,184,933,888 bytes free

L:\Users>dir

Volume in drive L is L_WCAWZ0043341

Volume Serial Number is 20BE-DE9B

Directory of L:\Users

03/29/2011 12:39 AM <DIR> .

03/29/2011 12:39 AM <DIR> ..

03/29/2011 04:41 AM <DIR> testuser

0 File(s) 0 bytes

3 Dir(s) 1,349,184,933,888 bytes free

L:\Users>cd testuser

L:\Users\testuser>dir

Volume in drive L is L_WCAWZ0043341

Volume Serial Number is 20BE-DE9B

Directory of L:\Users\testuser

03/29/2011 04:41 AM <DIR> .

03/29/2011 04:41 AM <DIR> ..

03/29/2011 02:35 AM <DIR> .VirtualBox

03/29/2011 02:36 AM <DIR> Documents

03/29/2011 02:43 PM <DIR> VirtualBox VMs

0 File(s) 0 bytes

5 Dir(s) 1,349,184,933,888 bytes free

L:\Users\testuser>cd .virtualbox

L:\Users\testuser\.VirtualBox>dir

Volume in drive L is L_WCAWZ0043341

Volume Serial Number is 20BE-DE9B

Directory of L:\Users\testuser\.VirtualBox

Page 16: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

03/29/2011 02:35 AM <DIR> .

03/29/2011 02:35 AM <DIR> ..

03/29/2011 02:24 PM <DIR> HardDisks

03/29/2011 02:35 AM <DIR> Machines

09/06/2010 12:48 AM 8,308 VirtualBox.xml

09/06/2010 12:48 AM 8,308 VirtualBox.xml-prev

2 File(s) 16,616 bytes

4 Dir(s) 1,349,184,933,888 bytes free

L:\Users\testuser\.VirtualBox>cd HardDisks

L:\Users\testuser\.VirtualBox\HardDisks>dir

Volume in drive L is L_WCAWZ0043341

Volume Serial Number is 20BE-DE9B

Directory of L:\Users\testuser\.VirtualBox\HardDisks

03/29/2011 02:24 PM <DIR> .

03/29/2011 02:24 PM <DIR> ..

03/27/2011 09:57 PM 15,663,362,560 Apple Macintosh OSX.vdi

09/06/2010 08:06 AM 5,754,618,368 BackTrack Linux.vdi

03/29/2011 02:35 AM <DIR> EmpireEFI

08/26/2010 12:36 AM 67,479,577,088 m8307cC.vdi

03/26/2011 11:48 PM 2,790,344,192 Ubuntu 10.04 32-bit.vdi

09/06/2010 08:08 AM 3,388,117,504 Ubuntu 10.04 64-bit.vdi

03/26/2011 07:15 PM 2,063,073,280 Windows 2000 Pro.vmdk

09/06/2010 08:10 AM 26,673,152 Windows 3.11-vm1.vmdk

03/30/2011 02:36 AM 13,469,007,872 Windows 7 Enterprise Trial 64-bit.vdi

03/29/2011 03:53 PM 12,184,535,552 Windows 7 Home Premium 32-bit.vdi

03/26/2011 06:24 PM 12,939,632,128 Windows 7 Home Premium 64-bit.vdi

09/06/2010 08:12 AM 217,251,840 Windows 98 Second Edition.vmdk

03/27/2011 01:19 AM 575,537,152 Windows Millenium Edition.vmdk

03/27/2011 01:23 AM 124,977,152 Windows NT 4.vmdk

03/27/2011 02:44 AM 34,668,184,064 Windows Vista Business--vm1.vdi

03/20/2011 05:46 PM 4,930,609,664 Windows XP Home 32-bit.vdi

08/30/2010 04:21 PM 4,710,396,928 Windows XP Pro testVM22.vdi

03/31/2011 12:51 AM 15,775,226,368 Windows XP Professional--vm2.vdi

09/06/2010 08:18 AM 13,286,955,520 Windows XP Professional.vdi

18 File(s) 210,048,080,384 bytes

3 Dir(s) 1,349,184,933,888 bytes free

L:\Users\testuser\.VirtualBox\HardDisks>dir

Volume in drive L is L_WCAWZ0043341

Volume Serial Number is 20BE-DE9B

Directory of L:\Users\testuser\.VirtualBox\HardDisks

03/29/2011 02:24 PM <DIR> .

03/29/2011 02:24 PM <DIR> ..

03/27/2011 09:57 PM 15,663,362,560 Apple Macintosh OSX.vdi

Page 17: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

09/06/2010 08:06 AM 5,754,618,368 BackTrack Linux.vdi

03/29/2011 02:35 AM <DIR> EmpireEFI

08/26/2010 12:36 AM 67,479,577,088 m8307cC.vdi

03/26/2011 11:48 PM 2,790,344,192 Ubuntu 10.04 32-bit.vdi

09/06/2010 08:08 AM 3,388,117,504 Ubuntu 10.04 64-bit.vdi

03/26/2011 07:15 PM 2,063,073,280 Windows 2000 Pro.vmdk

09/06/2010 08:10 AM 26,673,152 Windows 3.11-vm1.vmdk

03/30/2011 02:36 AM 13,469,007,872 Windows 7 Enterprise Trial 64-bit.vdi

03/29/2011 03:53 PM 12,184,535,552 Windows 7 Home Premium 32-bit.vdi

03/26/2011 06:24 PM 12,939,632,128 Windows 7 Home Premium 64-bit.vdi

09/06/2010 08:12 AM 217,251,840 Windows 98 Second Edition.vmdk

03/27/2011 01:19 AM 575,537,152 Windows Millenium Edition.vmdk

03/27/2011 01:23 AM 124,977,152 Windows NT 4.vmdk

03/27/2011 02:44 AM 34,668,184,064 Windows Vista Business--vm1.vdi

03/20/2011 05:46 PM 4,930,609,664 Windows XP Home 32-bit.vdi

08/30/2010 04:21 PM 4,710,396,928 Windows XP Pro testVM22.vdi

03/31/2011 12:51 AM 15,775,226,368 Windows XP Professional--vm2.vdi

09/06/2010 08:18 AM 13,286,955,520 Windows XP Professional.vdi

18 File(s) 210,048,080,384 bytes

3 Dir(s) 1,349,184,933,888 bytes free

L:\Users\testuser\.VirtualBox\HardDisks>

Page 18: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

VBoxManage modifyhd <uuid>|<filename>

[--type normal|writethrough|immutable|shareable|

readonly|multiattach]

[--autoreset on|off]

[--compact]

[--resize <megabytes>|--resizebyte <bytes>]

VBoxManage clonehd <uuid>|<filename> <outputfile>

[--format VDI|VMDK|VHD|RAW|<other>]

[--variant Standard,Fixed,Split2G,Stream,ESX]

[--existing]

VBoxManage convertfromraw <filename> <outputfile>

[--format VDI|VMDK|VHD]

[--variant Standard,Fixed,Split2G,Stream,ESX]

VBoxManage getextradata global|<uuid>|<name>

<key>|enumerate

VBoxManage setextradata global|<uuid>|<name>

<key>

[<value>] (no value deletes key)

VBoxManage setproperty machinefolder default|<folder> |

vrdeauthlibrary default|<library> |

websrvauthlibrary default|null|<library> |

vrdeextpack null|<library> |

loghistorycount <value>

VBoxManage usbfilter add <index,0-N>

--target <uuid>|<name>|global

--name <string>

--action ignore|hold (global filters only)

[--active yes|no] (yes)

[--vendorid <XXXX>] (null)

[--productid <XXXX>] (null)

[--revision <IIFF>] (null)

[--manufacturer <string>] (null)

[--product <string>] (null)

[--remote yes|no] (null, VM filters only)

[--serialnumber <string>] (null)

[--maskedinterfaces <XXXXXXXX>]

VBoxManage usbfilter modify <index,0-N>

--target <uuid>|<name>|global

[--name <string>]

[--action ignore|hold] (global filters only)

[--active yes|no]

[--vendorid <XXXX>|""]

Page 19: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

[--productid <XXXX>|""]

[--revision <IIFF>|""]

[--manufacturer <string>|""]

[--product <string>|""]

[--remote yes|no] (null, VM filters only)

[--serialnumber <string>|""]

[--maskedinterfaces <XXXXXXXX>]

VBoxManage usbfilter remove <index,0-N>

--target <uuid>|<name>|global

VBoxManage sharedfolder add <vmname>|<uuid>

--name <name> --hostpath <hostpath>

[--transient] [--readonly] [--automount]

VBoxManage sharedfolder remove <vmname>|<uuid>

--name <name> [--transient]

VBoxManage guestproperty get <vmname>|<uuid>

<property> [--verbose]

VBoxManage guestproperty set <vmname>|<uuid>

<property> [<value> [--flags <flags>]]

VBoxManage guestproperty enumerate <vmname>|<uuid>

[--patterns <patterns>]

VBoxManage guestproperty wait <vmname>|<uuid> <patterns>

[--timeout <msec>] [--fail-on-timeout]

VBoxManage guestcontrol exec[ute] <vmname>|<uuid>

<path to program>

--username <name> --password <password>

[--arguments "<arguments>"]

[--environment "<NAME>=<VALUE> [<NAME>=<VALUE>]"]

[--flags <flags>] [--timeout <msec>]

[--verbose] [--wait-for exit,stdout,stderr||]

copyto|cp <vmname>|<uuid>

<source on host> <destination on guest>

--username <name> --password <password>

[--dryrun] [--follow] [--recursive] [--verbose]

createdir[ectory]|mkdir|md <vmname>|<uuid>

<directory to create on guest>

--username <name> --password <password>

[--parents] [--mode <mode>] [--verbose]

updateadditions <vmname>|<uuid>

[--source <guest additions .ISO>] [--verbose]

Page 20: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

VBoxManage debugvm <uuid>|<name>

dumpguestcore --filename <name> |

info <item> [args] |

injectnmi |

osdetect |

osinfo |

getregisters [--cpu <id>] <reg>|all ... |

setregisters [--cpu <id>] <reg>=<value> ... |

statistics [--reset] [--pattern <pattern>]

[--descriptions]

VBoxManage metrics list [*|host|<vmname> [<metric_list>]]

(comma-separated)

VBoxManage metrics setup

[--period <seconds>] (default: 1)

[--samples <count>] (default: 1)

[--list]

[*|host|<vmname> [<metric_list>]]

VBoxManage metrics query [*|host|<vmname> [<metric_list>]]

VBoxManage metrics enable

[--list]

[*|host|<vmname> [<metric_list>]]

VBoxManage metrics disable

[--list]

[*|host|<vmname> [<metric_list>]]

VBoxManage metrics collect

[--period <seconds>] (default: 1)

[--samples <count>] (default: 1)

[--list]

[--detach]

[*|host|<vmname> [<metric_list>]]

VBoxManage hostonlyif ipconfig <name>

[--dhcp |

--ip<ipv4> [--netmask<ipv4> (def: 255.255.255.0)] |

--ipv6<ipv6> [--netmasklengthv6<length> (def: 64)]]

create |

remove <name>

VBoxManage dhcpserver add|modify --netname <network_name> |

--ifname <hostonly_if_name>

[--ip <ip_address>

--netmask <network_mask>

--lowerip <lower_ip>

Page 21: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

--upperip <upper_ip>]

[--enable | --disable]

VBoxManage dhcpserver remove --netname <network_name> |

--ifname <hostonly_if_name>

VBoxManage extpack install <tarball> |

uninstall [--force] <name> |

cleanup

C:\Program Files\Oracle\VirtualBox>vboxmanage clonehd "l:\Users\testuser\.Virtua

lBox\HardDisks\Windows XP Professional.vdi" "L:\Users\testuser\.VirtualBox\HardD

isks\Windows XP Professional-copy01.vdi"

0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

Clone hard disk created in format 'VDI'. UUID: 210f5b3f-f04f-4d03-a84d-079a3e2d4

441

C:\Program Files\Oracle\VirtualBox>

CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" After you use the above procedure to clone a .vdi "virtual hard drive" file, you can use the steps that follow to create a new virtual machine. This new virtual machine will be very similar to the original virtual machine. It will have the same operating system as the original virtual machine. If it is running "Windows", it will have the same "SID" or "Security Identifier" as the original "Windows" virtual machine. This is only a possible problem if the new virtual machine is part of a "Windows Server" "domain". If the new virtual machine is part of a "Windows" "Workgroup", having two or more virtual machines with the same "SID" will not be a problem. Start the "Oracle VM VirtualBox" program. The "Oracle VM VirtualBox Manager" will be displayed:

Page 22: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

*

Click on the "New" button that is near the upper left-hand corner of the "Oracle VM VirtualBox Manager". A "New Virtual Machine Wizard" box will be displayed. Click on its "Next" button:

Page 23: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

A "VM Name and OS Type" box will be displayed:

*

Page 24: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

Type in an appropriate name for the new virtual machine: In this example, we typed in Windows XP Professional-copy01 Then click on the "Next" button:

A "Memory" box will be displayed:

Page 25: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

Adjust the amount of memory for the new virtual machine: The amount of memory should be less than half the amount of memory in the host computer. Reduce the amount of memory to an appropriate amount if you plan on running more than one virtual machine at the same time. In our example, we set the amount of memory to 3.245 Gigabytes. Click on the "Next" button:

* A "Virtual Hard Disk" box will be displayed:

Page 26: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

* Select the "Use existing hard disk" option. Then click on the little hard drive icon to the right of the box that will contain the name of the virtual hard drive:

* A "Choose a virtual hard disk file" box will be displayed:

Page 27: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

* Navigate to the location of the new .vdi "virtual disk" file that was created in the earlier steps in this procedure:

Page 28: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

*

Page 29: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

* Click on the new .vdi "virtual disk" file that was created in the earlier steps in this procedure. Then click on the "Open" button:

Page 30: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

* Click on the "Next" button of the "Virtual Hard Disk" box:

Page 31: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

* A "Summary" box will be displayed. Click on its "Finish" button:

* You should now be back at the "Oracle VM VirtualBox Manager" window:

Page 32: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

* The newly-created virtual machine will be highlighted. Click on the "Start" button that is near the upper left-hand corner of the "Oracle VM VirtualBox Manager":

Page 33: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

The newly-created virtual machine should be a "spitting image" of the original virtual machine:

Page 34: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

The newly-created virtual machine will have a unique "UUID Bios" (also known as a "motherboard UUID" or a "system UUID") a unique "hard disk UUID" for it's cloned .vdi "virtual hard drive" file and a virtual network adapter with a unique MAC address. The only similarity between the new and the original virtual machines are they both will have the same Windows "SID" or "Security Identifier" which is only an issue if one or both of the virtual machines belong to a "Windows Server" "domain".

Page 35: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

MOVING A .VDI "VIRTUAL HARD DRIVE" FILE FROM ONE PATH LOCATION TO ANOTHER PATH LOCATION IN THE SAME COMPUTER The "Oracle VM VirtualBox" program will not allow you to use a .vdi "virtual hard drive" file that you move from one "path location" to another "path location" in the same computer, unless you delete all mention of the file from the "VirtualBox.xml" file. The "VirtualBox.xml" file is usually located at C:\Users\<your user profile name>\.Virtualbox if you are running "Windows Vista" or "Windows 7" in your host computer. (There is a period at the left side of ".Virtualbox") The "VirtualBox.xml" file is usually located at C:\Documents and Settings\<your user profile name>\.Virtualbox if you are running "Windows XP" in your host computer.

Page 36: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

You can edit the "VirtualBox.xml" file with any text editor program including Windows "Notepad" or Windows "Wordpad": To start "Notepad" for most Windows computers: Use the right mouse button to click on the "VirtualBox.xml" file: A pop-up context menu will be displayed.

Page 37: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

*

Page 38: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

* Click on "Edit" in the pop-up context menu:

Page 39: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

*

Page 40: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

* If you open the VirtualBox.xml file in Windows "Notepad", it will look like this:

Page 41: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

If you open the VirtualBox.xml file in Windows "WordPad" by selecting "Open with.." in the pop-up context menu, it looks a bit neater like this:

Page 42: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

Delete the full path name of the .vdi "virtual hard drive" file that you either will be moving or have already moved.

APPENDIX 1: WINDOWS ACTIVATION ISSUES The newly-created virtual machine looks like this:

Page 43: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

Click on the Windows "Start" button of the new virtual machine:

Page 44: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

Use the right mouse button to click on "Computer" or "My Computer" in the right-most side of the "Start menu":

Page 45: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

*

Page 46: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

* A pop-up context menu will be displayed. Click on "Properties" in the pop-up context menu. A "System" window will be displayed:

Page 47: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

Use the vertical scroll bar to scroll down:

Page 48: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

* Look at the "Windows activation" section at the bottom of the "System" window. Click on "Activate Windows now".

Page 49: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

* A "Windows Activation" box will be displayed:

Page 50: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

Click on "Activate Windows online now":

Page 51: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

*

Page 52: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

Click on the "Close" button. Note in the "Activation" section of the "System" window that it says "Windows is activated".

Page 53: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

USING EXPORT/ IMPORT TO MOVE A VIRTUAL MACHINE FROM ONE COMPUTER TO ANOTHER IN "ORACLE VM VIRTUALBOX" In "Oracle VM VirtualBox", you can copy a virtual machine from one computer to another using the export/import feature. This is a feature that is not available in "VMware Player" and "Windows Virtual PC". See http://www.virtualbox.org/manual/ch01.html#ovf

Page 54: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

The export/import feature can be used to move a virtual machine from a "Windows" host computer to another "Windows" host computer. The export/import feature can be used to move a virtual machine from a "Mac" host computer to another "Mac" host computer. The export/import feature can be used to move a virtual machine from a "Windows" host computer to a "Mac" host computer. The export/import feature can be used to move a virtual machine from a "Mac" host computer to a "Windows" host computer.

AN ADMISSION THAT WE DID NOT TELL YOU THE ABSOLUTE TRUTH ABOVE! We did not tell you the whole truth at the beginning of this "how-to"! At the beginning of this article, we stated

(If you use "My Computer", "Computer", "Windows Explorer", or a command prompt window to copy a virtual machine or a .vdi virtual hard

drive, the "Oracle VM VirtualBox" program will usually refuse to let you

use the newly-created virtual machine or newly-created virtual hard drive.)

In "Oracle VM VirtualBox", you can copy a virtual hard drive directly by using

"My Computer", "Computer", "Windows Explorer", or a command prompt window but when you copy a virtual hard disk file, you cannot use a file name that you have already used for any virtual hard drive for any existing virtual machine in "Oracle VM VirtualBox". Problem: If you use "My Computer", "Computer", "Windows Explorer", or a command prompt window to copy a virtual machine or a .vdi virtual hard drive, and you create a virtual hard disk file with exactly the same name as a virtual hard drive on any existing virtual machine in "Oracle VM VirtualBox", then the "Oracle VM

Page 55: CLONING A VIRTUAL MACHINE IN ORACLE VM …aztcs.org/meeting_notes/winhardsig/virtualmachines/virtualbox/... · CLONING A VIRTUAL MACHINE IN "ORACLE VM VIRTUALBOX" IN A "WINDOWS.."

VirtualBox" program will refuse to let you use the newly-created virtual machine or newly-created virtual hard drive. (See http://www.modhul.com/2009/06/17/how-to-clone-or-copy-a-virtualbox-virtual-disk/.) We believe that the above-mentioned problem is too much of a pain for most users of "Oracle VM VirtualBox" to tolerate. See http://mvirtualoffice.com/my-virtual-technologies/stay-safe-clone-that-virtualbox-vdi-before-using-it/

APPENDIX 1 USING EXPORT/ IMPORT TO MOVE/COPY A VIRTUAL MACHINE FROM ONE COMPUTER TO ANOTHER IN "ORACLE VM VIRTUALBOX" In "Oracle VM VirtualBox", you can copy a virtual machine from one computer to another using the export/import feature. See http://www.virtualbox.org/manual/ch01.html#ovf