Snapshot mode supported?

This is for discussing general topics about how to use VirtualBox.
Post Reply
gizmo
Posts: 2
Joined: 11. Jul 2007, 11:16

Snapshot mode supported?

Post by gizmo »

Hi, for educational purposes I'd like to know if it's possible to discard all changes on exit, like what -snapshot does in QEMU. The following situation would be ideal:

- Load the VM in a state where the guest OS has finished booting
- A read-only disk image (owned by another user, root for instance)
- Rid all changes when the VM shuts down

With QEMU, if I need to change the image, I can start QEMU with the privileges to write to the disk image (usually I just copy it to my home dir) and use the 'commit' command whenever it's ready to be rolled out.

To further complicate the case, there is 1 box that has a USB printer attached to it that _has_ to remain with the host OS, for the print server to work. (The facilities are a bit limited here.) Also the guest OS has to run fullscreen without any fancy GUI around it (like, vboxsdl -fullscreen).

I was thinking of a tool in guest OS userland that when the user shuts down the guest OS, sends a signal to the host that tells it (by invoking vboxmanage) to create a snapshot of the current state, (rigorously) shut down the VM, and then remove the latest snapshot. But there must be a better way to accomplish this ;)
sandervl
Volunteer
Posts: 1064
Joined: 10. May 2007, 10:27
Primary OS: MS Windows Vista
VBox Version: PUEL
Guest OSses: Windows, Linux, Solaris

Post by sandervl »

vboxsdl -vm vm_name -discardstate starts a VM and reverts to the snapshot state.
gizmo
Posts: 2
Joined: 11. Jul 2007, 11:16

Post by gizmo »

As I understand it, this would mean saving the VM upon shutdown (still with no means to automatically trigger that, apart from a custom shutdown tool), and then discarding it at the next run. That is still wasteful IMHO. There should be a way of discarding the current state at shutdown, never mind writing a saved state file.
nvivo
Posts: 57
Joined: 4. Aug 2007, 17:08

Re: Snapshot mode supported?

Post by nvivo »

gizmo wrote: The following situation would be ideal:

- Load the VM in a state where the guest OS has finished booting
- A read-only disk image (owned by another user, root for instance)
- Rid all changes when the VM shuts down
I believe you can create your virtual machine, then deregister the image and register it again (using VBoxManage registerimage) setting the type to immutable. I didn't try that, but from the manual, this creates a static image where all the changes would be discarded when the machine is shut down.

For the loading with the guest started, i believe a simple live snapshot would solve that.
Post Reply