.vbox file seemingly is deleted at will

Discussions related to using VirtualBox on Windows hosts.
Post Reply
PwnusMaximus
Posts: 2
Joined: 8. Dec 2015, 23:54

.vbox file seemingly is deleted at will

Post by PwnusMaximus »

Virtual box host: Windows 7 64-bit
Virtual box clients: Windows 7 64-bit
Version: 5.0.8

Seemingly at random users will report that their virtual machines are "inaccessible". Upon inspection the .VBOX config file appears to be missing.
 Edit: However the .vbox-tmp and .vbox-prev are still present 
The error code is -102 (file not found) And I get a little red circle with white horizontal line and the word Inaccessible underneath the Virtual Machine listing in the virtual-box manager applicaiton. A work around solution is to simply "create a new machine" and point to the virtual hard-drive .VDI then virtualbox will re-create .vbox file and I just have to re-configure it's ram and everything else.
 Edit: I've since learned that this is the WRONG way to go about this, please ignore this 'solution' 
. Or alternatively I could dive into our machines backup file from the day before and restore that single file.

Has anyone else experienced this? Any pointers?
Last edited by PwnusMaximus on 10. Dec 2015, 17:21, edited 1 time in total.
Martin
Volunteer
Posts: 2561
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: .vbox file seemingly is deleted at will

Post by Martin »

Have a look if the .vbox-prev file still exists which is the "previous" version of the .vbox file.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: .vbox file seemingly is deleted at will

Post by mpack »

These are the steps that VirtualBox takes when it writes a new Vbox file. Each step is contingent on the last one being completed without errors.
  1. Write a temporary file with ".vbox-tmp" extension.
  2. Delete any existing ".vbox-prev" file.
  3. Rename existing ".vbox" file to ".vbox-prev".
  4. Rename ".vbox-tmp" to ".vbox".
If anything goes wrong with this sequence you are left with the ".vbox-tmp" file. So to recover: if there's a "vbox-tmp" file in the folder then rename that first. If that doesn't work you can use the "vbox-prev" local backup. A copy from yesterdays daily backup is normally just as good.

NOTE: You should stop recreating the VM from the VDI, which actually doesn't recreate the VM. What it actually does is create a new PC with different motherboard and MAC signatures even though it has the same disk content, which will affect activation and licensing of software, and the booting of some Linux grub scripts, it will also destroy the management information for snapshots, encyryption and bridged networking - some of these losses would be catastrophic.
PwnusMaximus
Posts: 2
Joined: 8. Dec 2015, 23:54

Re: .vbox file seemingly is deleted at will

Post by PwnusMaximus »

You are both correct about the .vbox-tmp file being left alone. Changing the extension works brilliantly, i must not have had my reading glasses on because I didn't notice at first. I'll also stop 're-creating' the .vbox file the way I was.

Is it possible/likely that someone force-quitting the virtual box software rather than a clean shutdown could cause the .vbox file to fail to rename the .vbox-tmp to .vbox? That is something I'm sure some of our users are doing.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: .vbox file seemingly is deleted at will

Post by mpack »

If "force quitting" means closing the process using Task Manager, then yes, that would be a prime candidate.
MikeMPet
Posts: 1
Joined: 30. Mar 2020, 19:44

Re: .vbox file seemingly is deleted at will

Post by MikeMPet »

I had a VM with a missing .vbox file recently as well (runtime error reading: -102 file not found). I created a new one using the resident .vbox.prev file. This fixed the issue.
Post Reply