My goal is to create and set up a new guest as I want it (e.g. run updates, change user settings, install programs), and then lock it into that state so that any file, system or other changes are completely discarded at shutdown. The next time I load the machine, I want it to be exactly as it was after I finished setting it up.
To do this, I’d create a new guest with a dynamic vdi just as I normally would, including installing the OS, running updates, installing programs, changing user settings, etc.
Then I’d shut down the guest, open Virtual Media Manager, select the guest’s vdi entry and change the attributes>type drop-down to “immutable.”
From that point on, no matter what I (or a malicious website or new program) does to the guest, those changes will be discarded at shutdown — the guest will remain identical to what it was the moment I changed its vdi entry to immutable. Even if I browse with minimal protections, not even a cookie will remain (not that I would; this is just an example).
When I want to install updates, I would load a fresh instance of the guest, install the updates (or make other changes), then immediately take a snapshot in VM Manager. Any changes made after that snapshot will be discarded
When I next start the guest, VBox will automatically combine the original vdi plus the snapshots I’ve taken, starting with the most recent one.
I do not need to shut down the guest before taking the snapshot. It’s simply called an “online snapshot” and there is no functional difference (to me and what I’m trying to do). All changes made during the same session after taking that snapshot will be discarded.
If the above is correct, I’m a little unclear about a couple things.
How do I clean up snapshots? I’m likely to end up with a lot of them, especially in the early days when I make lots of small changes (e.g. changing a NoScript trust setting).
My thought is that I would:
- Shut down the guest
- Use Media Manager to change the guest’s vdi back to ‘normal’
- Start the guest, which will load all changes recorded in the snapshots and write them to the vdi (bolding because I’m not sure if this is true)
- Shut down the guest
- Use Media Manager to change the guest’s vdi back to ‘immutable’
- Use VBox Manager to delete snapshots starting from youngest to oldest. Doing it this way means Manager won’t have to write differences between each snapshot, making the deletion process much quicker.
- Restart the guest. It will reflect all updates, etc. from all the snapshots, but because the vdi’s state is back to ‘immutable’, all future changes will be discarded.
Lastly, am I correct that having access to a shared folder (one that other guests and the host can see) is irrelevant — that none of the above affects this shared folder in any way? If I load a file from the shared folder and save back to the shared folder, there is no risk of loss of data or access. The only loss would be if saved a version to the guest.
Thanks~