How to move a VBox VM to another PC?

This is for discussing general topics about how to use VirtualBox.
swish
Posts: 21
Joined: 10. Nov 2007, 14:45

How to move a VBox VM to another PC?

Post by swish »

I couldn't found a way to move a VBox virtual machine to another pc.So I have to manul modify xml file,who can tell me another way?
coolio10
Posts: 13
Joined: 10. Nov 2007, 06:02

Re: How to move a VBox VM to another PC?

Post by coolio10 »

swish wrote:I couldn't found a way to move a VBox virtual machine to another pc.So I have to manul modify xml file,who can tell me another way?
Can't you just move the virtual disk to the other pc and create a new virtual machine and pick existing disk?
watagan
Posts: 14
Joined: 30. Oct 2007, 09:17

Post by watagan »

Use 'VBoxManage clonevdi' to create the copy. You cannot simply copy the vdi to another machine. Check the user manual under 'VBoxManage clonevdi' for correct command syntax.

Make sure you save the machine state before cloning. Remove any snapshots before cloning, if you use them.

Regards...
LesDes
Posts: 66
Joined: 23. Oct 2007, 09:53
Location: London

Post by LesDes »

As far as I understand, the need for cloning is only on the **same** machine - if you want to have two VMs based on the same hard disk image.

One of the major advantages of a VM is that you can move it about. There should be no need to clone a drive if moving it to an other machine.
Les
coolio10
Posts: 13
Joined: 10. Nov 2007, 06:02

Post by coolio10 »

LesDes wrote:As far as I understand, the need for cloning is only on the **same** machine - if you want to have two VMs based on the same hard disk image.

One of the major advantages of a VM is that you can move it about. There should be no need to clone a drive if moving it to an other machine.
Nope just read up somewhere. Uuid is linked to the virtual machine?
swish
Posts: 21
Joined: 10. Nov 2007, 14:45

Post by swish »

what's my action:
1.The VM is a virtual machine with snapshots,I wan't they still available on the second PC.
2.I don't want create a new machine in the second pc ,I just want import.
So,I do the follow steps to move the machine:
1.copy all VDI file and it's snapshots,configure file to another PC
2.modify the xml file remove all link with origin pc,for example DVD Image.
3.copy origin pc virtualbox.xml file to the second pc and copy it's VM define to second PC's Origin virtualbox.xml
4.start VirtualBox ,then the PC have a Cloned disk image.

I want have a official tools to do this?Is it can include in next version?
watagan
Posts: 14
Joined: 30. Oct 2007, 09:17

Post by watagan »

I have cloned a vdi successfully and moved it to another disk and host OS. Cannot remember exact details but it goes something like this:

To clone a vdi file, in a console enter:

VBoxManage clonevdi vm1.vdi vm2.vdi

This will clone the original vm1 to make vm2 in the same location as vm1.

Install VBox on the destination machine and then copy the cloned vdi to the destination machine.

The location of the virtual machines and VDI files is important. They need to be in Virtualbox > file > preferences > general. You will need to set this up in VBox on your destination PC.

Then go Virtualbox > file > virtual disk manager" and use the "Add" button to add the new VM.

Start the process of creating a new VM. Virtualbox > new etc. When you get to the popup for "Virtual Hard Disk" you select "Existing" and select the clone VM you created.

Not sure about getting your snapshots over to the new machine.

Hope this helps, give it a try if you like and post your findings...
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

Post by Technologov »

You don't need to clone anything.

Just backup your virtual hard disks VDI's, and on the target machine create new VMs.

This won't save MAC addresses and some other non-important things, but it will work.

-Technologov
swish
Posts: 21
Joined: 10. Nov 2007, 14:45

Post by swish »

to Technologov:
Include snapshots ??Are you sure?
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

Post by Technologov »

There is no reliable way to move snapshots. My method won't work for snapshots.
MountainX
Posts: 30
Joined: 31. Jan 2008, 22:28
Location: USA
Contact:

Moving Virtual Machines with Snapshots

Post by MountainX »

Technologov wrote:There is no reliable way to move snapshots. My method won't work for snapshots.
Is this still true? I am thinking about switching to VirtualBox, but the whole purpose of VMs is flexibility. If I can't move a VM from one computer to another without losing snapshots, that pretty much rules out using VirtualBox!

I hope this isn't true.

BTW, I will also need to import VPC and VMWare images. I assume I can do this. I assume I will lose the existing snapshots, however. Can anyone confirm this?
insidepower
Posts: 1
Joined: 1. Sep 2008, 03:52

Post by insidepower »

In order to move vdi and image file to another location,
change the following (highlighted in bold) in VirtualBox.xml to reflect it (no changes in uuid is required)

<MachineRegistry>
<MachineEntry uuid="{5bababfa-ad62-471c-44b8-24bc07022f03}" src="Machines/winXP/winXP.xml"/>

<DiskRegistry>
<HardDisks>
<HardDisk uuid="{xxx}" type="normal">
<VirtualDiskImage filePath="/media/software/virtualBox/winXP/winXP.vdi"/>
<DiffHardDisk uuid="{xxx}">
<VirtualDiskImage filePath="/media/Software/VirtualBox/Machines/winXP/Snapshots/{xxx}.vdi"/>
DaveQB
Posts: 3
Joined: 14. May 2008, 06:08

Post by DaveQB »

talmdal
Posts: 1
Joined: 24. Nov 2008, 18:25

Just moved a guest from linux host to windows host

Post by talmdal »

1) Copied the disk.vdi file
2) Copied the Corresponding directory from the Machines directory
3) In the Virtual Box control application registered the copied disk.vdi
4) Manually added the MachineEntry tag in the MachineRegistry in the VirtualBox.xml. (Made sure I got the right guid for the copied machine.
5) In the Server.xml changed the version attribute on the VirtualBox tag from 1.6-linux to 1.6-windows.
6) Went back to the Virtual Box console and change the interface adapter from eth0 to the actual network adapter on the windows box.

Everything worked fine up to there. I was able to boot and access the machine.

Not leaving well enough alone I went and screwed it up by changing the MAC address, because the ip was conflicting with the original vm.

It was a problem with the Ubuntu guest networking definitions... needed to go set the new mac address in the /etc/udev/rules.d/70-persistent-net.rules
padularj
Posts: 1
Joined: 14. Jul 2009, 02:46
Primary OS: OpenSolaris 10
VBox Version: OSE Mandriva
Guest OSses: Windows

Re: How to move a VBox VM to another PC?

Post by padularj »

Process is very easy
1)copy vdi to new host
2)copy snapshots from snapshots directory to same location
3)copy xml file or edit whichever is easier
4)start it up - that's it
Locked