How to move a VBox VM to another PC?

This is for discussing general topics about how to use VirtualBox.

How to move a VBox VM to another PC?

Postby swish » 10. Nov 2007, 14:50

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?
swish
 
Posts: 21
Joined: 10. Nov 2007, 14:45

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

Postby coolio10 » 10. Nov 2007, 15:52

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?
coolio10
 
Posts: 13
Joined: 10. Nov 2007, 06:02

Postby watagan » 11. Nov 2007, 00:17

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...
watagan
 
Posts: 14
Joined: 30. Oct 2007, 09:17

Postby LesDes » 11. Nov 2007, 11:47

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
LesDes
 
Posts: 66
Joined: 23. Oct 2007, 09:53
Location: London

Postby coolio10 » 11. Nov 2007, 18:18

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?
coolio10
 
Posts: 13
Joined: 10. Nov 2007, 06:02

Postby swish » 12. Nov 2007, 06:28

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?
swish
 
Posts: 21
Joined: 10. Nov 2007, 14:45

Postby watagan » 12. Nov 2007, 09:47

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...
watagan
 
Posts: 14
Joined: 30. Oct 2007, 09:17

Postby Technologov » 12. Nov 2007, 22:31

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
Technologov
Volunteer
 
Posts: 3313
Joined: 10. May 2007, 16:59
Location: Israel

Postby swish » 13. Nov 2007, 06:43

to Technologov:
Include snapshots ??Are you sure?
swish
 
Posts: 21
Joined: 10. Nov 2007, 14:45

Postby Technologov » 13. Nov 2007, 17:19

There is no reliable way to move snapshots. My method won't work for snapshots.
Technologov
Volunteer
 
Posts: 3313
Joined: 10. May 2007, 16:59
Location: Israel

Moving Virtual Machines with Snapshots

Postby MountainX » 31. Jan 2008, 22:39

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?
MountainX
 
Posts: 30
Joined: 31. Jan 2008, 22:28
Location: USA

Postby insidepower » 1. Sep 2008, 03:57

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"/>
insidepower
 
Posts: 1
Joined: 1. Sep 2008, 03:52

Postby DaveQB » 6. Feb 2009, 05:13

DaveQB
 
Posts: 3
Joined: 14. May 2008, 06:08

Just moved a guest from linux host to windows host

Postby talmdal » 12. Feb 2009, 07:03

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
talmdal
 
Posts: 1
Joined: 24. Nov 2008, 18:25

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

Postby padularj » 14. Jul 2009, 02:48

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
padularj
 
Posts: 1
Joined: 14. Jul 2009, 02:46
Primary OS: OpenSolaris 10
VBox Version: OSE Mandriva
Guest OSses: Windows

Next

Return to Using VirtualBox

Who is online

Users browsing this forum: No registered users and 10 guests