Fusion

 View Only
  • 1.  Best practice for Backup of Fusion VM (here: W11ARM)

    Posted Jan 02, 2024 01:51 PM

    Hey folks,

    I am using Fusion 13.5 on my Apple Silicon Macbook (Sonoma) with a Windows 11 ARM VM. As my Time Machine is making backups of my Mac, it also "tries" to include the Fusion VM now. This doesn't run very smooth, so I tried to figure out why. It seems that Time Machine is not the preferred solution for backing up a VM with big files in it. Especially not when the VM is running...

    How do you guys handle this? The Companion Guide doesn't address this topic I think, so maybe I'll get some advice here.

    Regards,

    Stefan



  • 2.  RE: Best practice for Backup of Fusion VM (here: W11ARM)

    Posted Jan 02, 2024 03:01 PM

    The reason that there’s no discussion in the Companion Guide is that the topic of backup is not unique to Fusion running on Apple Silicon.

    Time Machine is problematic for backing up virtual machines. There’s no coordination of virtual machine operation and Time Machine so the best case is that the backup looks like the machine crashed. That may present problems for any application that happens to be running in the VM at the time of backup.   Time Machine is inefficient in its storage of the backed up disks as the entire contents of the virtual disk will be backed up each time a backup occurs . Also, Time Machine in older macOS releases was not guaranteed to have up all of the underlying files of a virtual disk at the same point in time. That led to a backup that’s unrecoverable - and worse, you wouldn’t know until it was too late.

    I see four options for backing up a VM (they are not mutually exclusive) 

    1. shut down the VM and Fusion and manually copy the VM to a backup drive. See https://docs.vmware.com/en/VMware-Fusion/13/com.vmware.fusion.using.doc/GUID-50863728-C156-47B7-B79F-F341FF5E5C9A.html in the Fusion documentation. 

    2. treat the VM as a physical system and run something in it that backs up to locally or network attached drives
    3. Use Microsoft OneDrive in the VM to store some or all of your data in the cloud in addition to on disk.
    4. use a utility to specifically back up virtual machines such as Vimalin (www.vimalin.com) - written by one of our community’s members.

    If you’re using APFS , you may also want to run your VMs on a disk volume that is not included in a Time Machine backup  Even if you exclude VMs from Time Machine backups, the virtual machine’s storage is included in the local APFS snapshots that Time Machine takes before it copies files to the backup destination  That increases the size of the hourly local snapshots that macOS keeps around for 1 day. 

     



  • 3.  RE: Best practice for Backup of Fusion VM (here: W11ARM)

    Posted Jan 02, 2024 06:21 PM

    That last point is especially important if you run VM's while traveling, as it stores those snapshots until the tm volume reappears.  The auto-trim function doesn't work very well, and I've actually run out of disk space, and had to manually thin them using tmutil from terminal.

    One way to mitigate that, as well as make incremental backups faster, is to put your vm inside a sparsebundle file.  It does slow performance slightly, but only the actual portions of the bundle that change are backed up (either by TM or by something like carbon copy cloner).  Otherwise you backup the entire virtual disk file every time.  I have a large VM (100GB) with a bunch of games installed, and putting it inside the sparsebundle reduces my backups by 90+%.

     

    Downside is that if the sparsebundle gets corrupted, you're toast.



  • 4.  RE: Best practice for Backup of Fusion VM (here: W11ARM)

    Posted Jan 04, 2024 04:16 PM

    Hey Paul,

    thanks for your input. Really appreciated!

    I'll think I will go for option 4, using Vimalin. Nice to know that it's written by a community member. I already installed it and took a first backup without problems.

     

    Regarding the APFS volume thing: I am not using automatic Time Machine backups. Instead I am using a Tool called "TimeMachineEditor", in which I can schedule TM backups. I have configured this to a backup every three days. So the aspect of the snapshot size isn't that big, right?



  • 5.  RE: Best practice for Backup of Fusion VM (here: W11ARM)

    Posted Jan 04, 2024 05:04 PM

    No idea honestly, but you still want to exclude the VM from the backups.  You can check to see how much disk space the snapshots use by :

    tmutil listlocalsnapshots /

     

    or replace / with the mount point of the drive you're concerned about.



  • 6.  RE: Best practice for Backup of Fusion VM (here: W11ARM)

    Posted Jan 04, 2024 05:27 PM

    The APFS snapshot that Time Machine takes of the primary volume at the beginning of the backup captures every file in that volume. Excluding a file/folder from Time Machine backups only means that the file does not get copied from that snapshot to the backup disk. That behavior is behind the recommendation to run VMs from a volume that's not being backed up by Time Machine.

    I still think that Time Machine retains at least one local snapshot between backups. You can confirm that either with the tmutil command that   has provided or check Disk Utility (it has the option of showing the snapshots that exist on an APFS volume). I believe that part of Time Machine's pruning at the end of a backup is to remove any local snapshot more than 1 day old that has been transferred to the backup disk.

    If my recollection is correct, that means that there's likely still a snapshot on your primary disk volumes that has to be maintained between your 3 day span between backups (unless, of course you manually delete it after your backup is complete).. If your VM is located on disks that are being snapshotted, the snapshot size will be based on how many disk blocks that have changed in your VM in the last 3 days - whether you have the VM excluded or not. 

    FYI if you're running Ventura or later, it has the ability to choose hourly, daily or weekly backups. 



  • 7.  RE: Best practice for Backup of Fusion VM (here: W11ARM)

    Posted Jan 05, 2024 10:57 PM

    Yeah, it's the TimeMachineEditor piece that's the unknown - OP should probably ask in that forum to see what it's doing.  AFAIK, there's no 'blessed' way to fiddle with time machine's schedule outside the normal options, so I suspect it's turning things on and off, or doing some other kind of snapshotting.

    APFS snapshots the entire drive, so there's definitely at least one copy being saved.



  • 8.  RE: Best practice for Backup of Fusion VM (here: W11ARM)

    Posted Jan 07, 2024 10:16 AM

    Understood, thanks!

     

    So besides the additional space which is needed for the snapshot (because of the vm file which is included), there are no negative "consequences", right? The size of the Time Machine Backup itself isn't affected by this, also not the "quality" of the TM-Backup.

     

    I am asking because free space on my SSD is not a problem at the moment (so the Snapshot size doesn't bother me).

     

    But what I've tried to avoid even this: I have created an additional APFS volume (and moved the VM image to this volume). After that, I deleted the Time Machine backup job and created a new one. I assumed that now I had to choose which volume I want to use for TM. But this didn't happen. There wasn't any option to choose the "right" volume. So I assume TM still covers both volumes, so that the "problem" remains. Is this expected behaviour?

     

    Or do I have to create a second partition instead of a second volume?



  • 9.  RE: Best practice for Backup of Fusion VM (here: W11ARM)

    Posted Jan 08, 2024 02:45 AM

    From what I can see from the documentation of TimeMachineEditor, it does not seem to control what is being backed up by Time Machine, only when the backups happen.

    You should go into macOS's Time Machine settings and make sure that your new APFS volume is not included for backup. If the volume is not included for backup, no snapshots of that volume will be taken.

    APFS snapshot are specific to APFS volumes, not APFS container disks. If you have two volumes on the same APFS container disk, and one is configured for backup with Time Machine and the other is not, then only the volume configured for Time Machine backups will be snapshotted.

    You do not need to create a second partition. Creating the second volume and excluding it from the Time Machine backup will do the trick.