VirtualBox

Opened 12 years ago

Last modified 7 years ago

#10851 new defect

VM config file lost after host power off

Reported by: Technologov Owned by:
Component: other Version: VirtualBox 4.1.20
Keywords: Cc:
Guest type: other Host type: Windows

Description

VBox: 4.1.16 (and 4.1.20)

Host: Windows 7 x64 (and other Windows)

When shutting down host, (after Windows update, or sudden power off) in some cases VBox does delete the *.vbox meta-data file, and the VM becomes "inaccessible" state. In some cases the file becomes corrupted and zero-bytes, and there are no *.vbox-tmp and no *.vbox-prev files to recover from.

Workaround: copy [VM].vbox-tmp or [VM].vbox-prev as [VM].vbox can restore the VM in most cases. (something new users can't do)

Recommended real fix: VBoxSVC must write down a history of transactions into the VM folder, per VM, [VM].vbox-transactions file, which should list all changes to the *.vbox file meta-data in a patch/diff format, and then, when VM becomes "inaccessible", VBoxSVC must attempt to recover the file until last transaction automatically, plus will allow manual recover and debug.

NOTE: This bug is an old one, and AFAIK happens once every several weeks since v4.0.0 (but rarely) - still losing VM is *really* bad.

Log attached.

-Technologov, 2012-08-22.

Attachments (3)

Win7-64bit-2012-08-22-03-29-27.log (59.7 KB ) - added by Technologov 12 years ago.
VBox log
daniel-winx64-apr-12-2013-VBox.log (49.6 KB ) - added by Daniel Sokolowski 12 years ago.
jeffL35-VBox.log (88.3 KB ) - added by jeffL35 9 years ago.
Log before system crashed

Download all attachments as: .zip

Change History (26)

by Technologov, 12 years ago

VBox log

comment:1 by Frank Mehnert, 12 years ago

Please be more specific. You write that the .vbox file was lost and that no .vbox-prev nor .vbox-tmp files are available for recovering. In the next paragraph you write that the user could use a .vbox-tmp or .vbox-prev file to recover the VM config. What is true?

comment:2 by Frank Mehnert, 12 years ago

Summary: [BLOCKER] Metadata Corruption after host power off = Lost VMVM config file lost after host power off

comment:3 by Technologov, 12 years ago

frank: Both are true.

  1. In some cases the user can recover from either .vbox-tmp or from .vbox-prev, but in other cases those files do not exist, which means no possibility to recover.
  1. In some cases *.vbox file gets deleted altogether, but in other cases I had this file zeroed.
  1. This bug is hard to reproduce, but I have it pop-up about once a month. It seems to affect versions 4.0.0-4.2.4 (latest), all v4.x series.

And today, Dominique Bazin, our user, experienced a similar data wipe-out on VBox 4.2.4.

-Technologov, 19.Nov.2012.

comment:4 by Klaus Espenlaub, 12 years ago

The symptom descriptions are very strange... VirtualBox does not keep the VM config file open when the VM is running, so I wouldn't understand why file contents of rarely changing files would magically disappear due to a host crash. They should end up on the hard disk very very quickly.

There must be something else to it - do you run out of disk space or is there a problem with the hard disk itself? Because if that's the case we can spend any time we want on complex transaction logic and it won't help at all. So I want to have an idea first what's going on, and that's so far very very blurry.

Any recent snapshot operations (creating/deleting or something unusual like cancelling snapshot creation)?

comment:5 by Technologov, 12 years ago

No. No. No. I use 3x2 TB HDDs, (no RAID) and have several hundreds of gigs free space. There is no problem with hard disk.

Yes: few recents operations: changing VM settings (minor changes, like "shared folders", etc...), creating a snapshot, reverting to old snapshot. Not deleting and not cancelling snapshot operation was performed.

UPDATE: Just happened again to me. Host: Win7 x64 + VBox 4.1.22. The *.vbox file was deleted, but thankfully *.vbox-temp existed, so I manually recovered the VM.

-Technologov, 21.Nov.2012.

Last edited 12 years ago by Technologov (previous) (diff)

by Daniel Sokolowski, 12 years ago

comment:6 by Daniel Sokolowski, 12 years ago

My host machine restarted unexpectedly and I was effected by this issue as well on Win 7 x64 - VBox 4.2.6. No recent changes to the VM Settings (months since it was setup) Renaming the *.vbox-tmp to .vbox did work.

Attached is the last working log file from yesterday.

comment:7 by patrik.thunstrom, 11 years ago

Same thing happened here, running 4.2.12r84980.

Computer did a hang, had to force power off. Now when I've started up VirtualBox, all three of the VMs listed in my VirtualBox Manager states "Inaccessible" due to -102, file not found (and one of them -103, path not found).

Looking at the folders, it is indeed true, the files does not exist any more. For two of them the .vbox files are missing (they all had .vbox.prev though), and for the third which was created as a clone of one of the other two (may or may not be related to this being more "severe") the entire folder for the VM is missing, .vdi, .vbox & everything.

I'm really not even remotely able to write this down to being a bad disk, seeing that nothing else than the .vbox files are missing. (Scratch this, next morning computer wants to restart to scan bad drive which gets stuck at 40%)

What makes it even more likely to be some bad operation in the Manager is that I had 3 VMs listed in it, all of those gone missing, but in my virtual-images base folder where I kept all my folder structures for the VMs, I had 4 VMs stored. The one not listed in the VirtualBox Manager is the only one still having its .vbox file.

Seeing as the only one I had run lately was the one where the whole folder did get deleted, none of the logs I have gives any relevant information (as they hadn't even been powered on the last few weeks before things were deleted).

(Edit; Host - Win 8, x64. Guest - Win 7, x64)

(Edit 2: Computer now shows other signs of bad drive)

Last edited 11 years ago by patrik.thunstrom (previous) (diff)

comment:8 by mandric, 11 years ago

Any updates on a fix here? We've had it reported from customers twice and had to talk them through the rename process. From end user perspective it appears the whole VM is lost.

comment:9 by Frank Mehnert, 11 years ago

Are only Windows hosts affected by this problem?

comment:10 by thomerow, 10 years ago

Any updates on this? The same thing just happened to me after I shut down the host while VirtualBox was saving the machine state and got stuck at 100% for several hours. OS is Windows 7 64bit.

comment:11 by tchung, 10 years ago

I ran into this problem just now. Windows host was rebooted unexpectedly, caused by automatic reboot from windows update. After it came back up, the .vbox file was gone, but .vbox-tmp and .vbox-prev existed so I could recover the file.

Running VirtualBox 4.3.20 r96997 on Windows 7 64bit

comment:12 by Bright, 9 years ago

I just got this issue too: after Windows reboot incidentally, vbox file was gone.

I had two VMs, one was Windows 2012, 64bit and the other was Ubuntu 14, 64bit. The host is Win 7, 64bit. The interesting thing was, the Windows vbox file was gone but the Ubuntu one was still there.

I was shocked by what had happened as it was not easy to build up a VM with all components installed. Fortunately, by following the instructions mentioned above, I could add and start up the Windows VM again after copied the existing .vbox-temp file and renamed it to .vbox.

comment:13 by jeffL35, 9 years ago

The same thing just happened a day before. My Windows host hanged, and I had to power it off forcefully. The .vbox file was lost, but the .vbox-prev file was still there, so my VM was not completely lost. The .vbox file seemed to be corrupted, for opening in Notepad++ was unsuccessful. The file could not be deleted, and it would not go away when refreshing the folder in Windows Explorer. A reboot got rid of the broken .vbox file. I renamed the .vbox-prev file to a .vbox file, and everything was fine again. Version: Virtualbox 5.0.0 r101573 downloaded from Virtualbox.org Host: Windows 7 Guest: Ubuntu 15.04

by jeffL35, 9 years ago

Attachment: jeffL35-VBox.log added

Log before system crashed

comment:14 by mslade, 9 years ago

I encountered this myself after rebooting this morning. This is VirtualBox 5.0.4 r102546 on Windows 7 64bit. I will add that my machine has BitLocker installed and running. I have no reason to believe BitLocker is related to the issue, but I know it does some voodoo on the hard drive and am curious if others effected are also using BitLocker or similar.

My host requested a reboot for patching and at the time the VM was running in headless mode. The host seemed to hang for a long time after all windows were closed but before actually rebooting; not sure if that's related or not.

After rebooting the host would not start due to missing .vbox file, although both .vbox-prev and .vbox-tmp are available.

comment:15 by Hale, 9 years ago

I have the same problem on our server with regularity of a week. It is especially boring when it happens on Saturday and people are calling my home to take me from my family.

WTF is going on!? This critical problem is 3 years old and still not solved! I am beginning to suspect that other Oracle products and activities can share the same irresponsibility in management.

comment:16 by dzmitry.lahoda, 8 years ago

I have same problem. I use Windows 7 host and Windows 10 guest. Both 64 bit. Used several version of VBox starting from 4.x to 5.x. Do not recall what exactly. I have Intel i7 of 3rd generation and 16GB ram, VM and host are on same Samsung 850 Pro SSD.

Got Windows 10 host on new hardware and latest VBox of today. Yet to see if there is error.

comment:17 by Socratis, 8 years ago

I hadn't seen this ticket and about 2 1/2 years ago (2014/03) I added a request for an enhancement, #12838. I don't know if these two could be ... merged? They seem to be complementary and pretty much #12838 seems to be a "workaround" for #10851.

comment:18 by Michael Thayer, 8 years ago

Description from ticket #12838:

There are several cases where either by accident or by error one of the VirtualBox.xml or VM.vbox becomes corrupted, usually at 0 bytes. Since there is a .xml-prev and a .vbox-prev, should a suggestion to restore the previous versions be added?

  • Check if the file in question size is zero.
  • Check if file-prev exists (and passes some checks?).
  • Inform the user and suggest to restore the previous version.

comment:19 by ChaosFreak, 8 years ago

I can confirm that I experienced this same bug just now. However, I did have my -tmp and -prev files so I was able to easily recover.

comment:20 by J_Random_Hacker, 7 years ago

I just experienced the same thing (missing .vbox file, able to recover by copying either the .vbox-temp or .vbox-prev files to .vbox). Linux guest on a Windows 7 64-bit host, and probably the VM was shut down abruptly due to the laptop's battery running out.

OT: To write the above 3 lines, Oracle made me sign up (OK, reasonable), which required giving my work address and phone numbers (is that really necessary?) and then pick a "nickname" -- which sent the browser into a redirect loop (grrrrrr....)

comment:21 by oldingn, 7 years ago

I just experienced the same thing (missing .vbox file, able to recover by copying either the .vbox-temp or .vbox-prev files to .vbox), fwiw.

VirtualBox 5.1.14 on CentOS 7 VM under Windows 10.

comment:22 by Klaus Espenlaub, 7 years ago

Host type: otherWindows

Since no one ever said that this happens on anything but Windows host, I'm adjusting this in the ticket. BTW, we tried to fix this issue several times, but clearly without luck. The problem is that we were never able to reproduce. And it's not that we're not able to crash a Windows system :)

comment:23 by quatum, 7 years ago

The issue happened to my virtually running CentOS 7 within my Windows 7 x64 machine. Additionally to a 0kB (empty) *.vbox and *.vbox-prev the logfiles VBox.log and VBoxHardenig.log with the corresponding time flags have 0kB. VB-Version 5.2.6 r120293 (Qt5.6.2)

Note: See TracTickets for help on using tickets.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette