VMs snapshots for revert in time

Is it there a way to have an option for snapshots restore like we have in virtualbox?
What I want to do is creating a StandaloneVM/TemplateVM create a fresh installation snapshot, do things on it, create another snapshot and later if a want a fresh install or the other snapshot with e.g.: some extra packages to have it there

Is it there a way to do so?

Sure. Please refer to this official guideline and let us know if you have any additional questions:

2 Likes

This is more about restoring, but I’m interested in disabling auto revisions and make them only when I need them, manually.

Also, is it there a way to name revisions?

Hopefully you are not refering to the backup/restore solution?
This is taking a lot to backup/restore compared with virtualbox snapshots :frowning:

You can try to create snapshots manually using lvcreate -s in dom0 terminal.

wyng backups does incremental backups of volumes and can restore a qube to any snapshot made in the past: ANN: Wyng incremental backup, new version!

How can I revert that snapshot?
It doesn’t apper on revisions for qvm-volue revert option

@solene thank you I’ll have a look into wyng as well

Manually using lvconvert without using Qubes tools:

So what I’m doing but doesn’t seems to work

Creating the snapshot as:
lvcreate --noudevsync --ignoremonitoring -An -pr -s qubes_dom0/vm-<vm name>-root -n testing

Open <vm-name> and install a package

Try to restore the snapshot as [to not have the installed package anymore]:
lvconvert --merge qubes_dom0/testing

The response is: qubes_dom0/testing is not a mergeable logical volume

Am I doing something wrong?

Maybe you need to use thin-provisioned snapshot volumes:

Or maybe it’s just conflicting with the way Qubes OS is handling the volumes.

doesn’t seems to work :frowning:

@solene wyng doesn’t seems to be documented
Based on what on github [wyng repo] I’m receiving this

AttribueError: 'LocalStorage' object has no attribube 'LVolClass'

CC: @tasket

The documentation is a bit dense and technical, but the usage is pretty straightforward if you use wyng-util-qubes with any number of destinations:

$ # Start by creating a fresh Wyng archive:
$ sudo wyng arch-init --dest=file:/mnt/backups/laptop3.backup


$ # Make wyng backups of the VMs _work_ and _personal_
$ sudo wyng-util-qubes backup work personal --dest=file:/mnt/backups/laptop3.backup


$ # Restore VM _personal_ from a wyng archive
$ sudo wyng-util-qubes restore personal --dest=file:/mnt/backups/laptop3.backup

Also something of a guide in section 3:

2 Likes

@kenosen unfortunatelly is not working to restore

VMs selected: ubuntu22-04
Traceback (most recent call last):
  File "/usr/local/bin/wyng-util-qubes", line 332, in <module>
    (q_wpriv_wrootmap[target][session][ii],
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^
KeyError: 'private'

Using Qubes 4.2

Are you using the most recent wyng and wyng-util-qubes? Does running the command a second time produce different results? Cc @tasket

Using latest for both
Run the command multiple times and same result [–dest is another qube …]

I use snapshots as part of my backup process, without any issues.

Yes.

Are you creating snapshots of live systems? Try to give a little more
information.
Also, what have you done to the qube in the meantime?

I use thin snapshots, like this;
lvcreate -s --thinpool qubes_dom0/vm-pool vm-test-private --name vm-test-snapshot

Usually, if I see the not a mergeable logical volume error it is
because the underlying volume has been deleted, so there is nothing to
merge in to.

I never presume to speak for the Qubes team. When I comment in the Forum I speak for myself.

The last thing I can suggest without the expertise of @tasket is to try the beta branches of both wyng and wyng-util-qubes.

So I can create the snapshot
And if I’ll try to restore right after the creation it is working
The problem is that if I’ll open the vm and do something on it [like installing a new package] and try after that to restore, I’ll receive the message above

wyng: 0.8 beta release 20240610 - latest from what I’m seeing
wyng-util-qubes v09-beta rel 20240424

This is what I used - latest for both looks like
I’ll try with wyng v0.3.15 … but for util we have just beta releases

You should look to see what that snapshot relates to when you create it.
You will probably find that it is related to a backup volume that is now
deleted when you try to merge it back.

I never presume to speak for the Qubes team.
When I comment in the Forum I speak for myself.