-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP : Run as snapshot for apple vm #3893
base: main
Are you sure you want to change the base?
Conversation
Update - it now works !!! Both of this options is available
The setup function has also been designed to potentially be used with future "context menu" option. Follow up questions to consider ?
|
Short demo of the feature options https://www.youtube.com/watch?v=XdqdCxRbsec&ab_channel=EugeneCheah |
@PicoCreator I know this PR is marked as WIP but is it ready to be reviewed? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some high level comments:
- I don't think the logic for this should go in UTMAppleConfiguration. In division of responsibility, I see UTMAppleConfiguration mostly as an interface between UTM and VZVirtualMachineConfiguration and should only have logic to convert between the two. I think it's more fitting to have the logic in UTMAppleVirtualMachine, preferably as an extension.
- I don't think this should be a setting option that is saved. To be consistent with Add support for running VM as temporary snapshot #3067 we will have a context menu option to run with snapshot.
- Should we disallow it for shortcut VMs? I'm just not sure how we can detect if the VM is not on another volume like a network volume or FAT32 drive which will not support shallow copy.
For 3, it seems like you can use |
@PicoCreator thanks for pushing this so far! Would so be awesome to have this feature! ❤️ |
fb33cb2
to
3260ced
Compare
@PicoCreator , unfortunately, the title is misleading since what you are working on is in no way APFS snapshots (which require the Anyway, I am playing with the idea of true APFS snapshots for UTM and so far it looks as follows:
The ideal approach, in my opinion, would be to actually support dynamic allocation of an APFS volume group and the corresponding volumes per disk image inside UTM, this will open the opportunity to have a separate tool that handles snapshots/restores with a nice UI (basically, something like my tool, but on steroids and accessible from UTM's interface). This was the good news part. The bad news part is that Apple in their wisdom are explicitly restricting developers ability to do APFS snapshots. The aforementioned entitlements are only issued to enrolled Apple Developers after a very close review (usually backup software companies are getting these entitlements). The way my tool works is that I have a macOS VM with both SIP and AMFI (through If UTM decides to go this route, which is a universal approach for managing snapshots on macOS for any virtualisation backend, I think the project can apply for the corresponding entitlements and get it integrated in a nice to use way. I hope somebody would find this useful. P.S. I've spent around 3 hours to come up with a working solution using the "duct tape and sticks" approach, so I would estimate this effort (bar getting the entitlements from Apple) as a "small to medium" in effort. |
The qcow2 format supports snapshots and qemu already supports using this. Why add a dependency on APFS? |
Because this is for Apple Virtualization machines, that don't use qcow2. If you want snapshots of those machines (or Linux apple-virt), this is the only way. |
any luck with progressing with this, @PicoCreator ? would be a lovely feature to have indeed. |
Note: This is the "redone" version of a previous WIP PR - #3792
#2688
The QEMU counterpart is
#3067
The general idea is to do an APFS clone (Meaning it will only require the delta additional space, and make no changes on the original) on VM startup. ie.
cp -c
command. This allows us to mimic aqemu <disk> --snapshot
like behaviour.The goal is to support the disposable VM workflow (not so much on the snapshot management)