Windows 7 Guest -- "VERR_VD_VDI_INVALID_HEADER" Every 2-3 days

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
DigiHawk
Posts: 5
Joined: 25. Apr 2018, 15:37

Windows 7 Guest -- "VERR_VD_VDI_INVALID_HEADER" Every 2-3 days

Post by DigiHawk »

Hi @cableghost2, I am having a similar problem to yours. Running a windows guest on a macOS high sierra host.

I get the "VERR_VD_VDI_INVALID_HEADER" error once every 1-3 days. I saved the first ~ 1.9 KB from the vdi (when functioning correctly), and if I copy this into the vdi when it breaks, I can boot.

For you, it turned out that your host hard drive had issues? Any updates since you replaced the hard drive?
DigiHawk
Posts: 5
Joined: 25. Apr 2018, 15:37

Windows 7 Guest -- "VERR_VD_VDI_INVALID_HEADER" Every 2-3 days

Post by DigiHawk »

I get the error message "VERR_VD_VDI_INVALID_HEADER" on my windows 7 VM every 2-3 days. I'm running on a mid-2015 MacBook Pro running High Sierra (10.13.4)

I looked at a thread with a similar issue to mine. I can't post links, but google "VERR_VD_VDI_INVALID_HEADER" and it's the first thread.
[Mod edit: the OP's post in [Solved] VERR_VD_VDI_INVALID_HEADER... :-/ has been merged with the OP's other message, it's the first post in *this* thread].

Using the info there, I can briefly patch the issue by:
1. Saving the first 1.9 KB from the .vdi when functioning.
2. Replacing the first 1.9 KB from the broken .vdi with that

Then, the VM will boot the .vdi again. Eventually, within a day or two, the problem comes back.

From the other link, I see that @mpack says:
"Nothing in VirtualBox causes it, I can tell you that much - because if it was otherwise then everyone would have the problem, and in my 10 years on here you are the first to report a recurrent VDI corruption problem. There must be some problem on your host, or you aren't restoring the actual VDI which has the actual problem.

In every other reported case there has been some underlying event that caused widespread problems, for example suffering a power loss while software (including the VM) was running. Or a memory error such as the OP reported."
So, I want to do some diagnosis on my MacBook's hard drive itself. I tried running Disk Utility / First Aid, and everything seems ok. Last few lines:
Verifying allocated space.
The volume /dev/rdisk1s1 appears to be OK.
File system check exit code is 0.
Restoring the original state found as mounted.
Operation successful.
Anything else I can check to get to the bottom of this?
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Windows 7 Guest -- "VERR_VD_VDI_INVALID_HEADER" Every 2-3 days

Post by socratis »

DigiHawk wrote:I'm running on a mid-2015 MacBook Pro running High Sierra (10.13.4)
I'd like to ask some more details:
  • What's your Mac model? For example I have a "MacBookPro11,5" as seen from the System Information.app.
  • Are you using an SSD or a traditional rotational HD?
  • Has the update to 10.13 modified your filesystem to APFS, or is it still HFS+?
  • For how long has this been happening?
PS. I merged your two messages. According to the forum rules, duplicate posts are not allowed. It's not good etiquette...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Windows 7 Guest -- "VERR_VD_VDI_INVALID_HEADER" Every 2-3 days

Post by mpack »

It's very odd for anything to happen randomly on a computer. Computers don't do random, though they can pretend sometimes.

I wonder if it's a race condition. In this scenario some other application has the file already open when VirtualBox tries to access it. This shouldn't happen since only VirtualBox should be opening VirtualBox files. Is there any kind of non-Apple background backup task going on? (non-Apple: because if it was Apple, a lot more people would see the problem).

The previous report was on a Windows host and was apparantly caused by a disk drive on its last legs, yours may be that or the conflicting software idea. Either way, not systemic to VirtualBox.

p.s. Filesystem checks don't detect bad sectors.
DigiHawk
Posts: 5
Joined: 25. Apr 2018, 15:37

Re: Windows 7 Guest -- "VERR_VD_VDI_INVALID_HEADER" Every 2-3 days

Post by DigiHawk »

Socratis,
socratis wrote:What's your Mac model? For example I have a "MacBookPro11,5" as seen from the System Information.app.
Are you using an SSD or a traditional rotational HD?
Has the update to 10.13 modified your filesystem to APFS, or is it still HFS+?
For how long has this been happening?
  • Model Identifier: MacBookPro11,4
  • SSD
  • Format: APFS
  • Been happening for about 2 weeks. Before that, I would see intermittent crashes on the guest, including Blue Screens of Death
And sorry about the duplicate post -- wasn't sure it applied since it was in the Windows host forum. Won't happen again!

@mpack -- regarding:
mpack wrote:Is there any kind of non-Apple background backup task going on? (non-Apple: because if it was Apple, a lot more people would see the problem).
I only have time-machine backups. Further, I backup at home, and I mostly see the problem arise at work.. Although that may not be completely true -- I use the VM 99% at work, so I wouldn't necessarily notice if it broke while I was at home. It's happened often that I'll work inside the VM (at work, where I'm not backing up), finish, close the VM..a few hours later (still at work) go to open it, and get the "vdi: inaccesible" message with the same VERR_VD_VDI_INVALID_HEADER error code.

