Cloning Virtual Machines

Discussions related to using VirtualBox on Windows hosts.
Post Reply
aBoo
Posts: 1
Joined: 13. Nov 2008, 09:50

Cloning Virtual Machines

Post by aBoo »

Hei

Is it possible to clone a virtual machine or make VM templates?
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

Welcome to our forum. You might want to take this opportunity to browse the Forum Posting Guide. This contains some useful tips on how to search for VBox knowledge and how to frame Qs. There have been many posts around this so have a browse.

The short answer is yes. There are pitfalls such as the disk UUIDs need to be unique so you can't just copy VDIs. You can share immutable VDIs between machines and you can also clone them or copy and the do a VBoxManage internalcommands setvdiuuid <filepath> to assign a new UUID to the given VDI file. This way, multiple copies of VDI containers can be registered.

One trick to save disk space is to split your configuration over two VDIs, a common immutable one and a (cloned from template) private one.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
dewittdale
Posts: 69
Joined: 22. Mar 2008, 00:59
Primary OS: MS Windows XP
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: ubuntu 8.04
Location: Kansas City Missouri

Post by dewittdale »

Place ;C:\Program Files\Sun\xVM VirtualBox;C:\Documents and Settings\Dale DeWitt\.VirtualBox\VDI into environmental variable path ( my-computer properties advanced envir . . .)

with cmd navigate to the VDI folder using the cd command

type vboxmanage clonevdi xxxx.vdi D:\location\name.vdi

watch the countdown from 0% to 100% done

If you insist upon space in your location & name then enclose the whole thing in quotes.

D:\ is merely an arbitrary drive I chose.
vba_djs
Posts: 6
Joined: 15. Mar 2008, 22:21

Cloned Machine Crashes

Post by vba_djs »

I just upgraded from VB 1.5.? to 2.0.4.
I used the clonevdi command to make a copy of an XP guest.
The original XP guest starts perfectly, however, the cloned guest will not start.
Some error messages flash on the screen, but they happen so fast that I cannot read what the problem is.
Is there some other 'upgrade' function that I must do before cloning the device?
dewittdale
Posts: 69
Joined: 22. Mar 2008, 00:59
Primary OS: MS Windows XP
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: ubuntu 8.04
Location: Kansas City Missouri

Post by dewittdale »

You obviously merged to no snapshots prior to copy. I don't know of any other suspect with the data you've provided.
vba_djs
Posts: 6
Joined: 15. Mar 2008, 22:21

Clone Snapshots

Post by vba_djs »

So do I have to take a snapshot before cloning?
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post by Sasquatch »

Please see the VirtualBox FAQ for the possible cause. You need to make 100% sure that the VM settings are the same for the clone as you have for the original.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
dewittdale
Posts: 69
Joined: 22. Mar 2008, 00:59
Primary OS: MS Windows XP
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: ubuntu 8.04
Location: Kansas City Missouri

Post by dewittdale »

Me said: "You obviously merged to no snapshots prior to copy." I've kept a snapshot prior to copy and somehow it loaded but you're not supposed to have snapshots when using clonevdi. That is what is meant by merged. Did you have a snapshot when using clonevdi? That was the inquiry.
vba_djs
Posts: 6
Joined: 15. Mar 2008, 22:21

Snapshots

Post by vba_djs »

I don't remember ever creating a snapshot.
vba_djs
Posts: 6
Joined: 15. Mar 2008, 22:21

Post by vba_djs »

Sasquatch wrote:Please see the VirtualBox FAQ for the possible cause. You need to make 100% sure that the VM settings are the same for the clone as you have for the original.
The settings are identical to the original VM that starts.
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

Post by mpack »

vba_djs wrote:The settings are identical to the original VM that starts.
I assume the "error message" is a BSOD coming from the guest? If so then the symptoms you describe are typical of getting the IDE Controller selection wrong, so please check this again.

Obviously, if two VMs behave differently then they cannot be identical.
vba_djs
Posts: 6
Joined: 15. Mar 2008, 22:21

Post by vba_djs »

mpack wrote:
vba_djs wrote:The settings are identical to the original VM that starts.
I assume the "error message" is a BSOD coming from the guest? If so then the symptoms you describe are typical of getting the IDE Controller selection wrong, so please check this again.

Obviously, if two VMs behave differently then they cannot be identical.
Mpack was correct.

I started comparing the settings of the two machines, and found in the General Section/Advanced tab that the original (good) machine was using an IDE controller type of PIIX3, while the cloned machine was using PIIX4.

Once I changed the cloned machine to PIIX3, it worked!

Thanks a lot.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post by Sasquatch »

vba_djs wrote:
mpack wrote:
vba_djs wrote:The settings are identical to the original VM that starts.
I assume the "error message" is a BSOD coming from the guest? If so then the symptoms you describe are typical of getting the IDE Controller selection wrong, so please check this again.

Obviously, if two VMs behave differently then they cannot be identical.
Mpack was correct.

I started comparing the settings of the two machines, and found in the General Section/Advanced tab that the original (good) machine was using an IDE controller type of PIIX3, while the cloned machine was using PIIX4.

Once I changed the cloned machine to PIIX3, it worked!

Thanks a lot.
Didn't I tell you? You said they were all the same, but obviously, you were wrong. It is noted in the FAQ, where I pointed you to.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Post Reply