Best way to clone VMs?

This is for discussing general topics about how to use VirtualBox.
Post Reply
Bullitt
Posts: 17
Joined: 19. Jan 2011, 11:32
Primary OS: MS Windows 2008
VBox Version: OSE other
Guest OSses: windows server 2008

Best way to clone VMs?

Post by Bullitt »

Hi guys!


I am rather new to Virtualbox and so far I like it on both my windows box and my mac.

I am however looking for something like "CLONE WM" button. What is the best way to make an identical copy of a VM? Do I really have to first export and then import it again???? :(

Can I export to WMWare, such as WMware fusion and import WMWare VMs into Virtualbox???
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Best way to clone VMs?

Post by mpack »

VBox4me2, you fell into the trap... :-) All of your suggestions are about cloning disks, not about cloning VMs...

Export/Import is probably the closest, yes. Or, in V4 you can copy the folder then make a few edits to change UUIDs, than add the folder as a new machine. Details to be worked out on this one as I've not had a need to do it yet.
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: Best way to clone VMs?

Post by vbox4me2 »

Cloning a disk is the same as cloning a vm, their both disk(files) :mrgreen:
abcuser
Volunteer
Posts: 595
Joined: 10. May 2007, 20:03
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu, Windows XP

Re: Best way to clone VMs?

Post by abcuser »

If you are using the vbox v4.0.x the simplest way is (assuming Windows XP host):
1. With operating system tool copy folder C:\Documents and Settings\[user]\VirtualBox VMs\[your_virtual_machine_folder] to C:\Documents and Settings\[user]\VirtualBox VMs\[your_new_virtual_machine_folder]
2. Open cmd tool and execute:
cd C:\Program Files\Oracle\VirtualBox (default vbox install path in Windows xp)
VBoxManage internalcommands sethduuid "path_to_your_new_virtual_machine_vdi_file"
Bullitt
Posts: 17
Joined: 19. Jan 2011, 11:32
Primary OS: MS Windows 2008
VBox Version: OSE other
Guest OSses: windows server 2008

Re: Best way to clone VMs?

Post by Bullitt »

Host is Windows Server 2008 R 2 Foundation.

Guests are Windows server 2008 R2 Foundation too :-)
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Best way to clone VMs?

Post by mpack »

abcuser wrote:2. Open cmd tool and execute:
cd C:\Program Files\Oracle\VirtualBox (default vbox install path in Windows xp)
VBoxManage internalcommands sethduuid "path_to_your_new_virtual_machine_vdi_file"
Hmm. Of course that command is undocumented so I can't confirm by reading the manual - but sethduuid only changes the UUID of one VDI file right? If so then that leaves you with a VDI that doesn't match what's referenced by the xml - hence manual editing of the xml would be a necessary next step: changing both VM and VDI UUIDs.... and of course you don't want to mess with UUIDs at all if you use snapshots, as you'll break the snapshot chain.
abcuser
Volunteer
Posts: 595
Joined: 10. May 2007, 20:03
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu, Windows XP

Re: Best way to clone VMs?

Post by abcuser »

mpack, you are right, this is not "the best way to clone VMs", specially if users does not know exactly how to hack. And yes this will not work if snapshots are used!
thelemanu
Posts: 5
Joined: 7. Jan 2011, 12:20
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows

Re: Best way to clone VMs?

Post by thelemanu »

Ok, so what is the best way to clone a full VM [Windows guest], not only the VDI file? :?:
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Best way to clone VMs?

Post by mpack »

See 2nd para of 3rd message.
Post Reply