Time Machine backups to WHS

We all know about how the HP Media Smart Server boasts Time Machine backups from Mac to the MSS. Well, I know how to get it working on any version/make of Windows Home Server, and I’m going to share how to do so with you.

Prerequisites

  • You need to create a separate share for time machine backups. I’d recommend not using duplication unless you have enough space.
  • You will need a network connection on your Mac computer with time machine.
  • Access to your Home Server’s Console and the  AAC (Advanced Admin Console) Add-In.

Enabling backups to shares

There is a command you need to run in Terminal on your Mac. I’ll assume you at least have access to do so.

Copy and paste this command into Terminal (it’s one line):
defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

Terminal

Time Machine Configuration

After executing the command in the last step, you need to mount the share you wish to backup to.

  • First find your WHS in Finder.
  • Next double click the WHS.
  • If asked, login using an account with access to the share (you must save the account to the keychain!). If not, click Connect As and do so.
  • Next you need to navigate to the share, in my case “Time Machine”.
  • After opening up the share, you can now open the Time Machine preferences.
  • Select your share (it gets mounted as a disk, and automatically re-mounted when Time Machine needs to backup) from the list. When asked, enter the same credentials as you used before and turn off backups.

Disk Selection

Initial backup

Since Leopard 10.5.2, Apple sort of messed up this little hack. It will fail to create the first backup. To get around this, you have to follow my steps outlined below:

  • First, open up the AAC tab in your home server console.
  • Click My Computer, and navigate to D:\shares\SHARE_NAME  - SHARE_NAME should be your time machine backup share.
  • Keep the console window open and switch to the Mac computer.
  • Enable backups and initiate a backup.
  • Quickly switch back over to the console.
  • You’ll see a new file inside the share folder (hidden). Mine was: Brent Friedman’s MacPro3,1_GENERATEDNUMBER.temp.sparsebundle
  • Quickly copy the file into the parent directory. D:\shares

Creating a working sparsebundle file

Since Time Machine fails to create this file successfully, we have to make it manually.

  • Run Applications/Utilities/Disk Utility on your Mac.
  • Up top in the menu bar, click File => New => Blank Disk Image.
  • Browse to your desktop in the where to save section.
  • For the save as name, use the name of the file that you copied to D:\shares, but remove the .tmp.sparsebundle part of it.
  • For the volume name, use Time Machine (probably doesn’t matter)
  • For image format, choose sparse bundle disk image.
  • Partitions should be No partition map.
  • Volume format, Mac OS Extended (Journaled)
  • For volume size, choose custom and then the size (in GB) of how much space Time Machine can possibly use (maximum, the image grows as data is added and subtracted).
  • Click create.
  • Eject the new disk image using Finder.
  • Move the newly created file to the Time Machine share.
  • Now, try backing up again using Time Machine it should finish the preparing step and take an hour or more to do the initial backup. Delete the file you copied to D:\shares on the WHS. 

SparseBundle

Conclusion

Congratulations, your Mac can now backup to your Home Server! Just remember, if you didn’t make a large enough sparse bundle file, Time Machine may run out of space pretty quickly. It backups very often and can use a lot of space. If you’d like, delete backups when not needed or every once and a while to save space.

Comments

Steve

Thanks for the walkthrough, Brent. Found it through We Got Served. There are a couple of things that have been preventing me from using my WHS for Time Machine...

1) This one is not really a deal breaker for me, but it is my understanding that you cannot do a system restore from a Time Machine backup on a network volume. When restoring, you need to install the OS from your original DVD and then grab the various other items piece by piece from the backup. (This is really no different than WHS and Windows for me since my main Windows installations are in Parallels VMs or BootCamp on the Macs and I can't get WHS restore to work.)

2) This one is the deal breaker... How do I limit the amount of disk space used by Time Machine? You mention manually deleting backups to save space, but I would think there has to be some way in WHS/Server 2003 to limit a share size. For example, I think my company limits the size of our home folder on the network at work. I have 3 macs and want to limit the Time Machine total to 1GB, just like it is with an attached physical drive of that size.


