35

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.

31

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.

  • 1
    This 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 Sep 5 '15 at 3:10
35

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.

  • 2
    Thank 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 Sep 27 '15 at 21:12
  • 1
    Very useful when you have to add a lot of Vms :) find /path/to/VirtualBox\ VMs -type f -name "*.vbox" -exec VBoxManage registervm {}\; – SiRGt Mar 2 '17 at 15:02
2

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.

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.