1 2 Previous Next 27 Replies Latest reply on Jan 16, 2009 2:59 PM by asatoran

    Time Machine Backups of Virtual Machines

    gbullman Expert

       

      A note for those who believe Leopard's Time Machine is backing up their VMware Virtual Machines, they are likely not being backed up in any usable form.

       

       

      VMware Fusion is tagging each virtual disk file, and other critical VM files with a metadata value that prevents Time Machine from backing them up.  If, in Terminal, you cd to the directory of one of your Virtual Machines and run the command ls -l@ you will discover this metadata value has been attached to some files;

       

       

      com.apple.metadata:com_apple_backup_excludeItem

       

       

      I haven't been able to determine if this metadata setting has been available since Leopard 10.5, or whether it was added in 10.5.1, or 10.5.2.  If you've been using using Time Machine and Fusion for a while you may have some older backups, but certainly not after one of those OS updates were applied.

       

       

      Given that any backups while the VM is running are pretty much useless anyway it does make sense to exclude VMs from Time Machine Backups.  What bothers me is that has not been made clear to users of VMWare Fusion so they take the proper steps to ensure their VMs are backed up.  I assumed any time that Time Machine ran and I did not have any virtual machines running I was getting a good backup, luckily I found that I wasn't before I had to depend on a backup.

       

       

      Hope this information prevents headaches for someone out there.

       

       

       

       

       

       

       

       

        • 1. Re: Time Machine Backups of Virtual Machines
          Guru

          I haven't been able to determine if this metadata setting has been available since Leopard 10.5, or whether it was added in 10.5.1, or 10.5.2.  If you've been using using Time Machine and Fusion for a while you may have some older backups, but certainly not after one of those OS updates were applied.

           

          I believe the exclusion attribute has existed since 10.5, but Fusion didn't start using it until 1.1 or 1.1.1. The reason is not so much that backing up virtual machines isn't such a great idea (because they're large, you have to back up the entire file, and the on-disk state might not be consistent if the virtual machine is running), but rather an Apple bug that can cause the system to freeze/beachball and requires a hard reboot, which can in turn cause you to lose data.

           

          I agree we need to document this behavior better, and I (and others) have been griping about it internally.

          • 2. Re: Time Machine Backups of Virtual Machines
            stsanford Hot Shot

             

            I have been using Backup (the software that you use with .mac) to backup my VMs to the same External USB drive that I have my Time Machine data on. I just backup to a folder off of the root named Virtual Machines. I just make sure that my VMs are off when the backup runs. Ideally, I'd love a way to automate the shutdown, backup and subsequent restart.

             

             

             

             

             

            -Scott

             

             

            • 3. Re: Time Machine Backups of Virtual Machines
              Guru

              I've just received word that 10.5.2 apparently fixes the problem with Time Machine (e.g. see http://docs.info.apple.com/article.html?artnum=306853 - it's for Aperture, but we believe the underlying cause to be the same and QA says it's good now). Here is how to manually enable Time Machine:

               

              1. Use xattr to remove the following attribute from existing files: com.apple.metadata:com_apple_backup_excludeItem

              2. Edit ~/Library/Preferences/VMware Fusion/config to contain the following line so that this attribute does not get re-added

              fileMacos.timemachine.enable = "TRUE"

               

              Note that even though the Apple bug is fixed, you might still not want to enable Time Machine because virtual machines are big.

              • 4. Re: Time Machine Backups of Virtual Machines
                todivefor Hot Shot

                I don't have a config file only preferences.  Do I create a config file with this as the only entry?

                • 5. Re: Time Machine Backups of Virtual Machines
                  WoodyZ Guru
                  todivefor wrote:

                  I don't have a config file only preferences.  Do I create a config file with this as the only entry?

                   

                   

                   

                   

                   

                   

                   

                  It is just a plain text file so you can use any text editor and save it as plain text.

                   

                   

                  • 6. Re: Time Machine Backups of Virtual Machines
                    manfredell Hot Shot

                     

                    Hi,

                     

                     

                     

                     

                     

                    can you please inform the command line to use for xattr?

                     

                     

                     

                     

                     

                     

                     

                     

                    Thanks

                     

                     

                    • 7. Re: Time Machine Backups of Virtual Machines
                      manfredell Hot Shot

                      I used the following:

                       

                      xattr -d com.apple.metadata:com_apple_backup_excludeItem *

                       

                      I think that it did remove the metadata because using xattr -l * didn't show them any more.

                       

                      I created a config with the entry in the folder you mentioned. Restarted Fusion and checked again with xattr -l *

                       

                      Windows XP Professional.vmem: com.apple.metadata:com_apple_backup_excludeItem:

                      0000   62 70 6C 69 73 74 30 30 5F 10 11 63 6F 6D 2E 61    bplist00_..com.a

                      0010   70 70 6C 65 2E 62 61 63 6B 75 70 64 08 00 00 00    pple.backupd....

                      0020   00 00 00 01 01 00 00 00 00 00 00 00 01 00 00 00    ................

                      0030   00 00 00 00 00 00 00 00 00 00 00 00 1C             .............

                       

                      Windows XP Professional.vmss: com.apple.metadata:com_apple_backup_excludeItem:

                      0000   62 70 6C 69 73 74 30 30 5F 10 11 63 6F 6D 2E 61    bplist00_..com.a

                      0010   70 70 6C 65 2E 62 61 63 6B 75 70 64 08 00 00 00    pple.backupd....

                      0020   00 00 00 01 01 00 00 00 00 00 00 00 01 00 00 00    ................

                      0030   00 00 00 00 00 00 00 00 00 00 00 00 1C             .............

                       

                      etc

                       

                      Looks like it put the metadata again there, so the switch in the config file is ignored/not read!?

                      • 8. Re: Time Machine Backups of Virtual Machines
                        Guru

                        Looks like it put the metadata again there, so the switch in the config file is ignored/not read!?

                         

                        Are you sure you created a file called "config", not "config.txt"?

                        • 9. Re: Time Machine Backups of Virtual Machines
                          manfredell Hot Shot

                           

                          Just checked. The extension was hidden, as I never entered it and it was automatically appended I didn't see it.

                           

                           

                          Yes it was .txt

                           

                           

                          Removed. All OK.

                           

                           

                          • 10. Re: Time Machine Backups of Virtual Machines
                            khe91 Novice

                            I removed the attributes with xattr and put

                            fileMacos.timemachine.enable = "TRUE"

                            in the preferences file (without .txt).

                            But the attributes gets re-added with every Fusion start.

                            What can be the reason ?

                            • 11. Re: Time Machine Backups of Virtual Machines
                              Guru

                              I removed the attributes with xattr and put

                              fileMacos.timemachine.enable = "TRUE"

                              in the preferences file (without .txt).

                               

                              It's config, not preferences.

                              • 12. Re: Time Machine Backups of Virtual Machines
                                dizz Novice

                                 

                                I've followed these instructions (removing the file attributes, adding the entry in the config file) but Time Machine is still not backing up the VM images. Any ideas why?

                                 

                                 

                                 

                                 

                                 

                                • 13. Re: Time Machine Backups of Virtual Machines
                                  khe91 Novice

                                  Same here, my .vmwarevm files are only 200K in Time Machine (real size 3GB).

                                  • 14. Re: Time Machine Backups of Virtual Machines
                                    todivefor Hot Shot

                                    I can't get this to work.  I added the line to the "config" file, and removed the exclude attribute from the existing files.  I verified that the attribute was off.  Once I start a VM, the exclude attribute is back on for all the files in the VM.  I attached a screen shot of my "config" file.  Any ideas?

                                    1 2 Previous Next