Update: Time Machine Backup to Windows Home Server



UPDATE: Version 3 directions have been posted on the site. It’s easier than using the Applescript that has been failing for people that had a Windows partition. You can find the version 3 here.

I thought it was about time to revisit an earlier post, which has been quite popular, on how to backup your Mac using Time Machine to a Windows Home Server. There have been many updates to Windows Home Server and Mac OS X that has complicated the process just a bit and therefor my previous directions no longer work. Below I will highlight a still fairly easy process to get your Mac Time Machine working with Windows Home Server again.

I was messing with Linux commands and doing research on creating sparse image files when I came across a site that simplified the process with an AppleScript. You can read about that script and directions here.

I have simplified the directions to work with Windows Home Server. This isn’t supported by Apple or Windows Home Server. While it works for me, it is still hacking and I can’t guarantee that things won’t go wrong.

1. Click here to download the AppleScript that will help in the process. Just unzip it we will use it later.

2. Download iTimeMachine. You will need to install it and enable AirDisks. There is also a linux command to do this. If you want to know just leave a comment and I will provide it for you.

3. Logon to your Windows Home Server and create a new folder for your Time Machine backup. I called mine JJ MBP backup. Make sure you give whatever user account you want to use access. Once created you can close out of the Windows Home Server.

4. Now we can start the preparing the backup folder. In the left sidebar in finder you should see your Windows Home Server. Mine is called “Server” and will be under “Shared”. You need to click on your Home Server, logon and browse to your newly created Time Machine backup folder. Double click on it so it will mount the folder. I also show mounted volumes on my desktop to make it easier.

5. Now that you have mounted your backup folder you need to drag that to the AppleScript you downloaded in step one. Since I have my backup folder show on my desktop and I placed the AppleScript on my desktop I just drag and drop. You can also see the mounted folder in finder and drag it to where ever you saved the AppleScript. It will run a little program that you will have to OK. Once it’s done you will see the AppleScript icon disappear from your dock.

6. The program is done now and it’s time to transfer the sparse image to your backup folder. The AppleScript saved the sparse image in your Home directory. Browse to it and then transfer the sparse image to your Windows Home Server backup folder. Mine was about 450mb so it won’t take long to transfer.

7. Now that the sparse image is on the server open time machine and point it to your Windows Home Server backup folder. You shouldn’t get the error about creating backup and it should start transferring files quickly. Depending on how much data you have it could take a long time for the initial backup. My 14GB took about 1.5 hours over wireless.

Bonus: To make it easier to backup the files create a startup item that mounts your Windows Home Server backup folder. Every time the computer starts it will auto-logon to the folder so Time Machine will work automatically. If you are not connected to your network you will get a error but I find it easier to deal with one error message when I’m away than trying to remember to connect so Time Machine will work.

Now you have your Time Machine backing up to your Windows Home Server. It’s not too many steps and thanks to that AppleScript it makes it a lot easier. The directions I was working on required a lot of time in the Terminal which would scare a lot of people. I didn’t even think about creating it in a AppleScript.

Let me know if you have questions. I have created a video below to help people follow the process I have outlined above. I hope everyone has success.



If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Comments

JEREMYYYYYYY!!!!!!!!

THANK YOU!!

like you i also have all my macs with windows partition and yes this worked flawlessly it is backing up as I type

no script needed

step by step exactly as you wrote it nothing else required

anyone else having this problem this is the solution

i am backing up 4 macs 2 iMacs hardwired and 2 wireless MBP and MBA all of them working now so i cant see anyone having a problem with this now

thank you very very much for all your time and help my friend i appreciate it a lot

Enigma,

So glad it worked for you. I’m going to get a new post with the new instructions up so people don’t run into this issue.

Jeremy

i have one more question for you

while creating my sparse image i ran into a limit to the size i was able to create the image

my Hd is a 1tb i was only able to use 430GB as that was all the Free space i had available on my HD

i tried to set the save location to my server Share and it started creating but said could not create the image on the file system selected so i just went ahead and created it on my desktop at the 430 GB limit

the reason i went ahead is you had posted in step 5 “” Size = Over your total data amount. Right now I set mine at 400g. With Disk Utility you can resize this later if you fill the amount.””

all is well but i would like to now go back and make the Sparse image 1TB

how do i edit the size of the sparse image on my WHS?

Enigma,

From your mac go into your time machine backup folder and double click on the sparse image file. It will mount the file. Then go into disk utility and you will see the sparse image file in there. Highlight it and at the top there is a button to resize. I tried it tonight and it worked fine.

My WHS is completely full now since my iMac was full of videos.

lol OK that’s a little embarrassing simplicity killed the cat?? (my egos the cat) lol

thanx jeremy

Sweet, the last few posts fixed it all.

Thanks!

Thank you Jeremy I now have it all working.The only mistake I made was when creating the disk image, one of the boxes said “Format”, I left it at the default Extended Journaled, This did not work. I made another disk image with the format set to Extended (Case Sensitive) and it all works very well.

