Posted in Technology
17/01 2012

Using the Windows CrashPlan Client to manage a headless Linux server

If you’ve followed my post about backing up your home file server and how I backup my own server, then you’ll know I’m a big fan of CrashPlan.  My only complain is that CrashPlan was built with the assumption that the GUI would reside on the same machine as the backup engine.  However, with a little SSH magic, you can easily overcome this limitation.

For the uninitiated, CrashPlan comprises of two components:

  • CrashPlan Engine: This is always running from the moment you install CrashPlan and continues to run even if you log out. It is responsible for the actual backup functions
  • CrashPlan Desktop: This runs the nice GUI desktop application that helps you configure and manage the CrashPlan Engine.

UPDATE!  -  I’ve found a way to remotely manage CrashPlan without the need for SSH port forwarding.  See my new post here.

Here at Liquidstate, we have a central file server that runs Linux.  Naturally, it doesn’t have X Windows installed and is operated as a headless server – much like the type you would deploy to a data centre in a corporate environment.  I have a PC running Windows 7 that I use for any serious work and an iPad for casual web browsing etc.  In this post, I’ll show you how you can use the CrashPlan Desktop running on Windows 7 to manage the CrashPlan Engine running on a separate Linux server.

Installation

Before we begin, I’ll assume that you’ve followed my other post that covers installing CrashPlan on a headless Linux Server.  I’ll also assume that you’ve downloaded and installed the CrashPlan software on your Windows 7 PC.  If you haven’t, then why not go do that now.

Configure CrashPlan GUI to access a remote CrashPlan Engine

We’re now going to reconfigure the CrashPlan Desktop installation on our Windows PC to access a different port which we’ll then redirect to the CrashPlan Engine instance running on our Linux Server.  Annoyingly, if you also have a CrashPlan Engine instance running on your Windows PC then you’ll need to add/remove (or comment/uncomment) this line each time you want to switch between them.  Note that the CrashPlan Engine is unaffected by changes to this text file – it will happily trundle along in the background, backing up files from your Windows PC.

Open the folder where you installed CrashPlan on your Windows PC. By default, this is in C:\Program Files\CrashPlan. Inside, you’ll find a folder called “conf” and inside there, a file called “ui.properties”. Open this file using a decent text editor like Notepad++ and add the following line:
servicePort=4200

You might find that Notepad doesn’t show line breaks properly.  You may also notice that there’s already a line similar to the above that starts with ‘#’.  This means that line is commented out, so you have the choice of changing that line and removing the ‘#’ (or just follow these instructions and add it at the bottom).

For reference, here is the content of my “ui.properties” file:
#Fri Dec 09 09:50:22 CST 2005
#serviceHost=127.0.0.1
servicePort=4200
#pollerPeriod=1000 # 1 second
#connectRetryDelay=10000 # 10 seconds
#connectRetryAttempts=3
#showWelcome=true

#font.small=
#font.default=
#font.title=
#font.message.header=
#font.message.body=
#font.tab=

SSH Tunnelling

If you’re running a Linux server, I expect you’ll already know how to use an SSH client like Putty to open a Linux command shell from a remote Windows PC.  However, SSH tunneling might be new to you.  An SSH tunnel allows you to forward a specified local TCP port to a port on the remote machine.  In this example, we’ll create an SSH tunnel that fowards any traffic to port of our choosing on our Windows PC to port 4243 on our Linux server (the port that CrashPlan Engine uses to communicate).

 

 

 

 

Creating an SSH tunnel using Putty

Download and install Putty if you don’t already have it installed. Open the program and:

  • Enter the Hostname (or IP address) of your Linux server.
  • Leave the Port field set to the default value of 22.
  • Leave the Connection Type set to the default value of “SSH”.
  • In the “Saved Sessions” field, type a name for this session, like “Crashplan”.
  • Hit the “Save” button.
  • Your session name should now appear in the list for future use.

Now,

  • In the left-hand pane, expand the “Connection” tab, followed by the “SSH” tab, and then select “Tunnels”.
  • Below where it says “Add new forwarded port:”, set the “Source port” field to 4200 and the “Destination” to “localhost:4243″.
  • You can leave the default settings “Local” and “Auto” as-is.
  • Hit the “Add” button to the right of the “Source port” field.
  • The list of “Forward ports” should now include a line that reads “L4200   localhost:4243″
  • To save the changes, in the left-hand pane, select the “Session” tab; ensure that the Host Name, Port, and “Saved Sessions” fields are how you left them; and hit the “Save” button.

Open the tunnel

  • Ensure that you’re looking at the “Session” tab by selecting it in the left-hand pane.
  • Ensure that the “Crashplan” session we saved earlier is loaded by selecting it from the list and hitting “Load”.
  • Hit the “Open” button at the bottom right of the window.
  • An Linux command shell will open, asking for your username and password.
  • After you’ve entered these, it will look and act like a normal remote session, but hidden behind the scenes is our SSH tunnel.

Connect to the remote CrashPlan Engine

If you’ve already opened your SSH Tunnel, you should be able to launch the CrashPlan Desktop application on your Windows PC and it will connect through to the CrashPlan Engine instance running on your Linux PC.  If you get a connection error, make sure that you have edited the “ui.properties” file correctly;  that you entered the right port numbers in Putty; and that you have an open Putty session running in the background.

 

