exclude mounts from snapshot

Discussions related to using VirtualBox on Linux hosts.
Post Reply
stephenboston
Posts: 16
Joined: 27. May 2019, 02:38

exclude mounts from snapshot

Post by stephenboston »

My VM has a couple mounts including a USB drive. Are these included in the snapshot? Will restoring a snapshot overwrite these files?
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: exclude mounts from snapshot

Post by scottgus1 »

stephenboston wrote: 13. Nov 2023, 22:28 My VM has a couple mounts including a USB drive. Are these included in the snapshot?
By "mounts" I assume you mean some form of folder in the VM's OS that reflects something on the host OS's drives, like a Virtualbox Shared Folder or USB Filter.

Virtualbox Shared Folders and USB Filters are items that can be included in a snapshot. The contents of the host's folder that was shared or the USB drive that was filtered are not included in the snapshot.

So you could restore a snapshot that removes a Virtualbox Shared Folder or USB Filter, and the VM won't have access to the host's folder that was shared or the USB drive that was filtered.

But the contents of the folder or drive will still be on the host.
stephenboston
Posts: 16
Joined: 27. May 2019, 02:38

Re: exclude mounts from snapshot

Post by stephenboston »

I see. So the mount mechanisms (or whatever) are included in the snapshot but not the mounted contents. On restoring a snapshot, the mounted volumes will have their real contents `now` not the contents they had at the time of the snapshot.

Thank you.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: exclude mounts from snapshot

Post by scottgus1 »

stephenboston wrote: 22. Nov 2023, 03:23 the mount mechanisms (or whatever) are included in the snapshot but not the mounted contents.
Correct.
stephenboston wrote: 22. Nov 2023, 03:23 On restoring a snapshot, the mounted volumes will have their real contents `now` not the contents they had at the time of the snapshot.
Not really, no. The contents of the shared folders will not change regardless of what snapshot is in place.

If the state of the VM today has a shared folder set up, but the state of the VM at the time of the snapshot did not have the shared folder set up, only the ability to access the shared folder will disappear when that snapshot is restored. The contents of the shared folders remain the same no matter what state of the VM is active.

Think of the shared folders setup as a direction sign on a road "Next exit, Hooplah City, 40 km" The city will be there today, and it will be there tomorrow after somebody drives off the road and knocks the sign down with their car. Only the sign changes, the city remains.

Same with the snapshot scenario: only the pointer changes. The actual host folder with contents does not change.

And if the snapshot also had the shared folder set up, it too would show today's contents of the shared folders.
Post Reply