Marc Dieben

Dear Brent,

This looks great, but we tried it over here with a Imac with Mac OX 10.5.7. and it did not work. We got the announcement "The disk could not be activated" when trying to back-up with Timemachine.

What are we doing wrong?

Best regards,

Marc Dieben


Brent Friedman

@Steve,

1) From what I read, you can use the migration assistant to do a full restore. That is, after you reinstall OS/X. I haven't had to do a full restore yet.

2) As I mentioned before, the sparsebundle file's size when you create it is the maximum. In my screenshot, I used 300 GB as the maximum. It should not exceed the size set.

@Marc Dieben,

Did you mount the share before the initial backup and save the login to your keychain?


Marc

Brent,

We did mount it, and save the login to the keychain.

Any other ideas?

Marc


fds

defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

-> So and you are 100% sure, that this will always works?

We talk about a backup. Use iSCSI for TimeMachine instead this "Hack".


Brent Friedman

@Marc,

Sorry, I looked up the error and didn't find anything that relates to the problem.

@fds,

I don't know if it will work in future versions (ie: Snow Leopard). What I do know is that it worked for my system with 10.5.7.

@All,

What I failed to mention in the blog post is that it is 100% unsupported by Apple. It may not work for you. If it does, great. If not, don't complain or say I didn't warn you. I'm willing to help with setting it up. After that, you are on your own. If this is a little harsh, I'm sorry but I need to let you all know.


fds

"What I do know is that it worked for my system with 10.5.7."

Are you really sure - in all cases? Reliable? I don't think so.

I read that the NAS/Server acknowledges packages always. So it could happen in a worsed case that TimeMachine thinks that everything is OK but it isn't - and so the backup will fail.

Use iSCSI (Target) and you can use TimeMachine without Hacks.


Brent Friedman

@fbs,

It backed up everything just fine. I am able to restore files from the backups using the Time Machine interface. So you are incorrect, it works perfectly on my system. Correct me if I'm wrong, but iSCSI doesn't work with Windows Home Server and therefore isn't an option.

Why do you have to criticize the post? I am merely sharing a method I found that is an alternative to buying the HP MSS.


Hyram H. Hackenbacker

Sad to say it, chaps, but this isn't a reliable way of creating backups, due to the incomplete nature of Time Machine in 10.5 and the sneakiness of Apple in changing how TM handles remote shares just before 10.5.0 went gold.

Time Machine has a dual-ended checksum routine in it now, after late beta-testing of 10.5 found that the tiniest of network hiccups between the client TM and the remote share would corrupt hardlinks and thus ruin the entire TM archive. Rather than fixing it, Apple decided to add the dual-end check/resend hack into OSX itself, which is why the only supported and *trustworthy* remote backup devices are the Time Capsule (which runs a cut-down OSX) or another Mac running 10.5.2 or greater.

What this hack is doing is essentially the same as running an AEBS+AirDisk combination -- essentially you are fooling your local Time Machine executable into thinking it is storing its backups onto a locally attached volume, so the dual-ended checksumming doesn't happen. It only takes the tiniest of hiccups to completely mess up a remote sparseimage -- a wifi link blipping due to a single packet collision, or a drive buffer filling up, for example -- and that's it, its toast. What compounds the problem is that because Time Machine didn't get the server-side check-hold-resend signal, Time Machine will continue to blast bits at the now-damaged remote volume. As soon as it's finished the current transfer and writes out the hard link, it will check that the hard link exists and compares the directory-entry's file length, which will now not match up, and Time Machine falls over crying that the archive is corrupt.

I see this happen far too often.


Brent Friedman

@Hyram H. Hackenbacker,

Interesting. Any recommended alternatives to backing up to a Windows Home Server then (besides buying an HP MSS)?


Hyram H. Hackenbacker

Not even the HP box will do it -- there is nothing special about the HP MediaSmart and any other box running Windows Home Server (at least, from a software viewpoint).