What steps would you recommend to detect bad sectors?
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Windows 7 Guest -- "VERR_VD_VDI_INVALID_HEADER" Every 2-3 days

Post by socratis »

DigiHawk wrote:And sorry about the duplicate post -- wasn't sure it applied since it was in the Windows host forum. Won't happen again!
Don't sweat it! That's why we're here... ;)

It seems that we have the same exactly Mac (minus the CPU freq. and my extra AMD GPU). So, the hardware should be out of the question in my mind.

Same thing I believe for the backup. I've never heard of a problem regarding concurrent access and TimeMachine, but I may have missed an edge case. I use TimeMachine for the last 15 years (yes, since the very 1st generation TimeCapsule) and I've never had a single issue, even of the smallest kind. And yes, I've tried the restore, twice after two catastrophic events (Macs died).

My biggest suspect at this point is APFS. Actually, it has always been APFS. This is a brand new filesystem, that they had to really rush out the door with 10.13. There were a lot of horror stories, with people losing everything (including the kitchen sink) during the betas. I'm not 100% confident about it.

On the other hand, the majority of OSX users are on 10.13.x (usually x=4). We would have heard something by now, given the amount of users that are using VirtualBox on OSX.

Is backup the only 3rd party software that you have? Actually even that is not 3rd party software, just like mpack mentioned. Any antivirus, any active debuggers, any system modifying software? Anything?
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Windows 7 Guest -- "VERR_VD_VDI_INVALID_HEADER" Every 2-3 days

Post by mpack »

DigiHawk wrote:What steps would you recommend to detect bad sectors?
The only way to detect a bad sector is to write something to the sector then read it back, i.e. a thorough disk scan as opposed to a check of filesystem consistency.

However VDI files should not be moving around the disk (I assume Macs don't have background disk defragmenters?), so only one or two sectors should be in play, so I'm not sure that a bad sector would account for this.

What is the hard disk tech? I.e. magnetic or SSD?
DigiHawk
Posts: 5
Joined: 25. Apr 2018, 15:37

Re: Windows 7 Guest -- "VERR_VD_VDI_INVALID_HEADER" Every 2-3 days

Post by DigiHawk »

socratis wrote:Is backup the only 3rd party software that you have? Actually even that is not 3rd party software, just like mpack mentioned. Any antivirus, any active debuggers, any system modifying software? Anything?
No antivirus.. No active debuggers... No system modifying software (that I know of).
mpack wrote:What is the hard disk tech? I.e. magnetic or SSD?
SSD. From System Report:
Physical Drive:
Device Name: APPLE SSD SM0256G
Media Name: AppleAPFSMedia
Medium Type: SSD
Protocol: PCI
Internal: Yes
Partition Map Type: Unknown
S.M.A.R.T. Status: Verified

Note, the failure happened again just now... Any log files (or equivalent) you'd like me to add here, before I patch and get the VM back running?
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Windows 7 Guest -- "VERR_VD_VDI_INVALID_HEADER" Every 2-3 days

Post by socratis »

mpack wrote:I assume Macs don't have background disk defragmenters?
Well, there is this thing called Hot File Clustering, where when idle, OSX would defragment large files mainly. But not for an SSD which the OP has:
DigiHawk wrote: • SSD
• Format: APFS
DigiHawk, when you get in such an error condition next time, look at the output of "dmesg" from the Terminal.app. Or use "Console.app" and look at the "All messages" log. There's a *lot* of information there, so use the filter to look for "error", "fail", "warning", "disk", and so on.

If you are *not* logged in as the Administrator (owner), but as a simple user, you could do the following:
  • you$ su <Administrator>
    admin$ /Applications/Utilities/Console.app/Contents/MacOS/Console
Finally, try to start the Mac in single-user mode (Cmd+S after the startup sound) and run:
  • fsck -fy
For a more detailed description: How to Repair a Mac Disk with fsck from Single User Mode.

It really feels like something is wrong with your SSD. AFAIK, VDI header corruption has only been seen in such cases only...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
DigiHawk
Posts: 5
Joined: 25. Apr 2018, 15:37

Re: Windows 7 Guest -- "VERR_VD_VDI_INVALID_HEADER" Every 2-3 days

Post by DigiHawk »

Thanks Socratis, I tried the fsck repair you mentioned last night. I'll keep an eye on the drive today.

I'm in a support chat right now with Apple and their last message was:
"OK so the APFS is what is causing this to happen. Let me see what we can figure out for this."

I'll keep posted here, as if it is an AFPS issue, I'm sure others will run into this soon.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Windows 7 Guest -- "VERR_VD_VDI_INVALID_HEADER" Every 2-3 days

Post by socratis »

Great, thanks for the update DigiHawk...
My first hunch was APFS. That's both good news and bad news. Good in the sense that it isn't VirtualBox's fault, bad in the sense that these &^*&#$ at Apple didn't do a good job of testing APFS and they shipped a half-baked solution. And not only that, they forced it down on everyone's throat!

On an APFS related note, you can't install an OSX guest (on a Mac of course), if you indicate that your HD is an SSD one (in the VM settings). Because if Apple sees an SSD, it immediately, and without even asking you, converts the partition after the installation to an APFS one, something that VirtualBox can't boot from! Oh, the joy of discovering hidden treasures...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply