[HOWTO] Install JDownloader in a FreeBSD Jail

Status
Not open for further replies.

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Summary
This document will explain how to setup JDownloader in an isolated chroot based jail which is initiated at system boot and runs in the background parallel with FreeNAS. It displays the JDownloader application window using X-Windows and opens on your Windows PC using the Cygwin X-Server (Linux is possible also without Cygwin). Downloaded files are saved on your NAS to a folder from within the 'chroot jail'. It is possible to push out the JDownloader application window across the Internet using an ssh tunnel and control/monitor downloads remotely. JDownloader also has two remote control/web control interfaces you can setup and access remotely to manage downloads.


DUE TO FORUM CONSTRAINTS YOU CAN NOW FIND THIS HOW-TO AT THE LINK BELOW:

[HOWTO] Install JDownloader in a FreeBSD Jail

mod note: this link no longer works, and it's likely that the howto is outdated as well. -JG
 
Last edited by a moderator:
Joined
Oct 11, 2011
Messages
2
Ok, I've tried this with 8.0.1-rc1 and I keep getting an error saying /usr/local/diablo-jre1.6.0/lib/i386/xawt/libmawt.so: shared object "libXext.so.6" not found, required by "libmawt.so" when I run the java commands. Any ideas? I've tried pkg_add -rv linux_base-f10 and pkg_add -rv linux-f10-xorg-libs but it's still missing.
 
Joined
Oct 11, 2011
Messages
2
No, it's x86 freenas and I made sure to grab x86 java from your links, actually downloaded the wrong one first and caught it while it was downloading so I know I have that right. I'll try upgrading to release.
 

O2L

Dabbler
Joined
Oct 23, 2011
Messages
12
hi protosd


- the link for the AMD 64 version return "file not found"

- for the tutorial, now when i start jdownloader with jdownloader.sh, i identify this:

10 10/24/11 11:13:54 AM - INFO [jd.Main(main)] -> init Splash
No protocol specified
Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using '192.168.0.33:0.0' as the value of the DISPLAY variable.

i tried Cygwin X Server and Xming, i think the problem is in client side.

- just to know, jdownloader still running after close Cygwin X Server?
 

O2L

Dabbler
Joined
Oct 23, 2011
Messages
12
hello protosd

sorry for the delay, i format and put my nas in production, now i'm tried your tuto in freenas virtualbox.

i find my mistake, in this part:

"Scroll down to the bottom of the list shown in the image below and select the packages highlighted in red. ALSO, scroll down to near the bottom of that list and SELECT xhost: X.Org server access control utility. The Cygwin base packages are selected by default. "

i didn't see in the Cygwin's installation, it's not just like in the picture, i forget the xhost: X.Org package.

now when i enter the command xhost +, i have this response:
"access control disabled, clients can connect from any host"

The jail is working but jdownloader windows didn't appears in my computer.

I need reinstall freenas in virtualbox with bigger disk, because after apply reboot, i have a lot of this message:
/var: write failed, filesystem is full.
 

kashiwagi

Dabbler
Joined
Jul 5, 2011
Messages
35
I've been thinking about automating the process of creating a jail on FreeNAS. There would have to be some basic inputs (hostname, ip, path to store jail etc), but the rest should be able to automated through scripting.

Would anyone be interested in something like that? The most awesome thing would be jail management from the UI....but that would be a bit much to ask for ;)
 

moritz

Cadet
Joined
Nov 19, 2011
Messages
4
Hello everyone on the FreeNAS forums!

I'm running into a problem with JDownloader on my machine.
The installation went fine and I can also start and control JDownloader using xhost and also the web interface and JD remote control are working fine. The web interface and the RC also keep working after I closed the JDownloader window on my local machine.
However, as soon as I kill the Xserver on my local machine (the one running xhost) they stop working. The jail is still running but I can't access JDownloader and it also doesn't continue downloading...

Any ideas on how to solve this? Letting my remote machine running all the time is, of course, no solution ;).
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Hello Moritz,

I'll have to look into this, I leave it open all the time so it can capture links, but didn't really test disconnecting the display/stopping Xserver. I have some ideas, but I'm trying to finish up another project so I can't look at it for a little bit.

In the mean time, maybe someone else can offer a solution.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Moritz,

I don't have time to test this out right now, but here is a link with a possible solution. If you get this working, let me know and I'll update the HowTo. When I get some more time I'll look into this more because at some point I'm going to need this option to work myself.

http://www.headhole.org/2011/02/23/running-headless-jdownloader/

Adding control for the Jail & JDownloader to the GUI will help because I hope to make some option to restart it from the GUI and possibly set the display. No promises at this point, I have some basic unreliable control from the GUI but it's complicated.
 

moritz

Cadet
Joined
Nov 19, 2011
Messages
4
OK, I just had a look on it myself.. and apparently changing jdownloader.sh from
Code:
export DISPLAY=bla & 
java -Xmx512m -jar /usr/local/jdownloader/JDownloader/JDownloader.jar &

to
Code:
Xvfb :1 & 
java -Xmx512m -jar /usr/local/jdownloader/JDownloader/JDownloader.jar &