Thank you once again for your clear instructions

Jeremy,

My setup is imac i7 (including parallels windows virtual machine) wirelessly connected to an airport extreme that is in turn connected by gigabit LAN to a WHS box

For anyone else that has my setup please ensure you use the mac address of your ethernet in your imac, not the airport, or this will not work.

Best article I found is linked below. It works a treat:
http://www.levelofindirection.com/journal/2009/10/10/using-a-networked-drive-for-time-machine-backups-on-a-mac.html

Hi Jeremy,

Is the command to enable Time Machine over network

defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

If so then I shouldn’t have to install iTimeMachine. Is that correct?

I remember trying this back in mid 2009 when I first I my Macbook Pro and it did not work. I hope to have better luck this time.

Thank you

Ken,

That command is the same thing that iTimeMachine does. If you have a Windows partition use the directions I wrote up for Enigma in the comments above.

Hello!

Would you please, give a hint on how to limit the folder size where Time Machine keeps its back ups?

I am also having an Error 13 message when trying to back up my data to Acer h340 WHS server. What can be the problem here?

All is fine now. It was just a matter of terminology interpretation that did not allow me to set everything at once.

Thanks for the notes.

Hi Jermey, Works great! Thank you!

I’d create the sparse image using my WiFi MAC address, Time Machine appear to start preparing a backup then it would fail with a error code. “The backup disk image “/Volumes/backups/Ken.sparsebundle” could not be created (error 45).

Then I tried creating another sparse image using my Ethernet MAC address and everything was good despite I am using my WiFi to backup.

ifconfig en0 | grep ether | awk ‘{print $2}’ | sed ‘s/://g’

I did noticed on your video, when you copy that sparse disk image to your WHS, it was 2-3 times faster than my. For some reason, whenever I copy from my WHS, it’s fast but writing to my WHS, it’s super slow. Any ideas why this is?

Thanks again.

Ken,

I use wireless N at home with a gig connection to server. Also I don’t duplicate my Time Machine backups. Duplication will slow down file transfer.

Jeremy,

I have the same connections as you with Wireless N, Gig interface for WHS, and no file duplication.

This is slow writing speed to WHS happened when I use a Mac but other Windows machine, it’s fine. I came to the conclusion it from the Mac to WHS. Did some googling but no luck.

Ken,

I couldn’t find anything either. I would look at the event log and task manager while doing a backup. See if anything shows up out of the ordinary. You might also check to see if there is a new network driver for the WHS.

Hi Jeremy,

Thanks for posting this. It worked great for me too.

I received an error when creating the sparse file via the script about not having assistive device support, but a quick google led me to the Universal Access page within preferences where enabling this was just a check box. This done it worked fine.

Cheers
Steve

I have spent all night trying to get this working, but no go…
I am a Pc user, so maybe I am a little apple dumb.. but can someone please help me.

I got everything going well, just..
nothing shows up in time mac hine… do i need to reboot?

and where does it copy that file t after it finishes…
I can’t find it anywhere

on open names
set volumeName to names as text
set macAddress to (do shell script “ifconfig en0 | grep ether | tr -d ‘\11’ | sed s/ether// | sed ‘s/ //g’ | sed s/://g”)
set hostName to (do shell script “hostname -fs”)
tell application “Finder”
set theSize to round (((“3000”) / 1024 / 1024) / 1024)

this is the area I am having problems with, is this supposed to be the servers mac and hosr or the macs or what, omg please please help me.

on open names
set volumeName to “time”
set macAddress to (do shell script “ifconfig en0 | grep ether | tr -d ‘\11’ | sed s/ether// | sed ‘s/ //g’ | sed s/://g”)
set hostName to “MacPro”
tell application “Finder”
set theSize to round (((1024) / 1024 / 1024) / 1024)
end tell

do shell script “defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1” with administrator privileges

do shell script “sudo hdiutil create -size ” & theSize & ” -type SPARSEBUNDLE -nospotlight -volname \”Backup of ” & hostName & “\” -fs \”Journaled HFS+\” ~/” & hostName & “_” & macAddress & “.sparsebundle” with administrator privileges
do shell script “mv ~/” & hostName & “_” & macAddress & “.sparsebundle /Volumes/” & volumeName & “/” with administrator privileges

tell application “Finder” to eject volumeName

tell application “System Preferences”
activate
end tell

tell application “System Events”
tell application process “System Preferences”
set frontmost to true
click menu item “Time Machine” of menu “View” of menu bar 1
end tell
end tell

end open

thats my moded script, but time machine just sees the same dive 1.3gig free of 6 teratbytes.

First forget the AppleScript completely. Something changed in the hdiutil command and I didn’t feel like reading the man pages to figure it out. My other thought was it was people that had Windows partition, like my iMac.

1. Open Disk Utility in the Utilities folder.

2. Select the Macintosh HD, then go to “File” -> “New” -> “Blank Disk Image”.

3. A box will come up with a lot of different options. The save as name is important as Time Machine will use that name to see if it’s correct. The save as name should be machinename_macaddress. For example mine is jeremy-iMac_0a0a0a0a0a0a. I’m not giving my MAC address but that’s what the 0a stuff is. You can find the name by going to sharing in system preferences or types hostname -fs in the terminal. The MAC address is for the connection that will be used for Time Machine. My laptops are wireless, my desktop using ethernet.

4. Name = whatever you want. I called mine Time Machine.

5. Size = Over your total data amount. Right now I set mine at 400g. With Disk Utility you can resize this later if you fill the amount.

6. Partition = Single Partition – Apple Partition Map

7. Image Format = sparse bundle disk image

8. Now create the image. Default is to save to your desktop.

9. Transfer that disk image from your desktop to you time machine folder on the WHS.

10. Point time machine to your WHS folder and start the backup.

Ugh, this has been a very long night, thank you for your quick responce, i’ll let you know if it works….

Woot, looks like it’s going, thanks very very much.

Says it could not make the time machine image available…

the backup disk is not available.

Ah ha, looks like I got it,
I was originally doing this on another whs , and had the share names mixed up, it seems.

Hi, I’m hoping your still up,
I keep getting, backup disk not available…

whtat giveS?

this is really weird, so… when you posted.. it worked. the first time i did it..

it was a week ago though, and it worked, and was backing up, so i left, and let it run… I am doing this for a freind… and.. they said it error’d in the end.. and now, i can’t get it to work no matter what.

this is really frusterating.

I am not using any semi collins to seperate the mac addrss, th macs name is MacPro, so it’s

MacPro_a2a2a2a2a2a2

sooo frusterating…

although, the hostname thing gives me MacPro.local… do i need to include the local?

God, I had this all set up, and it was working, and now for some reason it just wont, UGH! so frustrating.

I go it, I had to run

do shell script “defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1” with administrator privileges

again, i am guessing, this has to be done each boot.

Jeremy,

I’m getting the same error that an earlier poster experienced.

It’s the “hdiutil: create failed – error -5344. I looked in my user directory for another sparse image but didn’t see it.

Can I get the terminal commands?

Thanks!

Try the steps below. It forgets the applescript and commands completely. Lost of people have had success with it. I had to use the below on my iMac because it has a Windows partition.

1. Open Disk Utility in the Utilities folder.

2. Select the Macintosh HD, then go to “File” -> “New” -> “Blank Disk Image”.

3. A box will come up with a lot of different options. The save as name is important as Time Machine will use that name to see if it’s correct. The save as name should be machinename_macaddress. For example mine is jeremy-iMac_0a0a0a0a0a0a. I’m not giving my MAC address but that’s what the 0a stuff is. You can find the name by going to sharing in system preferences or types hostname -fs in the terminal. The MAC address is for the connection that will be used for Time Machine. My laptops are wireless, my desktop using ethernet.

4. Name = whatever you want. I called mine Time Machine.

5. Size = Over your total data amount. Right now I set mine at 400g. With Disk Utility you can resize this later if you fill the amount.

6. Partition = Single Partition – Apple Partition Map

7. Image Format = sparse bundle disk image

8. Now create the image. Default is to save to your desktop.

9. Transfer that disk image from your desktop to you time machine folder on the WHS.

10. Point time machine to your WHS folder and start the backup.

Thank you for your expeditious reply.

It worked like a charm!

So I’m pretty new to Mac. How would I go about creating a startup item?

Richard,

Go to system preferences and click on accounts. You will see a tab at the top called login items. You can drag and drop the folder in there. When the computer boots up it will mount that folder.

Hey Jeremy, Remember I had the slow issue of copying files to WHS? I don’t know why I didn’t think of this but it was Nod32 Biz edition scanning my files. As soon I disable real-time file system protection, it was smokin…

Thanks for trying to help.

Why I didn’t think of the antivirus because from PC to WHS no problem. But from the Mac to WHS, sloooow.

Here a silly question. Let just said my hdd or I want to reinstall everything including OS X. I assume I should be able just connect to my WHS and recover all my files. Right? The only thing I am backing is only docs, music, etc. No apps.

Thanks

[…] since 2008 on getting the current Windows Home Server to work with Mac. You can see version 1, 2 and 3. It’s obvious by the 10s of thousands of visitors to those pages and the numerous […]

I tried using your script but get the error:

hostname: illegal option –f
usage: hostname [-s] [name-of-host]

Is there somethign I am doing wrong?

Jessica,

I created a new set of directions I called Version 3. It doesn’t use the script and is easier. You can find them here: http://www.multimedia-pcs.com/version-3-use-time-machine-with-windows-home-server/

Leave a comment

(required)

(required)