40

I recently got a new workstation and I moved my VirtualBox and VMWare Player VMs from the old PC to the new.

The VMWare Player VMs are a snap: you go to “File -> Open a Virtual Machine…”, find the .vmx files from the old PC, and voila! It’s up and running. All the required files apparently are in the same folder.

With VirtualBox there just doesn’t seem to be a way to do that. Looks like VMs are tied to the original host in some magical/invisible way like registry entries, etc.

12 Answers 12

48

The previous answers appear obsolete.

As of version 4 of the Oracle VirtualBox Manager, the "Add" option is hidden in the "Machine" menu (which is an operating system menu). Just select Add, and navigate to the .vbox file you want. This works great even if the vbox file is on an external drive: if the drive is later removed, the missing boxes are simply marked as 'inaccessible'.

enter image description here

  • Just be aware that you will have to name your machines different from the original or delete the VM folder before you do, otherwise Oracle in their motherly care about your will not allow you to proceed as in their opinion "the folder already exist and might belong to another VM". – ajeh Sep 24 '16 at 20:58
  • This worked without having to rename the original folder in VirtualBox 5.2 – Georg Schölly Oct 25 '17 at 15:11
7

In the machine folder there is a *.vbox file. Drag it into the VM list in VirtualBox.

  • This worked for me on VirtualBox 4.1.18. Just dropped the virtual machine *.xml file to the VM list. Also needed to add the system's virtual disk back again in the system / storage dialog. – Alex Che Aug 1 '12 at 16:03
  • Worked for me on Ubuntu 12.04 & VirtualBox 4.1.12 – David Kaczynski Sep 4 '13 at 19:46
  • 4
    Doesn't seem to work in VirtualBox 4.3.6 on Windows. Won't allow me to drop anything on the window. :-( – Simon East Feb 10 '14 at 1:07
  • Doesn't work in VirtualBox 5.2.0 on Windows – Markus Müller Oct 30 '17 at 9:16
5

Importing existing virtual machines from another host into VirtualBox 4 and above on Windows hosts:

  1. Importing the vdi virtual disk:

    1. Go to the menu: *File ⇨ Virtual media manager.

    2. Drag and drop the [vm_name].vdi into the list.

  2. Adding the imported machine to the vbox manager list:

    1. Double-click on the [vm_name].vbox file in the directory of the vm, to add this machine to the vbox manager list.

    2. Double-click on the [vm_name].vbox inside the vbox manager list to start the appliance.

  3. Sidenotes:

    1. If the VM comes from an older vbox release, you will have an [vm_name].xml inside a sub directory instead of a [vm_name].vbox in the same directory as [vm_name].vdi.

    2. Copy the [vm_name].xml into the same directory as the [vm_name].vdi and rename it to [vm_name].vbox.

    3. Proceed with step 1.1 or 2.1 depending on the actions you have already taken.

  • Unfortunately it doesn't seem to allow you to drop a VMDK on the Virtual Media Manager window in VirtualBox 4.3.6 on Windows. :-( – Simon East Feb 10 '14 at 1:13
  • 1
    @Simon Find the .vbox file and double click it. It added itself to the list of VMs in the manager for me (Windows 8.1) – Bojangles Mar 14 '14 at 9:21
4

If you want to use an existing virtual hard disk and 'open' it into Virtual Box - you need to go to “File > Virtual Media Manager” and select ‘Add.’

Browse to your existing disk and select ok. This registers a disk with Virtual Box. Now you need to attach this disk to a new or existing VM to actually use it.

  • 1
    I created a new machine and then attached the old disk to it... not very intuitive but works for me! Thanks – Alex R Sep 16 '10 at 2:32
  • 2
    When I try that (adding a .vhd created w/ Win7 Virtual PC) I get the error: Failed to open the hard disk V:\ProgramData\VirtualPC\CleanTesting_XP sp1.vhd. Parent medium with UUID {199e419e-a076-d811-81ef-8eeb0865d5ed} of the medium 'V:\ProgramData\VirtualPC\CleanTesting_XP sp1.vhd' is not found in the media registry ('C:\Users\Clay/.VirtualBox\VirtualBox.xml'). – Clay Nichols Dec 14 '10 at 14:46
  • 7
    Add new does not work in VirtualBox 4. Any other solution? – Codism Apr 8 '11 at 21:30
  • 2
    For VirtualBox 4 and up (no "Add" button), see Kevin's comment. – Alex Che Aug 1 '12 at 16:06
  • 1
    This answer appears to be obsolete. – Bryce Jan 3 '14 at 19:16
3

By default, VirtualBox loads its configuration data from the folloing paths:

  • On Windows, this is %HOMEDRIVE%%HOMEPATH%\.VirtualBox; typically something like C:\Documents and Settings\Username\.VirtualBox.
  • On Mac OS X, this is $HOME/Library/VirtualBox.
  • On Unix-like systems (Linux, Solaris), this is $HOME/.VirtualBox.

This means that machines are specific to the logged in user. If you need to set a common place to store machines between different users you can override the default locatiion by setting the VBOX_USER_HOME environment variable. VirtualBox will use the path in this variable as its store for VM configuration data.

See the VirtualBox help topic on VirtualBox configuration data for more information.

2

I'm not sure I see a problem here. In VirtualBox if you are opening a new VM (one you might have created on a different computer) you use File/Import Appliance and then browse for the file to open. After importation it can be found in the main VM panel.

If you created the VM on the same computer then it's already in the left pane of the main program window.

It may be different from what you're used to but I don't see why it would be frustrating...

  • No luck... "File/Import Appliance" requires an OVF file, which doesn't exist (I guess, I could have created one by doing "Export Appliance" on the old computer, but it's too late now). – Alex R Sep 12 '10 at 15:10
  • I think the V'Box documentation is pretty clear on this requirement. Unfortunate that you can't go back and redo. What files DO you have available? Maybe there's a way to convert? Or load the old files back on VMware and re-export? – hotei Sep 12 '10 at 16:20
