Page 1 of 1
[Solved] Attached VMDK hard disk -> Snapshot is growing and system is crashing
Posted: 26. Jun 2020, 15:58
by lakk
hello virtual-box community,
i ve got the following situation:
i am running virtual-box (6.0.10) on debian (9.9) - where i have installed "FOG" (fogproject) on a virtual machine (also Debian, 10).
the installation of the "FOG"-server on the virtual machine was done as a lvm-partition (sda).
after that i have add an extra hdd (sdb) as VMDK and did mount it as /image in the "FOG-SERVER", where i want to store the backups.
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 45G 0 disk
-> VDI, "FOG-SERVER"
├─sda1 8:1 0 953M 0 part /boot
├─sda2 8:2 0 1K 0 part
└─sda5 8:5 0 44.1G 0 part
├─vg0-base 254:0 0 18.6G 0 lvm /
├─vg0-swap 254:1 0 3.7G 0 lvm [SWAP]
├─vg0-opt 254:2 0 18.6G 0 lvm /opt
└─vg0-images 254:3 0 3.1G 0 lvm
sdb 8:16 0 1.4T 0 disk
-> VMDK
└─sdb1 8:17 0 1.4T 0 part /images
my problem is now:
when i start a clone/backup process in FOG, the backup-files are not being stored only on the VMKD-hdd (sdb, /images) but also
in a SNAPSHOT (1:1) and my main-system is running out of space and crashing.
when i click on the VMDK-image in the "virtual media manager", a info is popping up and saying that it is attached to a SNAPSHOT - which is growing when i start a backup.
what did i miss?
my plan was to setup the FOG-SERVER on a lvm-partition and than add an extra big hdd for the backups.
so it should be easy in future to change the backup-hdd, and keep the fog-system.
its the first time that i use virtualbox and do not have any experience with virtual machines

