Page 1 of 1

VMs have disappeared

Posted: 14. Sep 2009, 11:11
by deizel
Hi guys,

Upon coming booting my machine (Windows XP Pro) this Monday morning, I opened Sun VirtualBox 3.0.4 to find out, to my dismay, that all four of my VMs have disappeared from the list on the left-hand side.

I found them on my host's hard disk, however I do not know how to restore them.

C:\Documents and Settings\{username}\.VirtualBox\
C:\Documents and Settings\{username}\.VirtualBox\VirtualBox.xml
C:\Documents and Settings\{username}\.VirtualBox\Machines\{vm-name}\
C:\Documents and Settings\{username}\.VirtualBox\Machines\{vm-name}\{vm-name}.xml
C:\Documents and Settings\{username}\.VirtualBox\Machines\{vm-name}\Snapshots\
C:\Documents and Settings\{username}\.VirtualBox\Machines\{vm-name}\Logs\
C:\Documents and Settings\{username}\.VirtualBox\HardDisks\{vm-name}.vdi

I have the hard drive (vdi) image for these (including the most important one), and I realize I can create a new VM which uses this hard drive, but this would put me back in time (a few months), as I have created snapshots since (latest last Thursday).

I can't seem to find any simple guides to restoring my VMs (snapshots included), so any help would be much appreciated.

All the files seem to be there, so I just need a way of reminding VirtualBox what it was pointing to last week, as it appears it has simply forgotten.

Many thanks in advance.

Re: VMs have disappeared

Posted: 14. Sep 2009, 11:19
by mpack
The VMs should be listed in the main VirtualBox.xml file. Have you looked at the contents? Even a not so recent backup of this file would be useful as a template, and perhaps any corruption is minor. Reconstituting a snapshot chain inside this xml is not for the faint hearted, but is possible with care.

Re: VMs have disappeared

Posted: 14. Sep 2009, 12:21
by deizel
Hi mpack,

Thanks for this. It seems that VirtualBox had created a new main VirtualBox.xml file at C:\.VirtualBox\VirtualBox.xml and was using this instead.

Initially, I tried going into the general VirtualBox settings and changing the default hard disk/machine folder paths to those in the Documents and Settings directory, and restarting VirtualBox.. This didn't seem to have any effect.

I then thought about deleting all the C:\.VirtualBox directories, so that it would have to use the Documents and Settings ones.. however, at that point I read your reply.

I managed to fix the issue by copying the contents of C:\Documents and Settings\{username}\.VirtualBox\VirtualBox.xml to C:\.VirtualBox\VirtualBox.xml, and changing any relative paths to absolute ones.

I am not sure why this happened. The only thing I can link it to was some network issues that we had last week when VirtualBox was running. When the network went down, this might have caused VirtualBox to forget which user was logged in, and create files in the root of the C: drive.

*shrug*

Thanks again!

Re: VMs have disappeared

Posted: 14. Sep 2009, 12:39
by Sasquatch
Another option is that somehow, the system (or user) environmental variable VBOX_USER_HOME got set, pointing to C:\, instead of your user profile.

Re: VMs have disappeared

Posted: 14. Sep 2009, 15:59
by deizel
Thanks for the suggestion Sasquatch, it seems there only exists one system or user variable for VirtualBox and that is this system variable:

VBOX_INSTALL_PATH=C:\Program Files\Sun\xVM VirtualBox\

I guess it is possible that somehow the VBOX_USER_HOME user variable has been removed, maybe by a network policy change which ran at login, but I can neither confirm nor deny the previous existance of such a variable.

I am happy to have it working for the time being, and this thread should act as a good reference should anyone have a similar problem.

Cheers.

Re: VMs have disappeared

Posted: 14. Sep 2009, 17:09
by Sasquatch
By default, the variable isn't on your system. You have to specifically create it and give it a value.