I need to move 3 virtual machines to a different host machine. I thought the appliance import/export would be the best way to do this. I tried doing all three at once, and also one at a time, with the same results. Below is what happens when using the command line import.
VirtualBox Command Line Management Interface Version 3.1.0
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Interpreting /home/justin/host6.ovf...
OK.
Disks: vmdisk1 8589934592 -1 http://www.vmware.com/specifications/vmdk.html#sparse {9affdaaa-ce36-4cfa-b54c-f6cb207ca9b1}.vmdk 504596992 -1 <NULL>
Virtual system 0:
0: Suggested OS type: "Mandriva"
(change with "--vsys 0 --ostype <type>"; use "list ostypes" to list all possible values)
1: Suggested VM name "host6"
(change with "--vsys 0 --vmname <name>")
2: Number of CPUs (ignored): 1
3: Guest memory: 128 MB
(change with "--vsys 0 --memory <MB>")
4: Sound card (appliance expects "ensoniq1371", can change on import)
(disable with "--vsys 0 --unit 4 --ignore")
5: USB controller
(disable with "--vsys 0 --unit 5 --ignore")
6: Network adapter: orig Bridged, config 2, extra type=Bridged
7: Floppy
(disable with "--vsys 0 --unit 7 --ignore")
8: CD-ROM
(disable with "--vsys 0 --unit 8 --ignore")
9: IDE controller, type PIIX4
(disable with "--vsys 0 --unit 9 --ignore")
10: Hard disk image: source image={9affdaaa-ce36-4cfa-b54c-f6cb207ca9b1}.vmdk, target path=/home/justin/.VirtualBox/HardDisks/{9affdaaa-ce36-4cfa-b54c-f6cb207ca9b1}.vmdk, controller=9;channel=0
(change controller with "--vsys 0 --unit 10 --controller <id>";
disable with "--vsys 0 --unit 10 --ignore")
0%...FAILED
ERROR: Cannot unregister the machine 'host6' because it has 2 medium attachments
Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component Machine, interface IMachine, callee <NULL>
Context: "ImportAppliance" at line 671 of file VBoxManageImport.cpp
Do these happen to have snapshots?
AFAIK you can not export if there are snapshots.
You will need to merge them if you want to export to a different machine. BE VERY CAREFUL with this.
Read all about it in the VirtualBox users guide before you mess with them. One mistake and you can kill the VM.
Do you already have a 'host6' VM on the target host?
I'm interpreting 'ERROR: Cannot unregister the machine 'host6' because it has 2 medium attachments' as an attempt by the import command to unregister an existing VM before registering the new imported one.
Try manually deleting in the GUI (may have to detach any hard disks first).
As PerryG says, if the SOURCE VM on the SOURCE host has snapshots, then they will need to be dealt with: ask here if you are not 100% sure.
I merged the VM down to a single snapshot and I am still receiving the same error. Unless there is even more merging I can do? (Fortunately, I am not too scared to try things with this VM, there is nothing on it that is not replicated elsewhere.)
As for the target host machine, there are no VMs installed on it at all. I am starting with a fresh install of VirtualBox, and I've made sure to delete any failed attempts at importing this VM.
You must discard all Snapshots on the source host/vm otherwise changes made since that snapshot are not reflected in the base VDI, and I presume it is the base VDI that export exports. You need to see only 'Current State'.
Use the 'Discard Snaphot' button, DO NOT ever use 'Discard Current Snapshot and State'.
With a (any) snaphot in place, the base VDI image file is frozen and disk changes are stored elsewhere.
Use Discard Snapshot on the top/first snapshot to copy those changes into the base VDI image file, so that it contains all changes and can then be exported.
Yes, it seems I did have one more snapshot to go. Thank you for your help, it is very non-obvious that deleting all the snapshots creates a new "snapshot" containing everything.
Also, it was not clear to me that exporting an appliance creates multiple files that need to be transferred, not just the .ovf file. Looks like everything is working now, though.