2

If you are on a Unix-like computer you can do this:

find /path/to/vms -name "*.vbox" -exec VBoxManage registervm {} \;

You just need to remember to provide the entire path to the .vbox file. If you specify a relative path it will foolishly assume that it is relative to your home folder.

For example, I did this after rebuilding my workstation:

$ find /store/vm -name "*.vbox" -exec VBoxManage registervm {} \;

It found and re-registered all of my virtual machines.

2

On Mac OS X, simply open the .vbox file (from the Finder) and it gets added to the list of virtual machines.

1

Regarding errors like this:

Failed to open the hard disk V:\ProgramData\VirtualPC\CleanTesting_XP sp1.vhd. Parent medium with UUID {199e419e-a076-d811-81ef-8eeb0865d5ed} of the medium 'V:\ProgramData\VirtualPC\CleanTesting_XP sp1.vhd' is not found in the media registry ('C:\Users\Clay/.VirtualBox\VirtualBox.xml').

VirtualBox seems to cache the UUID associated with a virtual disk filename. It's not in the file the message says; it must be stored elsewhere. Apparently VirtualBox 4 doesn't support unregister/register disk commands any more.

In the end, I found if I changed the name of the VDI file, then it no longer matches the cached entry and VirtualBox doesn't complain.

  • This doesn't seem to work on 4.3 releases. When I try every answer to this question I always get this message :( – Álvaro González Dec 12 '13 at 11:35
  • I've now found File > Virtual Media Manager. This allows you to deallocate VDI images from machines and remove them from the media registry. They can then be re-added to a VM as desired. – Ben McIntyre Dec 13 '13 at 0:51
  • Correction to my previous comment: I was getting this error message because the original disk image was not self-contained—it was linked to an undo disk or it was a diff over another image or something like that. – Álvaro González Dec 13 '13 at 8:58
  • Yes, I had errors like this because some of my machines were based on snapshots of VMDK images. My eventual solution was to create a new blank machine with the root VMDK attached, then create another blank machine with the VMDK snapshot attached, and then finally I could double-click my VBOX file and it would load without errors. – Simon East Feb 10 '14 at 4:55
1

On Debian, I edited ~/.VirtualBox/VirtualBox.xml and also the machine.xml I want to import : ~/VirtualBox VMs/$machine/$machine.xml

Close VirtualBox, add in VirtualBox.xml :

<MachineRegistry>
  <MachineEntry uuid="{$find-in-machine.xml}" src="/$fullpath-to-machine.xml"/>
</MachineRegistry>

Relaunch VirtualBox, add host-only network if needed, import ext pack if needed (https://www.virtualbox.org/wiki/Downloads), install virtualbox additions if needed : sudo apt-get install virtualbox-guest-additions-iso.

Start your VM.

1

None of the solutions above worked for me because I was trying to import a VDI file created under VirtualBox 3.1.6 into VirtualBox 4.32 running on a different machine. This is a self contained file and there is no linkage to another VDI. I kept getting the error:

Parent medium with UUID {a9dccef3-45f8-45ff-835e-a2b6e7279bac} of the medium 
'c:\Disks\Windows.2003.R2.Enterprise.SQL.Express.192.168.56.222.Trusted.vdi' 
is not found in the media registry

I even imported the same vdi under VirtualBox 3.1.6 and then tried to use VBoxManage clonehd again to see if I can get rid of the error but that did not work either.

In the end I simply edited .VirtualBox/VirtualBox.xml manually by adding

<HardDisk uuid="{43ea34ba-6d72-413e-8b37-32f475927ace}" location="C:/Disks/Windows.2003.R2.Enterprise.SQL.Express.192.168.56.222.Trusted.vdi" format="VDI" type="Normal"/>

(The uuid was obtained using VBoxManage showvhinfo under VirtualBox 3.1.6.)

And that finally solved the problem, i.e., I was able to create a new VirtualBox session using the vdi.

Hope this note will help those who runs into the same problem.

0

In VirtualBox 4.3.8 running on a Win 7 host the solution works very smoothly by doubleclicking on the .vbox file of the machine - it even found the respective disks and associated them. Earlier I tried the registervm command line option but that complained about the attached hard disk not being found, as the documentation predicts. I then associated the .vdi virtual harddisk filetype with Virtualbox.exe, not sure if that helped.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.