11

For some reason, all of a sudden, all virtual machines are gone from the User Interface in virtual box. I suspect CCleaner has something to do with it, but that's not the point. Both the virtual hardisks and the .xml files for the machines are still in their respective folders. How can I use them to get my virtual machines back into virtualbox?

I tried simply creating a new machine from the old virtual hardisks, and it worked with the ubuntu guest, but not with the windows one. Plus, it'd be nice to get my old machines back instead of having to create new ones, that would keep me from having to fix some shortcuts as well as reconfigure shared folders and other stuff.

8 Answers 8

8

Under File -> Preferences in VirtualBox, set your Default Machine & Hard Disk folder. VirtualBox should scan these folders on startup and add any machines found to the pane.

alt text

2
  • I'm sorry, that simply didn't work. If I create a new machine, it will go to the folder I specified, right next to the old machines. But virtualbox still doesn't look for the old ones. Even after a system reboot.
    – Malabarba
    Commented Dec 8, 2009 at 17:43
  • Might not be for everyone, but instantly solved my problem. OS: Ubuntu14.04, machine folder was mounted to /disk1 Commented Mar 8, 2017 at 17:19
8

Open Oracle VM VirtualBox Manager and under Machine -> Add, point to each virtual machine file (.xml or .vbox) open and it will restore the machine back to the Manager dropdown list.

Machine -> Add

7

Solved it by manually editing virtualbox.xml file to include the old machine files, then added the hard drives through the User Interface, then modified the machine .xml files to point to the hardrive's uuid.

In fact, the reason the machines were gone in the first place is that I accidentally deleted the virtualbox.xml file.

1
  • 3
    I did not delete mine but they are now missing. Looks like I will have to rebuild manually. Why does VB not have a data recovery tool for this?
    – cwd
    Commented Aug 2, 2011 at 20:21
5

I woke up this morning to find the VirtualBox .vbox file of a guest that was running last night completely missing and VirtualBox telling me it was corrupted. Windows Update ran throughout the night and automatically rebooted my host.

Turns out I had a .vbox-temp version of the file still in the folder. I renamed it to .vbox and now my guest is back. Just FYI.

5

I solved it (windows host) by double-clicking on the .vbox file of my old guest machine. Simple as that.

1
  • 1
    This solves my issue. All my VMs and virtualbox.xml were still there, but for some reason VBoxManager was showing empty list. Thanks for this simple trick!
    – MichaelZ
    Commented Apr 14, 2015 at 13:25
3

try this: create a new machine(s), then just overwrite the new .xml file(s) with the old one(s), which you still have.

edit: if you check the 'machine folder date', it may give you a hint when the machines were created and you may trace the version from the changelog at virtualbox.org (it shows the release date of the various versions).

the machine data files are usually stored in subfolders with the machine name in %user folder%\application data\.virtualbox\machines

3
  • As I said in the question, creating new machines with the old drives didn't work for the windows client (the machine simply doesn't boot). Plus it will force me to fix a bunch of shortcuts and reset the configuration for shared folders and other stuff.
    – Malabarba
    Commented Dec 8, 2009 at 17:47
  • 1
    is this still the same version of VBox that you have been using to create the virtual machines or did you receive an update recently? uninstall VirtualBox (backup your XML and VDI files) and install VirtualBox again, preferably the original version (you find older versions at Filehippo if you need the installer).
    – Molly7244
    Commented Dec 8, 2009 at 18:43
  • Hm... Indeed, it's not the original version, maybe that's it. Unfortunately I also have no idea what the original version was.
    – Malabarba
    Commented Dec 9, 2009 at 3:49
1

I want to describe another scenario that I just discovered.

I just upgraded VirtualBox for my Windows 7 host (to version 4.3.12r93733), running the installer program from another directory (using cygwin terminal) and let the installer start VirtualBox for me. I got worried as I saw my VirtualBox virtual machines having disappeared. When choosing "machine | Add" from the menu, I saw that the directory was not my $HOME directory but the directory where I run the installer (cygwin home directory). VirtualBox also had created .VirtualBox directory there.

When I quit VirtualBox and run it from the start menu I saw all my virtual machine definitions appear like expected, just like described in ${HOME}/.VirtualBox/VirtualBox.xml.

It seems like VirtualBox expected current directory to be ${HOME} when it was started. (Or perhaps it is a feature to allow run independent set of VirtualBox instances.)

1

For @FooF

Cygwin changes the home directory for VirtualBox.

You can fix this by creating a link in your Cygwin home. The links can be created through Windows command shell. These commands should be run as administrator:

cd C:\Windows\system32
mklink C:\bin\cygwin\home\russellcardullo\.VirtualBox C:\Users\russellcardullo\.VirtualBox
mklink "C:\bin\cygwin\home\russellcardullo\VirtualBox VMs" "C:\Users\russellcardullo\VirtualBox VMs

Taken from http://russellcardullo.com/blog/2012/07/15/setting-up-chef-and-vagrant-on-windows-7-under-cygwin/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .