Would it be possible to redirect X in order to use Crashplan's UI?

Status
Not open for further replies.

jonandermb

Explorer
Joined
Jan 15, 2014
Messages
76
I don't now if you guys tried but I have this question: Today, trying to connect to my crashplan jail as I have been doing with previous versions (4.3.x), I discovered 4.4.x changed the way the connections are made, yet again.
The last time, I struggled for days in order to get it working and finally, I purchased a pro subscription, in order to backup my stuff on crashplan's servers once I got it working.
Today, I can't connect anymore and I'm afraid it'll take me days to figure it out again, so I had this brilliant idea:
I use crashplan back at home (I use arch linux). while at my work (windows machines) I managed to connect to my crashplan UI by ssh'ing my arch machine, port forward enabled on putty and xming running on the windows machine. I ran crashplan desktop "CrashPlanDesktop &" and bam! There was my crashplan UI in front of me, via ssh X forward.

Today, I tried to do the same, but instead, enabling X11 forward on my crashplan jail and after "pkg install xorg" finished installing all the xorg files and dependencies but no luck: I never get to see the UI.

Anyone care to explain why this happens? And, why are we not looking into this way to ceonnect and configure crashplan on freenas, which is way easier and simple than modifying files on the client side, tunneling, etc?


Thanks!
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Interesting concept, and it sounds at first blush like it should be do-able. This thread from the FreeBSD forums looks like it might have some potential to help, or at least give a push in the right direction. It does make it look like the xorg-vfbserver package would be called for. I expect there would be some additional configuration though.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
So this has me interested--CrashPlan has become actively hostile to being run headless, despite their own website documenting how they say it can be done. Fairly clueless, but nonetheless interested. I'm thinking the idea could even be carried a step further, by configuring a VNC server inside the jail--or better yet, something like noVNC, so a user could just point a web browser at the jail's IP address.

Like I said, though interested, I'm fairly clueless. Some googling brought me to the thread I mentioned above, and based on that, I built a new jail and ran this:
Code:
# pkg update
# pkg upgrade
# pkg install bash nano xorg-vfbserver xfce xkeyboard-config xorg
# Xvfb &

This appears to have started the X server on display 0, but I haven't yet made it further than that.
 

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
I really like this idea. I'm curious though, are the crashplan issues really only related to running headless, or is FreeBSD also an issue?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I think that FreeBSD causes some issues, but the bulk are due to the hacks needed to make it run headless. Witness all the threads here to the effect of "Crashplan upgraded, now I can't connect!" Without exception that I can think of, they're all due to problems connecting from the desktop client to the server on the FreeNAS box. I've managed a bit more progress, though.

Code:
# jexec 9 bash
# pkg install x11vnc fluxbox
# export DISPLAY=:1
# Xvfb :1 -screen 0 1024x768x16 &
# fluxbox &
# x11vnc -display :1 -noshm


Above, 9 is the JID of my x_headless test jail. I ran bash because it supports the export command, while tcsh doesn't. I then fired up a VNC client, pointed it at the IP of my jail, and up came the austerity of fluxbox.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I know I'm going kind of "stream of consciousness" here, but hopefully it'll help anyone else who's interested. I've installed X in a crashplan plugin jail, and I can connect with VNC and use the graphical environment. Can't start the crashplan desktop client yet though. Here's what I've done:
Code:
# pkg update
# pkg upgrade
# pkg install bash nano xorg-vfbserver xkeyboard-config xorg fluxbox x11vnc gtk2


Exit jail, re-enter jail in bash.
Code:
# export DISPLAY=:1
# Xvfb :1 -screen 0 1024x768x16 &
# fluxbox &
# x11vnc -display :1 -noshm


Connect to jail IP using favorite VNC client. Behold the wonder of fluxbox. Right-click on the desktop and select "xterm" from the pop-up window. In the terminal window, cd /usr/pbi/crashplan-amd64/bin. But when I run ./CrashPlanDesktop, it returns (nearly) immediately to the shell prompt without launching anything. I have a couple of log files that might be relevant.
/var/log/crashplan/ui_error.log:
Code:
[root@crashplan_2 /var/log/crashplan]# cat ui_error.log 
Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
    Can't load library: /tmp/.cpswt/libswt-pi-gtk-4234.so
    Can't load library: /tmp/.cpswt/libswt-pi-gtk.so
    no swt-pi-gtk-4234 in java.library.path
    no swt-pi-gtk in java.library.path
    /tmp/.cpswt/libswt-pi-gtk-4234.so: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory

    at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
    at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
    at org.eclipse.swt.internal.gtk.OS.<clinit>(Unknown Source)
    at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)
    at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)
    at org.eclipse.swt.widgets.Display.<clinit>(Unknown Source)
    at com.backup42.desktop.CPDesktop.<init>(CPDesktop.java:266)
    at com.backup42.desktop.CPDesktop.main(CPDesktop.java:200)
