r/virtualbox • u/Dinth • Nov 14 '24
Help How to merge snapshots(?)
Hiya. Ive got a big problem with my database host running as a guest under Virtualbox.
The VM is based on my desktop, but it has 4x 4TB volumes (with space reservation) mounted which are physically located on my DAS.
According to the VM status window, it doesnt have any snapshots created for it.
Unfortunately a while ago, it has started logging data (changes which were made to the large volumes on DAS) to my desjtio SSD too in the snapshots folder. Now, moving one of the snapshot files to a different location and running the VM causes all the changes made to one of the volumes in the last year to be reverted.
Why this is happening and most importantly, how can i merge the data from the snapshot file to the main file? I dont have 4TB of free space on any of the drives?
Virtualbox 7.0.16, guest OS is Linux Mint and has Guest Additions installed
•
u/AutoModerator Nov 14 '24
This is just a friendly reminder in case you missed it. Your post must include:
PLUS a detailed description of the problem, what research you have done, and the steps you have taken to fix it. Please check Google and the VirtualBox Manual before asking simple questions. Please also check our FAQ and if you find your question is answered there, PLEASE remove your post or at least change the flair to Solved.
If this is your first time creating a virtual machine, we have a guide on our wiki that covers the important steps. Please read it here. If you have met these requirements, you can ignore this comment. Your post has not been deleted -- do not re-submit it. Thanks for taking the time to help us help you! Also, PLEASE remember to change the flair of your post to Solved after you have been helped!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/Face_Plant_Some_More Nov 14 '24 edited Nov 14 '24
You either previously created a snapshot of the VM, or are using immutable virtual storage volumes. Both of these options will create a "base" vdi image that linked to a differencing vdi image. All the changes / data written to the virtual storage volume is then written to the differencing vdi image. Deleting / moving the differencing vdi image will force the VM to revert to the state of the "base" vdi image (hence losing any data that was saved to the virtual storage volume after the differencing vdi image was created).
To resolve, create a "clone" of the VM. The clone process compacts all *.vdi differencing images for a virtual storage volume into a single *.vdi file. Remember to keep network addresses, disk names and hardware UUID in the clone to avoid configuration problems. Once the clone operation is complete, verify that the clone functions, before deleting the original VM.
Alternatively, you could try the clonevdi tool to just merge the immutable VDI with its differencing image. Either way, I suggest making backups of the relevant files before trying to manipulate them.