USER COMMENTS

Track comments via RSS 2.0 feed. Feel free to post the comment, or trackback from your web site.

  1. 19/01 2012

    Hi mate,
    to your knowledge can you make your own Seed backup drive?
    The reason I ask is that It I might do a turn about backup with my mate John.
    So he would hold my off site backup and me his. However the initial transfer would be hefty, So I’d like to know if I could use an external drive and do the initial seeding myself.

  2. 20/01 2012

    If its a backup to a friend’s computer, then you sure can. Set up a backup as normal to an external disk attached to your local PC. Once its up to speed, disconnect the drive and take it along to your mates house. He should have Crashplan installed on his PC as usual with his own ID. Connect your drive to his computer and then fire up Crashplan and go to “incoming” and use the “Attach an Archive” button. Once its connected, some ‘magic’ will happen and the next time you log into your PC, his computer should appear as a “Destination” in your Crashplan GUI. Does that make sense? Hit the Crashplan Support website, there’s lots of info there – this is bound to be covered. Alternatively, I know Kev has a few “friends” backups, so he might have done it for real.

    Sadly, you cant seed Crashplan Central backups unless you’ve got access to a US military base!?!

  3. Nate
    25/07 2012

    Thank you so much for this tutorial. The tutorial on the crashplan website is terrible so this was a huge help.

    Thanks!

  4. 25/07 2012

    Thanks for stopping by Nate, glad it was useful to you! Let me know if there’s anything in Crashplan or Linux that you think might be useful to others and I’ll do my best to write a post on it.

    Cheers,
    Bryan

  5. Geoff
    29/08 2012

    Do you know if this headless operation is possible if the ‘server’ is running Windows?

  6. 30/08 2012

    Hi Geoff – I haven’t tried it, but the same method should work with both a Linux or Windows CrashPlan servers.

  7. Geoff
    31/08 2012

    Tried everything I knew of to make it work on a Windows server. Couldn’t get it to go. Not sure that the required SSH ‘server’ is present in Windows 7?

  8. 31/08 2012

    Sorry Geoff, I hadn’t thought that one all the way through. The principle is sound but, as you suggest, you would need an SSH server capable of port forwarding running on the Windows Crashplan Server – something like http://www.freesshd.com/. Alternatively, I haven’t tested it, but I suspect you might be able to skip SSH completely by changing the “serviceHost” parameter to the IP address of your Crashplan Server and setting the “servicePort” to 4243. That way, the CrashPlan software on your client computer will connect directly to the CrashPlan Server software on your server. So, you config file would look something like this:

    #Fri Dec 09 09:50:22 CST 2005
    serviceHost=192.168.1.10
    servicePort=4243
    #pollerPeriod=1000 # 1 second
    #connectRetryDelay=10000 # 10 seconds
    #connectRetryAttempts=3
    #showWelcome=true

    You’ll need to change “192.168.1.10″ to whatever the IP address is of your Windows Crashplan server. You’ll notice I’ve also removed the ‘#’ from the “serviceHost” parameter (the ‘#’ means ignore this line).

    Let us know how you get on!

  9. Jesse
    3/01 2013

    Thanks for the very thorough instructions. I am hoping this will get me working but I still seem to be a step away. After following your directions, instead of getting “Crashplan could not connect; Retry? Yes/No” prompt at the splashscreen, I get “CrashPlan has been disconnected from the Backup Engine” while it shows the login screen in CrashPlan. Any suggestions?
    Thanks again for a great post!

  10. 3/01 2013

    Hi Jesse, sorry to hear you’re having trouble. It could be a few things. Firstly, if your server is running on a Mac, then try the CrashPlan Support forums as I recall seeing something about a known bug. If its Linux, then does your SSH connection keep running? If the SSH port forwarding is crashing then that would explain the message you’re getting. There’s actually a way to do this without port forwarding that I’ve been testing recently. I’ll throw a quick post together on how to do it and we can see if that helps!

  11. Mark Finzel
    24/02 2013

    Thanks for your reply to my other post! I decided to stick to the SSH route.

    If you don’t mind my asking, are you using CrashPlan Central as your backup destination, or some other location? I was able to successfully get the GUI on Windows to connect to my headless Linux server. I selected my folder and all that worked great. I can even see in the iPhone app and web interface the folder I selected on Linux, so crashplan “knows” what i intended to do. However, it’s just stuck at “waiting for backup” and won’t back up a single file. I’m beginning to wonder if I can use CP Central as a destination on the Linux server. Any ideas?

  12. 25/02 2013

    Hi Mark – glad to be of (some!) help. Yes, I use CrashPlan Central as a backup destination. It sounds like the local network stuff is working fine, but you’ve got some sort of connectivity issue between the server running on your linux host and CrashPlan’s Central service. As far as I remember, I didn’t need to do anything special to get my server working with Central. From memory, the daemon just connects out to Central over port 443, which shouldn’t cause any firewall issues. I’d try restarting the CrashPlan daemon on the Linux host as a first step. After that, I’m afraid you’ll need go take a look at logs (/usr/local/crashplan/log/) – which I haven’t found to be that friendly, but not impossible to read!

  13. 2/04 2013

    [...] Installing CrashPlan on a Headless Linux Server Using the Windows CrashPlan Client to manage a headless Linux server  [...]