How to open existing VMs in VirtualBox?

40

7

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.

Alex R

Posted 2010-09-12T02:05:14.210

Reputation: 1 629

Answers

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

Bryce

Posted 2010-09-12T02:05:14.210

Reputation: 2 038

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 – 2016-09-24T20:58:40.747

This worked without having to rename the original folder in VirtualBox 5.2 – Georg Schölly – 2017-10-25T15:11:44.833

7

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

Kevin

Posted 2010-09-12T02:05:14.210

Reputation: 79

Doesn't work in VirtualBox 5.2.0 on Windows – Markus Müller – 2017-10-30T09:16:04.197

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 – 2012-08-01T16:03:25.713

Worked for me on Ubuntu 12.04 & VirtualBox 4.1.12 – David Kaczynski – 2013-09-04T19:46:55.287

4Doesn't seem to work in VirtualBox 4.3.6 on Windows. Won't allow me to drop anything on the window. :-( – Simon East – 2014-02-10T01:07:28.837

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.

metachuh

Posted 2010-09-12T02:05:14.210

Reputation: 51

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 – 2014-02-10T01:13:57.957

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 – 2014-03-14T09:21:56.437

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.

Adam

Posted 2010-09-12T02:05:14.210

Reputation: 327

1I created a new machine and then attached the old disk to it... not very intuitive but works for me! Thanks – Alex R – 2010-09-16T02:32:31.670

2When 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 – 2010-12-14T14:46:22.703

7Add new does not work in VirtualBox 4. Any other solution? – Codism – 2011-04-08T21:30:36.170

-1 as Codism says, there is no "Add" button. – Mauricio Scheffer – 2011-09-19T20:43:34.710

2For VirtualBox 4 and up (no "Add" button), see Kevin's comment. – Alex Che – 2012-08-01T16:06:45.553

For VirtualBox 4, just use the Machine > Add menu and select your VM file – Guy – 2013-08-04T23:08:57.513

1This answer appears to be obsolete. – Bryce – 2014-01-03T19:16:41.327

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.

heavyd

Posted 2010-09-12T02:05:14.210

Reputation: 54 755

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...

hotei

Posted 2010-09-12T02:05:14.210

Reputation: 3 645

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 – 2010-09-12T15:10:04.720

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 – 2010-09-12T16:20:50.543

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.

Christopher

Posted 2010-09-12T02:05:14.210

Reputation: 133

2

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

CharlesB

Posted 2010-09-12T02:05:14.210

Reputation: 526

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.

Ben McIntyre

Posted 2010-09-12T02:05:14.210

Reputation: 111

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 – 2013-12-12T11:35:58.857

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 – 2013-12-13T00:51:12.357

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 – 2013-12-13T08:58:31.390

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 – 2014-02-10T04:55:30.670

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.

vvo

Posted 2010-09-12T02:05:14.210

Reputation: 1 291

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.

tst

Posted 2010-09-12T02:05:14.210

Reputation: 41

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.

Janne

Posted 2010-09-12T02:05:14.210

Reputation: 1