[PLUG] Export/Import VirtualBox VM

TomasK tomas.kuchta.lists at gmail.com
Wed Jan 20 01:20:01 UTC 2021


On Tue, 2021-01-19 at 15:13 -0800, Dick Steffens wrote:
> I have a virtual machine I want to copy to another machine. The
> original 
> is on my 18.04 Xubuntu machine (ENU-2) and I want to copy it to my 
> Ubuntu 20.04 machine (ENU-1). VirtualBox on ENU-2 is version 6.1.16 
> r140961(Qt5.6.5) Copyright 2020 Oracle Corporation and/or its
> affiliates.
> 
> And VirtualBox on ENU-1 is 6.1.16_Ubuntu r140961
> (c) 2004-2021 Oracle Corporation (Qt5.12.8)
> 
> Following the directions at:
> 
> https://askubuntu.com/questions/588426/how-to-export-and-import-
> virtualbox-vm-images
> 
> I select the VM to export in the export appliance and click next.
> The 
> next screen does not match what I have. It does ask me to select the 
> format, set to Open Virtualization Format 1.0, and also lets me
> enter 
> the output file path and name. Mine also offers to set a MAC Address 
> Policy, with "Include only NAT network adapter MAC addresses" set.
> The 
> other options are "Strip all network adapter MAC addresses" or
> "Include 
> all network adapter MAC addresses". I leave that set to the only NAT 
> choice. There is an checked box on the instructions page that says 
> "Write Manifest file". I leave that checked. My page has that, and 
> another box called "Include ISO image files" which I leave unchecked.
> 
> When I click Next I get a VirtualBox Error:
> 
> --------------------------------------
> Failed to prepare the export of the appliance .
> 
> Callee RC: NS_ERROR_ABORT (0x80004004)
> --------------------------------------
> 
> I searched with DDG. All references to that error are from many years
> ago.
> 
> Any ideas what to look for here?
> 
> Thanks.
> 

If your VM is Win7 or Win10 - I would be careful with exporting it/them
to appliance and importing them elsewhere.

The export/import process will change devices uuids - windows might not
like it and de-activate. Changing CPU type (new host) can also result
in windows deactivation, on its own or in combination with the uuids.
Joys of proprietary SW!

For this reason - I do following:
1. if not already done in the past - save CPU type on the old host:
   grep 'model name' /proc/cpuinfo
   vboxmanage list hostcpuids > cpuName
2. Copy what you need out of the following directories (keep the
directory structure if you are not copying everything):
   ~/VirtualBox\ VMs (VM images)
   ~/.config/VirtualBox* (configuration - ~/.Virtualbox if your
installation is old)

Restore in new host:
1. Copy the content from above to new host
2. If not done in the past - Add the old host CPU info to:
VirtualBox\ VMs/vmName/vmName.vbox as (example):

    </ExtraData>
    <Hardware>
      <CPU count="2">
        <PAE enabled="true"/>
        <LongMode enabled="true"/>
        <HardwareVirtExLargePages enabled="false"/>
        <CpuIdTree>
          <CpuIdLeaf id="0" eax="13" ebx="1970169159" ecx="1818588270"
edx="1231384169"/>
          <CpuIdLeaf id="1" eax="198339" ebx="34605056"
ecx="2147154943" edx="3219913727"/>
          <CpuIdLeaf id="2" eax="1979933441" ebx="15775487" ecx="0"
edx="12648448"/>
          <CpuIdLeaf id="3" eax="0" ebx="0" ecx="0" edx="0"/>
          <CpuIdLeaf id="4" eax="469778721" ebx="29360191" ecx="63"
edx="0"/>
          <CpuIdLeaf id="5" eax="64" ebx="64" ecx="3" edx="270624"/>
          <CpuIdLeaf id="6" eax="119" ebx="2" ecx="9" edx="0"/>
          <CpuIdLeaf id="7" eax="0" ebx="10155" ecx="0" edx="0"/>
          <CpuIdLeaf id="8" eax="0" ebx="0" ecx="0" edx="0"/>
          <CpuIdLeaf id="9" eax="0" ebx="0" ecx="0" edx="0"/>
          <CpuIdLeaf id="10" eax="120588291" ebx="0" ecx="0"
edx="1539"/>
          <CpuIdLeaf id="2147483648" eax="2147483656" ebx="0" ecx="0"
edx="0"/>
          <CpuIdLeaf id="2147483649" eax="0" ebx="0" ecx="33"
edx="739248128"/>
          <CpuIdLeaf id="2147483650" eax="1702129225" ebx="693250156"
ecx="1919894304" edx="1297360997"/>
          <CpuIdLeaf id="2147483651" eax="896081961" ebx="926233645"
ecx="1126191920" edx="1075860816"/>
          <CpuIdLeaf id="2147483652" eax="959328800" ebx="2051557168"
ecx="0" edx="0"/>
          <CpuIdLeaf id="2147483653" eax="0" ebx="0" ecx="0" edx="0"/>
          <CpuIdLeaf id="2147483654" eax="0" ebx="0" ecx="16801856"
edx="0"/>
          <CpuIdLeaf id="2147483655" eax="0" ebx="0" ecx="0"
edx="256"/>
          <CpuIdLeaf id="2147483656" eax="12327" ebx="0" ecx="0"
edx="0"/>
          <CpuIdLeaf id="2147483657" eax="7" ebx="832" ecx="832"
edx="0"/>
        </CpuIdTree>
      </CPU>
...
...
3. Start VirtualBox - you should see your VM - if not - fix mistake(s)
4. Start VM - if it runs - huraaahhh else fix mistake(s)

This is how I go about it; Your mileage might vary,
Tomas




More information about the PLUG mailing list