Corrupted VirtualBox Guest

When you abruptly close VirtualBox you might risk errors when startin the guest. Most of the time the only thing that gets corrupted is the .vbox file. This is a file (XML) which contains all the settings concering the guest.

Things to check:

  • Open the the [name].vbox file (with for example gedit)
  • Check whether the file has a and a (start/end)
  • No ending ? Your .vbox file is corrupted

When adding the appliance you’ll now receive an error:

[[email protected]]$ vboxmanage registervm "/home/USER/Data/VIRTUAL MACHINES/Octopress/octopress.vbox" 
VBoxManage: error: Runtime error opening '/home/USER/Data/VIRTUAL MACHINES/Octopress/octopress.vbox' for reading: -102 (File not found.).
VBoxManage: error: /build/virtualbox/src/VirtualBox-4.2.16/src/VBox/Main/src-server/MachineImpl.cpp[470] (nsresult Machine::initFromSettings(VirtualBox*, const com::Utf8Str&, const com::Guid*))
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component Machine, interface IMachine, callee nsISupports
VBoxManage: error: Context: "OpenMachine(Bstr(a->argv[0]).raw(), machine.asOutParam())" at line 90 of file VBoxManageMisc.cpp
[[email protected]]$ 
  • Now just grab the [guest].vbox-prev file from the folder (where the .vbox file is in)
  • Open with gedit
  • Copy everything in the prev file
  • Open the .vbox file with gedit and copy all the data

Now you’ll be able to (re)start your guest