Skip to content
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

use clonefile copy for macvm boxes #459

Merged
merged 1 commit into from
Oct 16, 2023
Merged

use clonefile copy for macvm boxes #459

merged 1 commit into from
Oct 16, 2023

Conversation

mattlqx
Copy link
Contributor

@mattlqx mattlqx commented Oct 12, 2023

Vagrant uses prlctl clone to make a copy of the stored box when up'ing a VM. On Intel, this can be a linked clone, but on ARM, this is not an option with Apple's MacVMs. As such, Parallels does a full traditional copy of the box files into a new location that is then registered resulting in the requirement of 2(box size) space. Since MacVMs can be quite large (in our case 30-40GB after all our preparation and additional software), this can quickly run a laptop out of space with just a VM or two. (There's other factors here as well, like APFS snapshots if you're running Time Machine which will hold on to space after you've destroyed VMs.)

APFS supports the clonefile(2) call which creates a copy-on-write clone of the file meaning it's effectively a quick and free operation to fork a copy of a file. Subsequent writes to the clone are where additional bytes begin to be required. In our testing, this has been a huge time and space saver to do a clone copy of the MacVM and register it into Parallels.

I believe the best option is for Parallels to natively implement this when calling prlctl clone on APFS but considering that's a bigger ask and closed-source, I've created these modifications to the vagrant-parallels plugin to orchestrate it as a workaround until proper support can be added to Parallels.

@bineesh-n bineesh-n merged commit c10beb2 into Parallels:master Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants