vojko
Contributor
Contributor

Enabling back time machine for vmware fusion images

I installed vmware 1.1.1 (was using 1.1.0) and it disabled backups for vmware images. Is it possible to enable them back, i have some important stuff in there and it would be nice to have it backuped once in a while.

0 Kudos
34 Replies
admin
Immortal
Immortal

Fusion intentionally disabled Time Machine for two reasons: space (your backup would quickly fill up) and correctness (Time Machine can cause freezes in some circumstances). If you want to back up a virtual machine, the easiest way is to do it manually.

If you must stick with Time Machine, however, you can - shut down Fusion and remove the exclusion flag from the virtual machine (I think xattr will do this, but I'm not at a Leopard box right now to check). Note that Fusion will add the flag back the next time you run that virtual machine, so let the backup finish first.

0 Kudos
rcardona2k
Immortal
Immortal

Eric is correct, xattr can remove the Time Machine exclusion flag so your VM files can be part of the backup (so long as the VM is not running). This message has the exact command line:

0 Kudos
vojko
Contributor
Contributor

So basically i'll have to run xattr -d com.apple.metadata:com_apple_backup_excludeItem * everytime i quit vmware image i was running to enable it for backup?

0 Kudos
rcardona2k
Immortal
Immortal

Yes that command works in the VM bundle directory, the one ending with a name like WinXP.vmwarevm. The more generic form for all virtual machines is:

find ~/Documents/Virtual\ Machines -type f -name "*.vm[des][kms]" -print -exec xattr -d com.apple.metadata:com_apple_backup_excludeItem {} \;

0 Kudos
admin
Immortal
Immortal

vojko, you could put Richard's command into a script, and possibly also trigger a backup off of it.

0 Kudos
vojko
Contributor
Contributor

I've tried the script. I've tried running xattr -d ... * by hand on the bundle and inside of the bundle and it still won't backup. Well it backups up a bit but the file is only big about 800kb so i'm guessing it backups everything but the vmdk which is about 10Gb.

0 Kudos
admin
Immortal
Immortal

The script won't work unless you can figure out why the command didn't work. Without having tried it and just from inspection, Richard's command should affect the .vmdk disk files. Are you referring to the .vmwarevm bundle being only 800 kB? When did you check, does Time Machine give some indication when it's done?

0 Kudos
vojko
Contributor
Contributor

(double post)

0 Kudos
vojko
Contributor
Contributor

Yes the bundle vmwarewm was only 800 kb after i restored it. And i've checked the content and everything was there besides vmdk file.

Here is what i do.

I run vmware fusion power on the virtal machine and shut it off.

So now i have:

vojko-drevs-imac:Virtual Machines.localized vojko$ xattr -l Windows\ XP\ Professional.vmwarevm/

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 .............

and

vojko-drevs-imac:Windows XP Professional.vmwarevm vojko$ xattr -l *

Windows XP Professional.vmdk: 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 .............

i guess at this point i have that attribute on vmwarewm and vmdk files so i run

vojko-drevs-imac:Windows XP Professional.vmwarevm vojko$ xattr -d com.apple.metadata:com_apple_backup_excludeItem Windows\ XP\ Professional.vmdk

vojko-drevs-imac:Windows XP Professional.vmwarevm vojko$ xattr -d com.apple.metadata:com_apple_backup_excludeItem Windows\ XP\ Professional.vmdk

No such xattr: com.apple.metadata:com_apple_backup_excludeItem

and

vojko-drevs-imac:Virtual Machines.localized vojko$ xattr -d com.apple.metadata:com_apple_backup_excludeItem Windows\ XP\ Professional.vmwarevm/

vojko-drevs-imac:Virtual Machines.localized vojko$ xattr -d com.apple.metadata:com_apple_backup_excludeItem Windows\ XP\ Professional.vmwarevm/

No such xattr: com.apple.metadata:com_apple_backup_excludeItem

i run start backup now on time machine and only vmwarevn bundle gets backed up without vmdk file. Which is about 800kb as i said before, and other 9 gigs are missing.

PS: also tried with sudo ... no cake

0 Kudos
vojko
Contributor
Contributor

Ok i also tried moving vmdk file around and renaming it and it didn't work.

Is it possible that xattr didn't remove all "don't backup" attributes in that file. Is it possible that one attribute might be somewhere else in the file like at position of 2G byte?

0 Kudos
rcardona2k
Immortal
Immortal

I removed the attributes before I started Time Machine and the first backup includes all of my VMDKs. Normally I run with Time Machine off, about once a month I shutdown my VMs, remove the attributes and start Time Machine and it refreshes my VMDK backups. I don't know how to get Time Machine to pick up files that were originally attributed not to be backed up. I'm sure changing the filename or moving it would not be enough because the internal file ID does not change.

0 Kudos
vojko
Contributor
Contributor

I'll reinstall vmware 1.1.0 and try making another virtual machine and see how it goes with backups. I had that before and it worked i even restored one image because of the virus with no problem. I think there is a bug in xattr that is keeping me from removing that exclude item attribute. Hopefully this reinstall will work.

0 Kudos
vojko
Contributor
Contributor

No luck and still no backups. I have no idea why it would backup the bundle file but not the vmdk file in the bundle after i removed that exclude attribute on both.

0 Kudos
rcardona2k
Immortal
Immortal

i'll try some tests on another machine that has Fusion and Time Machine but has not backup up any VMDKs and let you know what i find.

0 Kudos
dabble
Contributor
Contributor

for now at least, this works:

Drag the images out of the package to the desktop or somewhere, then exclude them from Time Machine.

Remove them from the exclusion list and put them back where they belong.

Until you open Fusion again, they will be included in the Time Machine backup.

So some other attribute is being modified also, unfortunately i'm not clever enough to figure that out.

I am clever enough to see the wider implications of such behavior, especially if Apple support do not know what is going on...

0 Kudos
vojko
Contributor
Contributor

Nope doesn't work everything gets backed up only vmdk file doesn't

(about 12GB).

0 Kudos
dabble
Contributor
Contributor

Just tried it on my iMac and it works on that, also tried it on several Mac Pro's at work and it works on those also.

I did notice that if I exclude an item with the Time Machine preferences, then run the xattr command on the excluded file, it still does not get backed up.

We're all on 10.5.2 and Fusion 1.1.1 BTW.

Another method I stumbled on from googling was to store your VM images in a disk image. Not the nicest of solutions but it does mean the images get backed up every time without having to do anything else.

0 Kudos
rcardona2k
Immortal
Immortal

One reason moving the VMDK files may work is if you're not removing the Time Machine exclusion attribute from the VM bundle (the VM.vmwarevm folder). If you don't remove the attribute from the bundle, the VMDK within will not be backed up by Time Machine.

0 Kudos
dabble
Contributor
Contributor

That didn't work for me with the xattr command, the flag gets removed but the vmdk file still does not back up, the rest of the bundle does though. Just copying the file to the desktop did not work either, but excluding it from the desktop then re including it then copying it back in to the bundle did.

Good job it did work for me as the hard drive just died in my macbook pro, the restored vm's work fine.

0 Kudos