[root@crashplan_2 /var/log/crashplan]# 


...and /var/log/crashplan/ui_output.log:
Code:
[root@crashplan_2 /var/log/crashplan]# cat ui_output.log 
Java HotSpot(TM) Client VM warning: Can't detect initial thread stack location - find_vma failed
[11.02.15 14:29:58.098 INFO    main                 root                                    ] *************************************************************
[11.02.15 14:29:58.099 INFO    main                 root                                    ] *************************************************************
[11.02.15 14:29:58.099 INFO    main                 root                                    ] STARTED CrashPlanDesktop
[11.02.15 14:29:58.101 INFO    main                 root                                    ] CPVERSION = 3.6.3 - 1388556100363 (2014-01-01T06:01:40:363+0000)
[11.02.15 14:29:58.101 INFO    main                 root                                    ] ARGS      = [  ]
[11.02.15 14:29:58.103 INFO    main                 root                                    ] LOCALE    = English (United States)
[11.02.15 14:29:58.103 INFO    main                 root                                    ] JVM       = Java(TM) SE Runtime Environment (1.7.0_51-b13, 32-bit)
[11.02.15 14:29:58.103 INFO    main                 root                                    ] OS        = Linux (2.6.16, i386)
[11.02.15 14:29:58.103 INFO    main                 root                                    ] User      = root, /root
[11.02.15 14:29:58.103 INFO    main                 root                                    ] swt.library.path = /tmp/.cpswt
[11.02.15 14:29:58.103 INFO    main                 root                                    ] *************************************************************
[11.02.15 14:29:58.104 INFO    main                 root                                    ] SWT library deleted: /tmp/.cpswt/libswt-pi-gtk-4234.so
[11.02.15 14:29:58.104 INFO    main                 root                                    ] SWT library deleted: /tmp/.cpswt/libswt-gtk-4234.so
[11.02.15 14:29:58.104 INFO    main                 root                                    ] Loading lib/swt.jar, exists=true
[11.02.15 14:29:58.105 INFO    main                 root                                    ] [file:/usr/pbi/crashplan-amd64/share/crashplan/lib/com.backup42.desktop.jar, file:/usr/pbi/crashplan-amd64/share/crashplan/lang/, file:/usr/pbi/crashplan-amd64/share/crashplan/skin/, file:/usr/pbi/crashplan-amd64/share/crashplan/lib/swt.jar]
[11.02.15 14:29:58.677 ERROR   main                 com.backup42.desktop.CPDesktop          ] Failed to launch CPDesktop; java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
    Can't load library: /tmp/.cpswt/libswt-pi-gtk-4234.so
    Can't load library: /tmp/.cpswt/libswt-pi-gtk.so
    no swt-pi-gtk-4234 in java.library.path
    no swt-pi-gtk in java.library.path
    /tmp/.cpswt/libswt-pi-gtk-4234.so: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory
, java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
    Can't load library: /tmp/.cpswt/libswt-pi-gtk-4234.so
    Can't load library: /tmp/.cpswt/libswt-pi-gtk.so
    no swt-pi-gtk-4234 in java.library.path
    no swt-pi-gtk in java.library.path
    /tmp/.cpswt/libswt-pi-gtk-4234.so: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory

java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
    Can't load library: /tmp/.cpswt/libswt-pi-gtk-4234.so
    Can't load library: /tmp/.cpswt/libswt-pi-gtk.so
    no swt-pi-gtk-4234 in java.library.path
    no swt-pi-gtk in java.library.path
    /tmp/.cpswt/libswt-pi-gtk-4234.so: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory

    at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
    at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
    at org.eclipse.swt.internal.gtk.OS.<clinit>(Unknown Source)
    at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)
    at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)
    at org.eclipse.swt.widgets.Display.<clinit>(Unknown Source)
    at com.backup42.desktop.CPDesktop.<init>(CPDesktop.java:266)
    at com.backup42.desktop.CPDesktop.main(CPDesktop.java:200)

[11.02.15 14:29:58.677 ERROR   main                 root                                    ] Failed to launch CPDesktop; java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
    Can't load library: /tmp/.cpswt/libswt-pi-gtk-4234.so
    Can't load library: /tmp/.cpswt/libswt-pi-gtk.so
    no swt-pi-gtk-4234 in java.library.path
    no swt-pi-gtk in java.library.path
    /tmp/.cpswt/libswt-pi-gtk-4234.so: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory


