VirtualBox

Ticket #8408 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

VHD corruption when taking snapshots => Fixed in SVN

Reported by: AaronCurley Owned by:
Priority: major Component: virtual disk
Version: VirtualBox 4.0.4 Keywords: VHD snapshot corruption
Cc: Guest type: other
Host type: Windows

Description (last modified by frank) (diff)

My config

Virtualbox 4.0.4

Windows 7 x64 Gold Ultimate (fully patched, excluding SP1)

Dell XPS 1640

Summary

Taking a snapshot when the disks are of VHD format can corrupt the data on the disk.

Affects:

Hosts: Windows 7 x64 (others unknown)

Guests: All?

Try the following

vboxmanage createhd --filename "C:\Virtual Machines"\bugtest.vhd --size 1024 --format vhd

New VM (in the GUI)

Name: BugTest

OS: Ubuntu Linux

RAM: 512 MB

Select VHD (I placed the VHD file in the same folder as the virtual machine xml file).

Reconfigure VM:

Storage config:

SATA controller

hard drive

cdrom drive

Start VM

Insert "Ubuntu desktop 10.04 x86 desktop"

Boot ubuntu CD and switch to root console (ctrl-alt-f1; sudo -i)

Use parted to create a single primary partition & format with fat32.

mount /dev/sda1 /mnt

echo root > /mnt/root.txt

shutdown (use the GUI if you're booting that particular ISO)

take new snapshot "root"

power on, boot, console, sudo, mount

cat /mnt/root.txt (successful)

echo child1 > /mnt/child1.txt

shutdown (use the GUI if you're booting that particular ISO)

<here, you might want to boot + mount again just to make sure the file did get "written"...don't know why I had trouble with this>

take new snapshot "child1"

power on, boot, console, sudo, mount

cat /mnt/child1.txt (file is missing)

You can get the file back by rolling back to "child1", deleting "child1", and powering on.

Comments

Restoring my (now corrupt) hard disks from backup. I know VHD is not that common a format, but still...very obvious corruption of data. Back to VirtualBox 3 a second time.

Other Thoughts

While we're at it, can we fix the format of the differencing VHDs so they mount correctly in Windows 7? Currently, only base disk VHDs created by VirtualBox will mount correctly via disk management. I like the ability to natively mount in Windows, which is why I've used VHD in the past. (Who knows, might be a Microsoft format limitation rather than VirtualBox.)

Hope this helps!

Aaron Curley

Change History

comment:1 Changed 3 years ago by frank

  • Description modified (diff)
  • Summary changed from VHD corruption when taking snapshots to VHD corruption when taking snapshots => Fixed in SVN

Thanks for the report! This bug will be fixed in the next maintenance release. A workaround is to enable the host I/O cache for the controller where the VHD image is attached.

comment:2 Changed 3 years ago by frank

  • Status changed from new to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use