I am grateful for any help - as i could not find any information to this issue.
greetings lakk
Re: Attached VMDK hard disk -> Snapshot is growing and system is crashing
Posted: 26. Jun 2020, 19:46
by scottgus1
Right-click the guest in the main Virtualbox window's guest list, choose Show in File Manager. Zip the guest's .vbox file, and post the zip file, using the forum's Upload Attachment tab.
Snapshots of existing disks go in the Snapshots folder in the guest folder, where the .vbox file is located. This appears to be why your guest is putting data that should be in the VMDK in the main drive instead.
I would not use snapshots in your particular setup. If you need 'versioning' of your guest, just back up the guest folder with all the files in it, as well as any disk files that are outside the guest folder. (If the backup VMDK is just for in-the-guest backups, you shouldn't have to include it in 'version' backups, though you should have some backup of it if you would not wish to lose it through a host disk crash.) This kind of backup works best when the disk file is in the guest folder along with the .vbox file. You could also make copies of the guest folder and rename them. To switch to a different 'version', log out and back in so no Virtualbox processes are running, then switch names on the copies of the guest folder so the desired version is named by the guest's usual name. Virtualbox will pull up that folder when the main Virtualbox window starts.
Re: Attached VMDK hard disk -> Snapshot is growing and system is crashing
Posted: 29. Jun 2020, 10:55
by lakk
hello scottgus1,
thank you for your help
Snapshots of existing disks go in the Snapshots folder in the guest folder, where the .vbox file is located. This appears to be why your guest is putting data that should be in the VMDK in the main drive instead.
strange, but i did not think that VirtualBox is also doing snapshots of the
extra VMDK disk.
so of course, if VirtualBox doing snapshots of the whole system, this is why the snapshot is growing.
I would not use snapshots in your particular setup. If you need 'versioning' of your guest, just back up the guest folder with all the files in it, as well as any disk files that are outside the guest folder.
i have finished the installation-setup of the guest system. so i could use this method to create backups.
how can i disable "snapshots"?
If the backup VMDK is just for in-the-guest backups, you shouldn't have to include it in 'version' backups, though you should have some backup of it if you would not wish to lose it through a host disk crash.)
only backups of another machines are being stored here ("images"). so no versioning is needed.
where /how can i set the option not to version some HDDs?
would it be possible - generally - to have this setup:
sda, "FOG-SERVER", VDI ->
"versioning" is ON
sdb, "FOG-STORAGE", VMDK, ->
"versioning" is OFF
This kind of backup works best when the disk file is in the guest folder along with the .vbox file.
disk file -> so in this case the .vmdk file for "FOG-STORAGE":
FOG-STORAGE-1.vmdk, "# Disk DescriptorFile"
i have uploaded the guest's .vbox file and a screenshot of how to backup the guest-system.
Re: Attached VMDK hard disk -> Snapshot is growing and system is crashing
Posted: 29. Jun 2020, 16:49
by scottgus1
It seems the vmdk disk is using a snapshot, but the guest itself does not have a snapshot.
Here are the disk file UUIDs your guest has loaded:
<StorageController name="SATA" type="AHCI" PortCount="2" useHostIOCache="false" Bootable="true" IDE0MasterEmulationPort="0" IDE0SlaveEmulationPort="1" IDE1MasterEmulationPort="2" IDE1SlaveEmulationPort="3">
<AttachedDevice type="HardDisk" hotpluggable="false" port="0" device="0">
<Image uuid="{12dcb922-6060-4caa-bc68-02c1206c9ced}"/>
</AttachedDevice>
<AttachedDevice type="HardDisk" hotpluggable="false" port="1" device="0">
<Image uuid="{e485580a-523f-4efc-911a-dbd291803814}"/>
</AttachedDevice>
</StorageController>
The first hard disk (colored blue, UUID {12dc... on SATA port 0) is the main disk for your guest. It has no snapshots and is in the guest root folder with the guest .vbox file. Its location is perfect.
The second hard disk (colored red, UUID {e485... on SATA port 1) is the vmdk snapshot disk. It is located in the Snapshots folder within the guest folder. This disk file is the one receiving your backups and filling up your host's main disk.
This is a list of the disks that have been connected to you guest from the beginning up to now:
<HardDisks>
<HardDisk uuid="{f364d123-3249-476a-b8f0-39720f314639}" location="/home/lakk/VirtualBox VMs/FOG-STORAGE-1/FOG-STORAGE-1.vmdk" format="VMDK" type="Normal">
<HardDisk uuid="{a40d95c0-296d-46b1-97cb-a84592147d6c}" location="/home/lakk/VirtualBox VMs/Golden/Golden-FogServer_Installed-Debian10x64 Clone-1_Setup.Ok/Snapshots/{a40d95c0-296d-46b1-97cb-a84592147d6c}.vmdk" format="VMDK"/>
<HardDisk uuid="{cd248217-825b-40f1-9283-b2bf29df8441}" location="/home/lakk/VirtualBox VMs/Golden/Golden-FogServer_Installed-Debian10x64 Clone-1_Setup.Ok/Snapshots/{cd248217-825b-40f1-9283-b2bf29df8441}.vmdk" format="VMDK"/>
<HardDisk uuid="{e485580a-523f-4efc-911a-dbd291803814}" location="Snapshots/{e485580a-523f-4efc-911a-dbd291803814}.vmdk" format="VMDK"/>
<HardDisk uuid="{72bb0544-88f8-45f0-b9d7-47d0736cea7e}" location="/home/lakk/VirtualBox VMs/Golden/Golden-FogServer_Installed-Debian10x64 Clone-1_Setup.Ok/Snapshots/{72bb0544-88f8-45f0-b9d7-47d0736cea7e}.vmdk" format="VMDK"/>
</HardDisk>
<HardDisk uuid="{12dcb922-6060-4caa-bc68-02c1206c9ced}" location="Golden-MERGE_FogServer_Installed-Debian10x64 Clone-1_Setup.Ok Clone-disk1.vdi" format="vdi" type="Normal"/>
</HardDisks>
The main blue hard disk UUID {12dc.... has no snapshots. It is by itself in the list.
The secondary red hard disk UUID {e485... is a snapshot of the first green disk, UUID {f364..., along with some other snapshot disks your guest used in the past but are not being used now. The other snapshot disks can be disregarded, as this is just a list of previously-used media as well as in-use media.
Question: If I recall correctly you said that the vmdk backup drive is on a separate physical host disk. Is this physical disk mounted as the 'FOG-STORAGE' folder?
If so, and whatever backups stored in the secondary snapshot disk UUID {e485... can be lost without trouble, then I would disconnect the second drive on the SATA controller port 1 and connect port 1 to the vmdk file stored in "/home/lakk/VirtualBox VMs/FOG-STORAGE-1/FOG-STORAGE-1.vmdk".
If the backups are important then a clone of the snapshot disk UUID {e3485... would be necessary. Doublecheck that you'll have enough extra room for another disk the size of FOG-STORAGE-1.vmdk plus up to the size of the snapshot disk UUID {e485...
Try this command:
VBoxManage clonemedium "/path/to/Snapshots/{e485580a-523f-4efc-911a-dbd291803814}.vmdk" "/home/lakk/VirtualBox VMs/FOG-STORAGE-1/FOG-STORAGE-new.vmdk"
Then disconnect the second drive on the SATA controller port 1 and connect port 1 to the vmdk file stored in "/home/lakk/VirtualBox VMs/FOG-STORAGE-1/FOG-STORAGE-new.vmdk".
Re: Attached VMDK hard disk -> Snapshot is growing and system is crashing
Posted: 30. Jun 2020, 11:24
by lakk
i had the troubles some months ago. i did delete all of the snapshots and did rerun/restart the fog - project again.
i did create some backups (images) of other computers and have noticed that i still have the same problem.
after searching for some solutions in internet for a while i did left the "fog" - project aside.
Question: If I recall correctly you said that the vmdk backup drive is on a separate physical host disk. Is this physical disk mounted as the 'FOG-STORAGE' folder?
yes. the backup-drive (sdb) is on a separate host disk. but it is not mounted in the host system or as a folder.
but it is mounted in the guest-system as
/dev/sdb1 -> /images
HOST-SYSTEM
Code: Select all
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 149.1G 0 disk
├─sda1 8:1 0 145.3G 0 part /
├─sda2 8:2 0 1K 0 part
└─sda5 8:5 0 3.8G 0 part [SWAP]
sdb 8:16 0 1.4T 0 disk
└─sdb1 8:17 0 1.4T 0 part
sdc 8:32 0 233.8G 0 disk
└─sdc1 8:33 0 233.8G 0 part /mnt/LINUX_BAK_HD
i did create the "backup"- vmdk based on instructions like these
here.
with this command
Code: Select all
VBoxManage internalcommands createrawvmdk -filename '/home/lakk/VirtualBox VMs/FOG-STORAGE-1/FOG-STORAGE-1.vmdk' -rawdisk /dev/sdb1
then i have attached this vmdk-file in the virtualbox SATA-controller on port 1:

- vmdk attached to SATA-controller.
- fog-storage_sata.png (69.17 KiB) Viewed 4902 times
and mount it on the
guest-system as
/dev/sdb1 -> /images:
Code: Select all
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 45G 0 disk
├─sda1 8:1 0 953M 0 part /boot
├─sda2 8:2 0 1K 0 part
└─sda5 8:5 0 44.1G 0 part
├─vg0-base 254:0 0 18.6G 0 lvm /
├─vg0-swap 254:1 0 3.7G 0 lvm [SWAP]
├─vg0-opt 254:2 0 18.6G 0 lvm /opt
└─vg0-images 254:3 0 3.1G 0 lvm
sdb 8:16 0 1.4T 0 disk
└─sdb1 8:17 0 1.4T 0 part /images
sr0 11:0 1 1024M 0 rom
fstab - guest-system
Code: Select all
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
/dev/mapper/vg0-base / ext4 errors=remount-ro 0 1
# /boot was on /dev/sda1 during installation
UUID=b7301067-4c8f-40a4-a67f-9db66bfb8329 /boot ext4 defaults 0 2
# /dev/mapper/vg0-images /images ext4 defaults 0 2
/dev/mapper/vg0-opt /opt ext4 defaults 0 2
/dev/mapper/vg0-swap none swap sw 0 0
/dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0
# /dev/sdb1 /images2 ext4 defaults 0 1
/dev/sdb1 /images ext4 defaults 0 1
If so, and whatever backups stored in the secondary snapshot disk UUID {e485... can be lost without trouble, then I would disconnect the second drive on the SATA controller port 1 and connect port 1 to the vmdk file stored in "/home/lakk/VirtualBox VMs/FOG-STORAGE-1/FOG-STORAGE-1.vmdk".
this is what i think that i have already done. the second drive is not connected directly but over a vmdk-file ("FOG-STORAGE-1.vmdk").
please see the
picture above.
thank you for your help & support.
greetings
lakk
Re: Attached VMDK hard disk -> Snapshot is growing and system is crashing
Posted: 30. Jun 2020, 13:34
by scottgus1
If running the backup disk as a raw disk is new, to fix the snapshot problem, then you should be OK.
If the raw disk is an original part of the setup, then the snapshot is still there and will fill up again.
Can you re-zip and post the .vbox file again, please?
Re: Attached VMDK hard disk -> Snapshot is growing and system is crashing
Posted: 30. Jun 2020, 13:58
by lakk
yes, the raw disk is an original part of the setup.
i did upload the .vbox file.
Re: Attached VMDK hard disk -> Snapshot is growing and system is crashing
Posted: 30. Jun 2020, 15:53
by scottgus1
Thanks for the new .vbox file. The snapshot is still present, see the red UUID {e485... under the green raw disk .vmdk, still attached to SATA controller port 1:
<HardDisks>
<HardDisk uuid="{f364d123-3249-476a-b8f0-39720f314639}" location="/home/lakk/VirtualBox VMs/FOG-STORAGE-1/FOG-STORAGE-1.vmdk" format="VMDK" type="Normal">
<HardDisk uuid="{e485580a-523f-4efc-911a-dbd291803814}" location="Snapshots/{e485580a-523f-4efc-911a-dbd291803814}.vmdk" format="VMDK"/>
</HardDisk>
<HardDisk uuid="{12dcb922-6060-4caa-bc68-02c1206c9ced}" location="Golden-MERGE_FogServer_Installed-Debian10x64 Clone-1_Setup.Ok Clone-disk1.vdi" format="vdi" type="Normal"/>
</HardDisks>
<StorageController name="SATA" type="AHCI" PortCount="2" useHostIOCache="false" Bootable="true" IDE0MasterEmulationPort="0" IDE0SlaveEmulationPort="1" IDE1MasterEmulationPort="2" IDE1SlaveEmulationPort="3">
<AttachedDevice type="HardDisk" hotpluggable="false" port="0" device="0">
<Image uuid="{12dcb922-6060-4caa-bc68-02c1206c9ced}"/>
</AttachedDevice>
<AttachedDevice type="HardDisk" hotpluggable="false" port="1" device="0">
<Image uuid="{e485580a-523f-4efc-911a-dbd291803814}"/>
</AttachedDevice>
</StorageController>
I can disconnect the snapshot from the .vbox file, but it will result in losing whatever backups the snapshot contains, and possibly having to lose all the backups and reformat the raw disk inside the guest OS. (It is possible to copy the backups tp other media before losing/reformatting the raw disk, then copy them back afterward, so they are not really lost.) If you think this will be ok, please let me know.
Re: Attached VMDK hard disk -> Snapshot is growing and system is crashing
Posted: 30. Jun 2020, 16:12
by lakk
sure, this is really fine for me and it would be also nice if we can copy the "backups" to another medium and copy them back.
there is a third hard disk on the host-system (sdc) which could be used to save the backups.
i have already used it for this purpose and did copy a snapshot over there some time ago.
HOST-system
Code: Select all
sdc 8:32 0 233.8G 0 disk
└─sdc1 8:33 0 233.8G 0 part /mnt/LINUX_BAK_HD
Re: Attached VMDK hard disk -> Snapshot is growing and system is crashing
Posted: 30. Jun 2020, 17:29
by scottgus1
Okeydokey, here you go:
Before you try this .vbox file, back up the backups on the raw disk to other media. A shared folder should work for this. And maybe copy the whole guest folder as a backup too.
Reboot your host so no Virtualbox processes are running.
Rename the existing .vbox file to '.vbox-withsnapshot'. Copy the zipped .vbox file to the guest folder with the old .vbox file. (Keep the old .vbox file in case something isn't right.)
Try the guest. The raw disk might need a format. Then copy the backups back.
Here's what I changed:
<HardDisks>
<HardDisk uuid="{f364d123-3249-476a-b8f0-39720f314639}" location="/home/lakk/VirtualBox VMs/FOG-STORAGE-1/FOG-STORAGE-1.vmdk" format="VMDK" type="Normal"/>
<HardDisk uuid="{12dcb922-6060-4caa-bc68-02c1206c9ced}" location="Golden-MERGE_FogServer_Installed-Debian10x64 Clone-1_Setup.Ok Clone-disk1.vdi" format="vdi" type="Normal"/>
</HardDisks>
</StorageController>
<StorageController name="SATA" type="AHCI" PortCount="2" useHostIOCache="false" Bootable="true" IDE0MasterEmulationPort="0" IDE0SlaveEmulationPort="1" IDE1MasterEmulationPort="2" IDE1SlaveEmulationPort="3">
<AttachedDevice type="HardDisk" hotpluggable="false" port="0" device="0">
<Image uuid="{12dcb922-6060-4caa-bc68-02c1206c9ced}"/>
</AttachedDevice>
<AttachedDevice type="HardDisk" hotpluggable="false" port="1" device="0">
<Image uuid="{f364d123-3249-476a-b8f0-39720f314639}"/>
</AttachedDevice>
</StorageController>
I removed the reference to the snapshot, closed the XML on the raw disk, and put the raw disk UUID in the SATA port instead of the snapshot UUID.
Re: Attached VMDK hard disk -> Snapshot is growing and system is crashing
Posted: 1. Jul 2020, 13:55
by lakk
great - its working.
thank you very much.
one more question:
is there another - maybe better or faster - solution how to add an external hard disk to a virtual-system?
greetings
lakk
Re: [Solved] Attached VMDK hard disk -> Snapshot is growing and system is crashing
Posted: 1. Jul 2020, 18:44
by scottgus1
lakk wrote:is there another - maybe better or faster - solution how to add an external hard disk to a virtual-system?
The two ways available to do this are raw disk (risky but doable; requires run-as-administrator on Windows hosts, which is bad for regular use) or access via a folder on the disk shared by the host and leave the disk handling to the host.
Raw disk is risky because if the host should one day decide to re-enumerate the disks at startup, or a disk is removed from the host, the raw disk vmdk file could point to the wrong disk, and data loss could occur.
Shared folders just work. No matter what disk or other activity is happening, the shared folder is always there. Use a real shared folder, not a Guest Additions Shared Folder, which was designed only for drag-n-drop file & folder copy between host and guest. A network must be in place, Host-Only can do this if the guest must remain off the internet.
Normally, as long as one does not take snapshots, raw disk access will not cause the troubles you had in this guest. The raw disk continues to be used in toto by the guest.
However, there was some, well, weird stuff going on with this guest. The guest itself did not have an official 'snapshot'. But the 'used media list' showed that at some point in the past several different disk snapshots of the main raw disk, existing in a different folder besides the guest folder, had been used on the guest's SATA port 1, where the raw disk is attached now, and where the {e485... snapshot was being used at the start of this post. I am not certain how these situations developed.
To be safe, don't make snapshots on this guest. For versioning purposes, you should be able to make copies of the folder where the modified .vbox file exists. Make copies with the guest fully shut down, not save-stated. To flip to a copy, log out of the host and in again so no Virtualbox processes are running (or confirm using whatever Task Manager/command line is available that no processes with 'VBox' or 'VirtualBox' exist, should be scriptable), then swap names on the original and copy folders. Virtualbox will pick up whatever folder has the original name and use that guest data. The full raw disk should remain connected no matter what guest is active.
Re: [Solved] Attached VMDK hard disk -> Snapshot is growing and system is crashing
Posted: 2. Jul 2020, 10:20
by lakk
... or access via a folder on the disk shared by the host and leave the disk handling to the host.
so in this case i would mount a seperate hard-disk
sdb1 on the host-system using
fstab (uuid) and than set up a share-folder on this hard disk using f.e. instruction like
this?

this would be nice, as without a VMDK i could access the files directly on the
sdb1.
and i could - if necessary - add another hard-disk (
sdc1) if i need more storage-space for the backups.
another point is the write and read speed.
which option would have the best data write & read speed?
Shared folders just work. No matter what disk or other activity is happening, the shared folder is always there.
so you mean also shared-folders on separate hard disks? like i have described above?
i want use
separated hard-disks, one for the
"fog-server"-system and another one for the
"fog-storage"-backups.
Use a real shared folder, not a Guest Additions Shared Folder, which was designed only for drag-n-drop file & folder copy between host and guest. A network must be in place, Host-Only can do this if the guest must remain off the internet
could you please post a link to this topic?
However, there was some, well, weird stuff going on with this guest. The guest itself did not have an official 'snapshot'. But the 'used media list' showed that at some point in the past several different disk snapshots of the main raw disk, existing in a different folder besides the guest folder
yes. it was the first time that i was using a virtual-machine-system. and it was the first time that i had set up the fog-cloning-system.
i did also use VirtualBox on different computers during this setup.so, i guess many many weird things did happen.
thank you for your support!
greetings
lakk
Re: [Solved] Attached VMDK hard disk -> Snapshot is growing and system is crashing
Posted: 2. Jul 2020, 16:22
by scottgus1
Re Guest Additions Shared Folders, see the manual, section 4.3. I don't have a link for official discussion of the limitations of GASFs to file & folder copy only. It's just been something I have seen on the forum for the past decade, and when folks abide by it their problems go away.
With host-OS shared folders you can add as many disks as your host can handle, and the guest can access them all through the Host-Only network. The host OS can also access the files in the shared folders, enabling off-site transfer if desired.
The guest OS itself must remain on a VDI file, however. The guest folder itself can be put on a different disk, if desired. (It is possible to have the guest OS run on a raw disk, with the usual raw disk risks.) A guest OS cannot be run through a shared folder.
The 'this' link you posted is not the right kind of shared folder. The link shows setting up a GASF. You would want the host OS to make its own shared folders without using any Virtualbox settings. Pretend Virtualbox is not involved, and consult your host OS's directions to make a shared folder that is accessible over a LAN. Host-Only will pick up this shared folder and present it to the guest OS over the Host-Only 'LAN'.
I don't think there is much speed difference between shared folder access and raw disk access. But I have never tested. The Virtualbox Host-Only network is supposed to feed data as fast as the host hardware can pass it, not limited to 1Gbps etc network speeds.
Re: [Solved] Attached VMDK hard disk -> Snapshot is growing and system is crashing
Posted: 15. Jul 2020, 10:36
by lakk
i was on holidays
i will think about your propositions.
thank you very much for your help and support.
they helped me a lot.
greetings lakk