Raw disk changed data does not persist. Snapshots?

Discussions related to using VirtualBox on Linux hosts.
Post Reply
zmxncbv
Posts: 2
Joined: 4. Jan 2010, 00:36
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows

Raw disk changed data does not persist. Snapshots?

Post by zmxncbv »

I have an esata disk formatted as NTFS I use as data storage for my Windows virtual machines. I set up a Virtualbox raw vmdk and successfully used the disk in a Windows 7 vm. I added files, renamed some directories, etc. The data all persisted through several power cycles of the Windows 7 vm. However, when I loaded that disk through a different XP VM, all the changed data was gone. Even the renames were reverted.

I do notice I have a 116GB snapshot vmdk for the Win7 vm. Does Virtualbox snapshot raw disks? If so, is there a way to disable snapshoting of all but the boot disk?
MarkCranness
Volunteer
Posts: 875
Joined: 10. Oct 2009, 06:27
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows Server 2008 R2; Ubuntu 11.04; Windows 2000 Server; Windows XP

Re: Raw disk changed data does not persist. Snapshots?

Post by MarkCranness »

zmxncbv wrote:Does Virtualbox snapshot raw disks?
Yes.
zmxncbv wrote:If so, is there a way to disable snapshoting of all but the boot disk?
Yes, but you will have to Delete/merge all snapshots taken after you added the eSATA disk before you can disable it.
You set the eSATA vmdk file to 'Writethrough' (and any other VDI you don't want snapshots to affect).

Find which snapshot has the actual raw vmdk (it might be the very first snapshot):
File>Virtual Media Manage...>Select your vmdk file and note the 'Attached to:' value at the bottom.
The part in () brackets is the snapshot that has the raw vmdk. Snapshots made AFTER that have {hexUUID}.vmdk files instead.

Starting at that snapshot, select it and 'Delete Snapshot'. This will merge all changes made after the snapshot was taken into the base raw vmdk partition. Repeat on all child snapshots until Virtual Media Manager says that your base vmdk file is attached to the main VM name (with NO (snapshot) in brackets afterwards). Do not be alarmed if it says: 'Deleteing (your vmdk file)'. It is not deleteing it, it is updating it (3.0.x had that scary message, I'm not sure if 3.1.x still does).
(For VB 3.0.x, use 'Discard Snaphot'. DO NOT ever use 'Discard Snapshot and Current State'.)

Detach the vmdk from the VM (Settings>Storage>Select vmdk file in storage tree>Disk - icon 'Remove Attachment' at buttom>OK)
(For VB 3.0.x I'm not sure of the exact sequence.)

Mark the vmdk file as 'Writethrough' (See section 5.4.2 of the user manual).

Code: Select all

VBoxManage modifyhd "<blah.vdi>" --type writethrough
Reattach to your VM.
Post Reply