winboat
winboat copied to clipboard
Add snapshots feature
Have you ever wanted to delete System32 inside Winboat? Now you can!
I tried to keep bash at the bare minimum, however some was still needed. This is now ready to test! It's a draft, but any review on what is actually done is appreaciated to improve everything.
Actual features:
- Cold snapshots (they require restarts).
- Both volumes (legacy) and bind mounts are supported. For named volumes, a new alpine docker is started to clone the volume. It is then removed if canceled or finished.
- User can decide to compress the snaps to save space, or to avoid compression for faster speeds.
- User can decide the max number of snapshots (older ones get deleted).
- User can decide where to save snaps. Only absolute paths are supported to avoid any potential damage. Write permissions are checked while user types in the directory. (Migration of existing snapshots is up to the user, however an alert is being shown if there are snapshots in the current snap directory). The SnapshotsManager gets automatically restarted in case of a path change. This is to avoid Winboat restarts.
- Rich logs are saved in a new snapshots.log file.
- New settings are being saved in the config file: "snapshotMaxCount": 3, "snapshotCompression": true, "rdpArgs": [], "snapshotPath": "/home/bl4ckk/.winboat/snapshots"
- Pigz is being used for compression (it's actually faster), however there is fallback to gzip.
- While snapshot is being created, it shows "Creating..." state.
- After ungraceful stop (eg you brutally close Winboat) the snapshot process gets checked and recovered/canceled.
- Showing "restoring" state.
- Disable VM starts while restoring/snapping.
- Possibility to save snapshot on another disk.
- In case of restore, save a backup to rollback if something fails. This avoids any VM corruption.
TO IMPLEMENT:
- Check if free space is enough before starting snap creation.
- Check the written space during a restore.
- Avoid negative numbers on snapshot limit.
- Estimate snapshot size before creation. // Actually I am personally unable to implement this. If you do know how to do it, please feel fry to help me out
Yes, I tested deleting System32
Resolves #180
Functionally, this works fine for me. One thing I would change is that deleting a snapshot switches the delete button and cancel button, so maybe change that.
Functionally, this works fine for me. One thing I would change is that deleting a snapshot switches the delete button and cancel button, so maybe change that.
Many thanks <3 gonna change it!