Configuring CrashPlan In FreeNAS Part 1

This post made possible by this, this, and this.

After installing the CrashPlan plugin (I installed via the FreeNAS UI), accept the CrashPlan license agreement by clicking on Plugins -> CrashPlan. Then, start the CrashPlan service via the FreeNAS UI. SSH into the FreeNAS box itself, become root, and run jls:

[root@freenas] ~# jls
   JID  IP Address      Hostname                      Path
     1  -               couchpotato_1                 /mnt/store/jails/couchpotato_1
     3  -               sabnzbd_1                     /mnt/store/jails/sabnzbd_1
     4  -               sickbeard_1                   /mnt/store/jails/sickbeard_1
     5  -               crashplan_2                   /mnt/store/jails/crashplan_2

Next, run jexec 5 /bin/tcsh (5 because that's what jls told me), and adduser to create a new user called crashplan:

root@crashplan_2:/ # adduser
Username: crashplan
.....
Login group is crashplan. Invite crashplan into other groups? []: wheel
....
Username   : crashplan
Password   : *****
Full Name  :
Uid        : 1001
Class      :
Groups     : crashplan wheel
Home       : /home/crashplan
Home Mode  :
Shell      : /bin/tcsh
Locked     : no

By default, jails don't allow you to SSH into them. To enable SSH, open the FreeNAS UI, go to Jails -> View Jails, select the crashplan jail and click on the Shell button near the bottom (looks like an old MS-DOS C: prompt). Then edit /etc/rc.conf and set the value of sshd_enabled to YES.

Then start the SSH daemon:

service sshd start

To make future connections password-less, I copied my public key over the to FreeNAS box (this step isn't necessary if you're willing to type a password everytime):

ssh-copy-id crashplan@192.168.1.2 

CrashPlan should be running headless now. To connect to it, we need to setup port fowarding from another machine. Here, I want to forward port 4200 on my laptop to the CrashPlan server's port 4243.

ssh -L 4200:localhost:4243 crashplan@192.168.1.2 -N -v -v -v

Next, ensure the port forwarding is actually working. From my laptop:

thomas@Thomas-ThinkPad ~ $ telnet localhost 4200
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

Now onto the client. Grab the latest CrashPlan file here. After installation, in /usr/local/crashplan/conf/ui.properties, add the line:

servicePort=4200

When you install CrashPlan you end up installing both the daemon and the desktop. Since you probably don't to run the daemon locally, rename the S99crashplan file in /etc/rc2.d to K99crashplan.

Finally, start CrashPlanDesktop. At first, the CrashPlan splash screen would appear but then just as quickly disappear. Ugh. Some digging led me to /usr/local/crashplan/logs/ui_output.log. Here is the dump:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fca466d91d1, pid=18119, tid=140509115447040
#
# JRE version: OpenJDK Runtime Environment (7.0_51) (build 1.7.0_51-b00)
# Java VM: OpenJDK 64-Bit Server VM (24.45-b08 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libsoup-2.4.so.1+0x6b1d1]  soup_session_feature_detach+0x11
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /usr/local/crashplan/hs_err_pid18119.log
#
# If you would like to submit a bug report, please include
# instructions on how to reproduce the bug and visit:
#   http://icedtea.classpath.org/bugzilla
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

Ugh again. The solution is to add -Dorg.eclipse.swt.browser.DefaultType=mozilla to GUI_JAVA_OPTS in /usr/local/crashplan/bin/run.conf. So the file now looks like:

SRV_JAVA_OPTS="-Dfile.encoding=UTF-8 -Dapp=CrashPlanService -DappBaseName=CrashPlan -Xms20m -Xmx1024m -Djava.net.preferIPv4Stack=true -Dsun.net.inetaddr.ttl=300 -Dnetworkaddress.cache.ttl=300 -Dsun.net.inetaddr.negative.ttl=0 -Dnetworkaddress.cache.negative.ttl=0 -Dc42.native.md5.enabled=false"
GUI_JAVA_OPTS="-Dfile.encoding=UTF-8 -Dapp=CrashPlanDesktop -DappBaseName=CrashPlan -Xms20m -Xmx512m -Djava.net.preferIPv4Stack=true -Dsun.net.inetaddr.ttl=300 -Dnetworkaddress.cache.ttl=300 -Dsun.net.inetaddr.negative.ttl=0 -Dnetworkaddress.cache.negative.ttl=0 -Dc42.native.md5.enabled=false -Dorg.eclipse.swt.browser.DefaultType=mozilla"

Now, after running CrashPlanDesktop, after the splash screen, I get:

Sweet.