Contrary to what this log states, /tmp/.cpswt/libswt-pi-gtk-4234.so and /tmp/.cpswt/libswt-pi-gtk.so do both exist, and file reports they're both shared object files:
Code:
[root@crashplan_2 /tmp/.cpswt]# ls -l
total 193
-rwxr-xr-x  1 root  wheel   11252 Nov  2 14:29 libswt-gtk-4234.so
-rwxr-xr-x  1 root  wheel  376688 Nov  2 14:29 libswt-pi-gtk-4234.so
[root@crashplan_2 /tmp/.cpswt]# file libswt-gtk-4234.so 
libswt-gtk-4234.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped
[root@crashplan_2 /tmp/.cpswt]# file libswt-pi-gtk-4234.so 
libswt-pi-gtk-4234.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
Well, this thing uses java, no wonder it keeps crashing...
 

jonandermb

Explorer
Joined
Jan 15, 2014
Messages
76
Well, let me say, for what I know from the experience I've got with crashplan on arch. On arch you've got the daemon mode, even on Windows, there's a service that's completely independent from the ui. I like how danb35 described it: despite of being documented on their site, code42 makes it really hostile to configure the service when headless.

I guess we'll have to guess which dependencies the ui requires. My problem is that, aside from the idea, I'm very limited on freebsd knowledge. I'd like to have some more verbosity when i try to launch the interface. Seems like we are all having the same behavior when launching it, despite of trying via ssh, tunneling the X, or via vnc using fluxbox, but I'm confident once we get it to work, it could be easier than the damn methods we have been using lately. I'm back at home, but tomorrow at work I'll try again and dig some information.

I'm really glad you guys like the idea :)
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Well, to paraphrase Churchill, CrashPlan is the worst cloud backup solution around for FreeNAS, except for all the others. It can be made, with some frustration, to run on FreeNAS. It has a pretty GUI. And it's cheap, at $50/year for unlimited storage and bandwidth.

On the downside, as you note, it's Java, so it's about as stable as Miley Cyrus. It depends on customized settings in the run.conf file, but cheerfully overwrites that file with the default settings when it (without warning) updates itself. It's actively hostile to a headless application, even though their own website has "official" instructions for doing this. I'm sure this only scratches the surface of the issues with it, but even these are significant.

So I have X installed in a crashplan plugin jail. I can VNC to it, and I even have noVNC installed to I can access it with just a web browser. But the desktop client app won't launch due to some apparent library issues. I think I'll take a break from working on this for a bit.
 

jonandermb

Explorer
Joined
Jan 15, 2014
Messages
76
UPDATE: I have been trying all morning long to install Arch 64 bit on a virtualbox jail: I must give up. I encountered a serious problem: The VM crashes randomly from time to time generating serious problems. The first time, I had already installed the base system and rebooted: Everything seemed fine. i configured the network to have a static ip, connected via ssh and was ready to install the crashplan app and xorg dependencies. Suddenly, I got disconnected and the VM completely failed and crashed. On phpvirtualbox, I could see the "aborted" message under the VM name. After dealing with dependencies and files that were created before the installation and were to be removed manually, I decided to start from scratch. Anyway... I lost 4 hours there (im not that slow, I was just doing it between my tasks at my work).

The second time I've been more careful. Performed a memtest for 60+ minutes with no errors. When proceeding to install the base system, the VM hang again: I can't rely on this system. A quick search on this forums revealed indeed, the VirtualBox implementation is to be taken with a frigging big grain of salt: They have hopes for the upcoming 10 version and a better virtualization system, so yeah.... I'll have to forget about this option and try again to redirect the damn X via ssh as I proposed on this thread initially. sigh......
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
In VirtualBox, try checking the box for "use host I/o cache" in the settings for the virtual drive. With this set, VB works well for me.
 

jonandermb

Explorer
Joined
Jan 15, 2014
Messages
76
In VirtualBox, try checking the box for "use host I/o cache" in the settings for the virtual drive. With this set, VB works well for me.


That seems to work. Thak you! I'm having some weird network behaviour still, however. If anyone knows the solution, feel free to comment!


update on my attempts. I installed swt on arch virtual machine: looks like the missing dependency on our crashplan jails. Now, the problem I run into is that the UI tries to start but it does not find the ui_info file. Doesn't it have to be generated for starters? I don't know why is it doing this. I will try to dig a bit more, if I can't manage to fix it, I might try to launch crashplan on a vm running arch with a DE and copy over the files crashplan complains about.


UPDATE: I was trying on mac. I hate mac although I have to work and manage Apple machines. Anyway. I tried to do it from a linux vm and bam! Now I'm in front of the prompt. It seems to work on the arch VM via virtualbox jail!

I'll test around a bit and see what I can and can't do. I'll keep you posted!
 
Last edited:
Status
Not open for further replies.
Top