WHS will happily handle Mac files, it just can't be trusted with Time Machine because of the way Time Machine does things. The closest you will get is a backup script that uses rsync to make a dump to your server on a schedule you set. There's a few scripts around to do just that, so have a google -- a good place to start is http://www.macosxhints.com


Brent Friedman

I know about arRsync, a GUI front-end for rsync ( arrsync.sourceforge.net ). I was hoping for a time machine solution though.


Simon M

Just to clarify Hyram - are you saying that the HP MediaSmart, which officially supports Time Machine (got best in show at MacWorld 2009) doesn't actually work properly?


pete

thank you so much for the step by step guide very helpful thank you


Ed

I've got an HP Media Smart Home Server and am using it to do time machine backups. I'm using it for user file backups. But since you can't restore from it, I've also added a second backup option.

I'm using SuperDuper to clone the entire drive to a sparse image on the server. According to their manual, If I ever need to restore, I should be able to clone the sparse image to an external drive that I can restore from.

Just fyi in case someone else might like to use a solution like this.

Ed


Christopher Price

To clarify on Hyram's behalf...

The AirPort Disk on AirPort Extreme is less reliable than backing up to a Windows Share (MediaSmart, WHS, or Windows 7 even... it doesn't matter, all use the same underlying SMB network protocol).

All the MediaSmart did was write an installer package that does what this blogger posted above.

The good news is that WHS is more reliable than AirPort Extreme. AP Extreme is unreliable because it does not have the buffer space that WHS does... so if a packet gets lost, SMB will kick in and ask for it again.

This avoids the "slightest blip" scenario that Hyram presented.

That said, Time Capsule and Mac OS X systems are at the top of the reliability heap. They do checksum on both sides, as part of the AFP system. SMB doesn't. It's just one of the many ways that Mac networking is superior to Windows networking... and why Time Machine is disabled for Windows shares.

Bottom line: While I've posted similar workarounds on my blog, you are much better off buying an old PowerPC G4/G5 system, and installing Leopard on that to run as a Time Machine server.


Bryan Bowers

A note for people who are using a Windows server (Windows SBS 2003, Windows 2003, Windows 2008 with Active Directory enabled:

Do not use the use the domain name in the username (domain\username). Instead just use the username (administrator). I spent a few hours on this before I finally figured it out.


Andrew

has anyone tried using a leopard virtual machine or a hackintosh for a time machine server? seems like it might be the best option if you are using a cheap machine. Or is there a linux distro that supports AFP?


Guillaume Boudreau

FYI, Windows 2003 server supports AFP if you install "File Services for Macintosh".

Ref: en.wikipedia.org/.../Apple_Filing_Pr

Go to Control Panel > Add or Remove Programs > Add/Remove Windows Components (on the left) > Other Network File and Print Services > Details... > File Services for Macintosh.

Since WHS is based on Windows 2003, that would work on WHS too. (I had to do it twice to get it installed on my WHS; received an 'Unknown Error' the first time.) Then you need to create shared manually using the Computer Managements app found in the Administrative Tools.

I have doubts that it will be better than using SMB to access a TimeMachine share though... Especially since Drive Extender probably won't be used to manage files from AFP (I'd guess).

Anyway... Someone might wanna experiment using that.


Dallas Knox

So after exhausting all the information here on the website and continuing to fail at getting this to work, I put the task a side for a couple days and tried analyzing the problem from a different perspective. In the mean-time I installed Snow Leopard on the computer I was trying to backup and did a restart. I Followed your steps all over again and to my amazement the process is up and working beautifully. I am sinking Three MAC computers to a Time Machine Share on my WHS. Thanks alot Brent this is great


observer

SMB (windows file sharing ) uses TCP protocls and thus does have checksums at that layer.


Brent Friedman

@Dallas Knox,

I'm glad it worked for you.


Brent Friedman

For Snow Leopard, make sure the the sparsebundle's name is <compname>.sparsebundle (where <compname> is the Mac's name). Also follow steps b and c in this tutorial: www.insanelymac.com/.../index.php

Or, just follow the tutorial above after running the terminal command in mine.