windowsvirtualboxarchlinuxsambavirtual-disk

vmdk (Normal, Inaccessible): having to repair invalid header too often


My situation

I am using Virtual Box to create a virtual machine with Arch Linux installed. I use the virtual machine for my own projects: I have all my projects data in this virtual machine so I easily can change from OS or physical computer and instantly have all data available. In this virtual machine, I have installed GitLab, a backup system, SMTP, and Samba, among others.

The virtual machine has two SATA virtual hard drives:

Whether I use my Ubuntu to work with the virtual machine, accessing my files from samba, everything is performing perfectly. The problem comes when I use Windows, after shutting down my machine properly (see bash command for this below) the odds are I get a vmdk header corrupted. Two out of three times I try to shutdown this problem appears in Windows, I didn't experienced the problem In Ubuntu yet.

This is the command I use for shutting down my Arch, safe_shutdown.sh:

systemctl stop smbd
umount /mnt/projects
systemctl poweroff

Forced to use the repairing tool too often

I've tried to shut down the machine from VirtualBox, to only use systemctl poweroff, to use ACPI shutdown, to close all processes from task manager, to disconnect samba mapped network drive before shutdown, ... everything. It all result in the same, having my a vmdk header corrupted and having to use the repairing tool:

vmware-vdiskmanager.exe -R projects.vmdk

This tool always says me that has found problems in the disk and all have been repaired. After this the machine works again without major problems, sometimes I find a corrupt file when hashing for consistency and I have to use my backups to restore those files.

Desesperation

I do not really know what to do now. Should I try to move my data to another virtual hard drive format? Resize my virtual hard drive? What logs should I look for?

My details

On Windows I use the 5.1.2 r108956 VirtualBox version.

Virtual Box error

Could not open them medium '[projects.vmdk]` VMDK: inconsistency between grain
table and backup grain table in '[projects.vmdk]' (VERR_VD_VMDK_INVALID_HEADER).

Virtual Box Logs

Since I always repair my machine just after getting the error because I need to use my data constantly I can not provide only the last log but all of them. I have uploaded them to a Google Drive folder: https://drive.google.com/drive/folders/0BzoIZrf3afiGRHo0Y2U5c19OdEE?usp=sharing

Samba Configuration

[projects]
   comment = projects folder
   path = /mnt/projects
   available = yes
   guest ok = no
   read only = no
   writable = yes
   valid users = archuser
   write list = archuser
   browseable = yes
   create mask = 0600
   directory mask = 0700
   public = yes

Solution

  • Try to use virtualbox 4.x.x version. Scan your drive for bad sectors with fsck and badsectors. You might have compatibility issues or a corrupted file system.