(creating a "fake" Xserver for JDownloader) seems to work. :)

If only the web interface were a bit more sophisticated...

EDIT: Oh, wait. I just read your second answer. Yes, that's basically how I do it. However, I couldn't get VNC working (yet). I'll have a look into it.
 

moritz

Cadet
Joined
Nov 19, 2011
Messages
4
Update: I achieved the desired behaviour.
I just installed vnc in the jail via pkg_add.
Then I chrooted to the jail, logged into the admin account, started the vncserver and connected to the vnc server from my local machine. I just started JDownloader from the console and it's working. Web interface and remote control are working and I can close the VNC session and reopen it and JDownloader will be running all the time.

The only thing I couldn't manage was to do all this automatically when starting the jail. Firstly, the vncserver has to be started and after the command returned, JDownloader can be started. For whatever reason, this didn't work..
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Moritz,

Thanks for figuring that all out. That's an interesting solution installing VNC inside the jail, I like it. It should be possible to auto-start VNC and JDownloader, I'll have to look at it later. The one downside to this is that I think Linkgrabber won't work, which I use a lot. Can you confirm that?

One thing I saw mentioned somewhere, and I don't know if it's still true, but someone said if you run it headless that JDownloader will crash if a Captcha pops up.

EDIT: If VNC has an RC script, that should start it before JDownloader because rc.local runs last I think.
 

moritz

Cadet
Joined
Nov 19, 2011
Messages
4
Moritz,

Thanks for figuring that all out. That's an interesting solution installing VNC inside the jail, I like it. It should be possible to auto-start VNC and JDownloader, I'll have to look at it later. The one downside to this is that I think Linkgrabber won't work, which I use a lot. Can you confirm that?
Yep, I can confirm that. However, at least for me uploading .dlc files from the JD web interface works just fine.

One thing I saw mentioned somewhere, and I don't know if it's still true, but someone said if you run it headless that JDownloader will crash if a Captcha pops up.
I haven't observed this since I didn't have any captchas popping up until now.

EDIT: If VNC has an RC script, that should start it before JDownloader because rc.local runs last I think.
OK, I have to check whether there's an RC script coming with the VNC installation.
 

djtomybcn

Cadet
Joined
Dec 5, 2011
Messages
1
Hello protosd,

I installed Jdownloader in my Freenas and it's working (i did the installation tree times, I'm noob in FreeBSD).

Maybe I have a similar problem that moritz… The Jdownloader only works when I have the program running in windows 7 with Cygwin, when I close the jdownloader window (not the cygwin server), all downloads will stop.

I did something wrong? or I have to configure another thing to continue downloads underground?

And only one more thing, It’s possible to show de Jdownloader screen in my pc after close o restart windows?

Thanks a lot for this tutorial.

PD:
I confirm that all the pop-ups captchaps works perfect.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Hello protosd,

I installed Jdownloader in my Freenas and it's working (i did the installation tree times, I'm noob in FreeBSD).

Maybe I have a similar problem that moritz… The Jdownloader only works when I have the program running in windows 7 with Cygwin, when I close the jdownloader window (not the cygwin server), all downloads will stop.

I did something wrong? or I have to configure another thing to continue downloads underground?

And only one more thing, It’s possible to show de Jdownloader screen in my pc after close o restart windows?

Thanks a lot for this tutorial.

PD:
I confirm that all the pop-ups captchaps works perfect.

Hello DJtomybcn,

Thanks for the feedback. You have the same problem as Moritz. The solution he found is in post #18 above, but there is also more information in the link in post #17. Since you're a noob with FreeBSD, it's probably not explained well enough for you to understand. I need to edit the FAQ and add more details.

The only way I know NOW to show JDownloader after you restart Windows is to restart Cygwin-X, and then restart your jail, but this will stop your downloads. I think there is a way, but I will need time to figure it out.

The way Moritz fixed it is highlighted below, but I don't know if Xvfb is installed on FreeNAS already or if he added it. When you do this, JDownloader does not appear on your PC and you need to use the Web interface that I talked about in the post just after the first post with the HowTo.

Xvfb :1 &
java -Xmx512m -jar /usr/local/jdownloader/JDownloader/JDownloader.jar &


EDIT: Xvfb would need to be installed in the Jail, NOT FreeNAS, sorry.
 

PrincePaul

Patron
Joined
Feb 26, 2012
Messages
225
I try to install xorg but....:


Package 'xorg-drivers-7.5' depends on 'xf86-input-keyboard-1.4.0' with 'x11-drivers/xf86-input-keyboard' origin.
pkg_add: could not find package xf86-input-keyboard-1.4.0 !
pkg_add: 1 package addition(s) failed
pkg_add: pkg_add of dependency 'xorg-drivers-7.5' failed!
pkg_add: 1 package addition(s) failed
 

Gigavolt

Cadet
Joined
Nov 18, 2012
Messages
1
Sorry for bumping an old thread, but it seems that the link to your blog is dead, ProtoSD :/

I wanna thank you for a great guide that's helped me a lot in the past, but I could really use it again now - or alternatively news on your JDownloader plugin :)

Thanks in advance and thumbs up.
 
Status
Not open for further replies.
Top