7.6. VBoxManage registervm/unregistervm

The registervm command enables you to import a virtual machine definition in an XML file into Oracle VM VirtualBox. The machine must not conflict with one already registered in Oracle VM VirtualBox and it may not have any hard or removable disks attached. It is advisable to place the definition file in the machines folder before registering it.

Note

When creating a new virtual machine with VBoxManage createvm, as shown in Section 7.7, “VBoxManage createvm”, you can directly specify the --register option to avoid having to register it separately.

The unregistervm command unregisters a virtual machine. If --delete is also specified, the following files will also be deleted automatically:

  • All hard disk image files, including differencing files, which are used by the machine and not shared with other machines.

  • Saved state files that the machine created. One if the machine was in Saved state and one for each online snapshot.

  • The machine XML file and its backups.

  • The machine log files.

  • The machine directory, if it is empty after having deleted all of the above files.