Setup a Time Machine Backup to a Windows Home Server Share

Let me start by saying that, yes I am a new Mac user. I just got my shiny new 15″ MacBook Pro two weeks ago. For almost two decades I have been solely a devoted Windows user. It’s always been that my first order of business when I get a new computer in my life to set it up to automatically back up to my Windows Home Server (2011). One of the first things that I noticed as I started my new transition into this OSX oriented world was the Time Machine feature built in to the OS and I must admit that I was surprised that it only seems to work with only a Directly-attached external storage (via USB, Firewire, or Thunderbolt) or Time Capsule or Airport Base Station attached storage.

Since I’m a fan of setting up “automated” backups and have plenty of space for backups on my home server I naturally began searching the web to see if there was a work around to this issue. I suspect that if you are reading this then you too are looking for the solution and the search engine powers that be have pointed you to this site. Below is my tutorial to setup a Time Machine backup to a windows share. I am running OSX version 10.8.3 (Mountain Lion) and I will be using a SMB network share to my NAS running Windows Home Server 2011 (Based on Windows Server 2008). I suspect that this solution should work with any windows network share you may want to set Time Machine to use.

First we will need to create a Disk Image. This is also referred to as a sparse file. This is the image that Time Machine will use to store your backups. You will need to set a size “Cap” for this image. Don’t worry though it will only grow to the size that you limit it to and will only grow to that size as needed. Here are the steps…

Creating the Disk Image

1) Open Disk Utility
2) Click on New Image

Set a large enough size for the disk image. Ensure that the Format is “Mac OS X Extended (Journaled)” (in other words, this will be HFS+, the Mac’s native filesystem) and the Image Format is “sparse bundle disk image“.

 

Setup a Time Machine Backup to a Windows Share

 

3) Time Machine Disk Image Settings

You can set Encryption if you want but not necessary. On the other hand, encrypting the disk image is a good idea since you’re going to put it on a network that can potentially be accessed by others.

4) Save the disk image to the shared folder. Alternatively you can save the image locally and then move it to the destination folder on a server.

 

Tell Time Machine to use the Disk Image

1) Open Finder and Navigate to the shared folder which you put the new disk image.

2) Double-click on the disk image to mount it. You should see the new volume in the Finder’s sidebar

3) Open Terminal and enter the following command :

sudo tmutil setdestination /Volumes/{mounted-disk-image}

  • Be sure to replace {mounted-disk-image} with the appropriate name for your new disk image. You will be prompted for your password, this is normal.

 

Do a Test Backup

 

1) Click the Time Machine icon in the Menu Extras area (that’s the upper-right side of the screen) and select “Back Up Now”. It will take some time for Time Machine to do its thing.

2) Open Finder, navigate to the mounted disk image, and ensure that Time Machine have created the “Backups.backupdb” folder and there is a folder inside it with the same name as your computer.

Doing a (not so normal) Full Restore

I’m sure you can also imagine, doing a hack like this makes a “normal” full Time Machine restore impossible.

What I mean by “normal” is that if you boot off the OS X installation disk, you can choose to restore a Time Machine backup instead of installing a brand new copy of the operating system. When you choose this option, it scans for a Time Machine backup – but only the locations it supports, like external hard drives or Time Capsules.

Now, sure, you could probably copy the Time Machine backup on your WHS to an external drive, since the backup on the WHS is essentially just a disk image. But has an external drive large enough to spare – and besides, there must be a better way.

You can’t do a normal Time Machine restore, but you can use the Migration Assistant:

1) Boot to recovery mode by holding “Command+R” as the apple logo is shown during boot up. Then install a brand spanking new copy of OS X. Make a throw-away account when you’re prompted to create your first account. I named mine “Admin”.

2) Mount your Time Machine backup. In Finder, use the menu option Go –> Connect to Server…, and type the address to your Windows Home Server. This is usually “smb://” plus the server’s name. (For example “smb://hostname”.) OS X should find the server, connect to it, and list the available shares. Connect to the share that contains your Time Machine backup, and double-click the .sparsebundle file to mount the disk. (Enter your Home Server username and password, if prompted.)

3) Run Migration Assistant. This tool is located under Applications –> Utilities on your Mac hard drive. Start it up, and read the intro if you’d like. Click Continue when you’re ready. Choose the “From a Time Machine backup or other disk” option, and click Continue. If you were able to mount the disk image in step #2, then it should be an option to choose from. Select it and Continue.

4) Restore the backup. The last screen shows you the available items to restore, and how much space they’ll take up. If you created the throw-away account in step #1, then there should be no conflicts with restoring your real account from the Time Machine backup. Select what you do or do not want to restore, and then click Continue. The restore can take a while depending on how much data you have.

That’s it! When it finishes, your account should be back to the way it was, exactly as you left it (as of the last Time Machine backup). You can now throw away your throw-away account, or leave it as a battle scar.

There you go that is how I setup a Time Machine backup to a Windows share using Windows Home Server 2011. This worked great for me. Hope this helps someone 🙂

Posted in Technology, Tutorials and tagged , , , .

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *