How can I import an existing .vbox virtual machine in VirtualBox?

39

11

How can I import an existing .vbox virtual machine in VirtualBox? The instructions say I can only do this if I have an .ova or .ovf file, but I don't understand this as VirtualBox machines are .vbox files.

Is it really the case that once you've removed a VM from the VM Manager, there's no way to reimport it?

I also cannot import the hard disk image (.vdi) through Media Manager as there seems to be no "Add" button.

NickG

Posted 2014-04-25T08:29:23.797

Reputation: 1 102

You should be able to do this, look at the answers here. Some may no longer be applicable, but scroll down to see some other options: http://superuser.com/questions/187598/how-to-open-existing-vms-in-virtualbox

– Nattgew – 2014-04-25T20:24:21.643

Answers

34

From the VirtualBox Manager window, Machine->Add..." will let you open an existing vbox file. You might get errors if the files referenced in the vbox file--notably the files for the virtual disk images--aren't actually located where they're supposed to be.

If you run into trouble, keep in mind that the vbox file is just an XML text file that defines the virtual machine. It's not difficult to read it, figure out what the VM settings are supposed to be, and then define a new VM from scratch with the same settings.

Kenster

Posted 2014-04-25T08:29:23.797

Reputation: 5 474

1This also works for older VMs which still have the ".xml" extension. If the VM references the disk by UUID, you need to add the disk to VirtualBox before adding the VM. Stupidly, there is no "Add" function in the media manager (in v5.0.3), but if you start creating a new VM and get to the "Hard disk" stage, you can select "Use an existing virtual hard disk file" and use the folder button to add disks to VirtualBox. Then you can just cancel creating the new VM and instead add the existing one. – Lexikos – 2015-09-05T03:10:36.130

39

The VBoxManage command line interface provides more control over VirtualBox than the GUI. You can add an existing VM by running this on a terminal:

VBoxManage registervm /full/path/to/the/.vbox/file

notice: use the full path to the .vbox file. Relative paths wont work (Im on version 4.3.20r96996)

This command will only register the vm and wont copy/move any files. If you want to keep things organized, first copy/move the VM dir to your VirtualBox VMs dir and then run the register command.

Bruno Polaco

Posted 2014-04-25T08:29:23.797

Reputation: 491

2Thank you. Using the full path fixed it for me. I was using relative paths for 2 hours now and didn't think of this. Almost went nuts. – Dominik – 2015-09-27T21:12:17.200

2Very useful when you have to add a lot of Vms :)

find /path/to/VirtualBox\ VMs -type f -name "*.vbox" -exec VBoxManage registervm {}\; – SiRGt – 2017-03-02T15:02:36.807

3

I had the same issues after I moved my VMs to another location.

I found out that you can just open the .vbox file with fx. double click or open with (of course only if the .vbox is associated with VirtualBox) from the file system (file explorer). Then it will open in VirtualBox and add it to the list for next time.

If you have some path that have changed, fx. shared folder, you have to edit it manually. Either directly in the .vbox file or in the GUI.

jma73

Posted 2014-04-25T08:29:23.797

Reputation: 31