NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
boz0
Oct 13, 2010Aspirant
JDownloader quick howto
Technically, this isn't an addon, but since it's about an app that's been requested several times as an addon, I figure this post has its place here.
Since JDownloader isn't yet a client/server app (it's in their todo list), and since I haven't found any serious alternatives (Tucan's CLI isn't quite up to speed yet, and development seems at best very slow), I decided to run JDownloader directly on my Ultra 4. The general idea is to install java on the readynas, then run jdownloader in a virtual X11 environment using xvfb to minimize required resources. Here's a quick'n'dirty rundown on how to get it to work, with no warranties whatsoever. Whatever you do, you do at your own risk!
- enable root ssh access to the readynas (warning : support can refuse to help you if you've enabled root access to the nas), using the EnableRootSSH plugin (http://www.readynas.com/?p=4203)
- login as root via ssh on the nas
- add the following line to /etc/apt/sources.list (thanks to this post : viewtopic.php?f=35&t=45891&start=0) :
- set debconf to run interactively by running the following command and then selecting "readline" :
- install java 6 :
- once this is over, return debconf to non-interactive mode :
- install xvfb if it isn't installed already (can't remember whether it was already there) :
- add a few necessary libs to avoid grief later on
- download the official jdownloader install script from here : http://212.117.163.148/jd.sh (or see direct link here : http://jdownloader.org/download/index)
- set up a X11 server on your PC so that you can export your display (Linux : it's already there, MacOS : X11 included on the second DVD IIRC, Windows : download Xming from here : http://sourceforge.net/projects/xming/)
- on the readynas, export your display and run the jd.sh script :
- JDownloader will then be downloaded, installed and updated on your NAS. You should get the window on your PC's X display
- in JDownloader's settings, activate the JDWebInterface plugin and configure it (I suggest SSL and a robust password if you intend to make that interface visible from the outside)
- in JDownloader's settings, click the checkboxes for the TOS for all the file hosters (since we'll be running it headless, we won't be able to validate the TOS directly)
- check that you can connect through your browser
- edit the jd.sh script and replace all 512m entries by 128m, as we don't want it eating too much memory (simple replace with vi : ":%s/512m/128m/g")
- run the jd.sh script through xvfb:
The last step is to setup jdownloader to restart when the nas reboots, which can be accomplished easily by setting a startup script in /etc/rc3.d (and which I'll have to do ASAP).
I'll try to answer questions in this thread if you have any.
Since JDownloader isn't yet a client/server app (it's in their todo list), and since I haven't found any serious alternatives (Tucan's CLI isn't quite up to speed yet, and development seems at best very slow), I decided to run JDownloader directly on my Ultra 4. The general idea is to install java on the readynas, then run jdownloader in a virtual X11 environment using xvfb to minimize required resources. Here's a quick'n'dirty rundown on how to get it to work, with no warranties whatsoever. Whatever you do, you do at your own risk!
- enable root ssh access to the readynas (warning : support can refuse to help you if you've enabled root access to the nas), using the EnableRootSSH plugin (http://www.readynas.com/?p=4203)
- login as root via ssh on the nas
- add the following line to /etc/apt/sources.list (thanks to this post : viewtopic.php?f=35&t=45891&start=0) :
deb http://archive.ubuntu.com/ubuntu dapper-backports main multiverse
- set debconf to run interactively by running the following command and then selecting "readline" :
dpkg-reconfigure debconf
- install java 6 :
apt-get update
apt-get install sun-java6-jre sun-java6-jdk
- once this is over, return debconf to non-interactive mode :
dpkg-reconfigure debconf
- install xvfb if it isn't installed already (can't remember whether it was already there) :
apt-get install xvfb
- add a few necessary libs to avoid grief later on
apt-get install libxtst6 libxi6
- download the official jdownloader install script from here : http://212.117.163.148/jd.sh (or see direct link here : http://jdownloader.org/download/index)
- set up a X11 server on your PC so that you can export your display (Linux : it's already there, MacOS : X11 included on the second DVD IIRC, Windows : download Xming from here : http://sourceforge.net/projects/xming/)
- on the readynas, export your display and run the jd.sh script :
export DISPLAY=your.pc.ip.address:0
chmod 755 jd.sh
./jd.sh
- JDownloader will then be downloaded, installed and updated on your NAS. You should get the window on your PC's X display
- in JDownloader's settings, activate the JDWebInterface plugin and configure it (I suggest SSL and a robust password if you intend to make that interface visible from the outside)
- in JDownloader's settings, click the checkboxes for the TOS for all the file hosters (since we'll be running it headless, we won't be able to validate the TOS directly)
- check that you can connect through your browser
- edit the jd.sh script and replace all 512m entries by 128m, as we don't want it eating too much memory (simple replace with vi : ":%s/512m/128m/g")
- run the jd.sh script through xvfb:
nohup xvfb-run ./jd.sh &
The last step is to setup jdownloader to restart when the nas reboots, which can be accomplished easily by setting a startup script in /etc/rc3.d (and which I'll have to do ASAP).
I'll try to answer questions in this thread if you have any.
14 Replies
Replies have been turned off for this discussion
- giovannipAspirantThanks for the useful post!!
When I run "nohup xvfb-run ./jd.sh &" I get always "xvfb-run: error: xauth command not found", any idea ?
Also any news with the rc3.d script ? I'm not a linux wizard ....
Regards
G - boz0AspirantMake sure /usr/bin is in your PATH variable (echo $PATH), and make sure the xbase-clients package is installed (apt-get install xbase-clients).
- cholo12Aspirantreally nice how to, is there a way to get jdownloader running on readynas duo? I know that has a different processor architecture but maybe it can run under sablevm, you seem to be really skilled on linux use and besides my knoweledge is pretty limited maybe you could guide me.
I managed to install sablevm on my duo but I got errors running the script related to unsuported java -Xmx512m, I removed -Xmx512m entries but when I run the script seems to be doing nothing.
thanks in advance for your help. regards. - giovannipAspirant
boz0 wrote: Make sure /usr/bin is in your PATH variable (echo $PATH), and make sure the xbase-clients package is installed (apt-get install xbase-clients).
Thanks this solved the issue! unfortunatly now if I don't keep running xming JDownloader closes .... any workaround on this ?
regards
G - boz0Aspirant
cholo12 wrote: really nice how to, is there a way to get jdownloader running on readynas duo? I know that has a different processor architecture but maybe it can run under sablevm, you seem to be really skilled on linux use and besides my knoweledge is pretty limited maybe you could guide me.
I managed to install sablevm on my duo but I got errors running the script related to unsuported java -Xmx512m, I removed -Xmx512m entries but when I run the script seems to be doing nothing.
thanks in advance for your help. regards.
I'm afraid my knowledge of java virtual machines is rather limited. Maybe you should look in the sablevm documentation to find the correct option for specifying a VM's max memory.
Good luck, and remember that the duo's CPU might be a bit slow to run a somewhat heavy java process. :) - boz0Aspirant
giovannip wrote: boz0 wrote: Make sure /usr/bin is in your PATH variable (echo $PATH), and make sure the xbase-clients package is installed (apt-get install xbase-clients).
Thanks this solved the issue! unfortunatly now if I don't keep running xming JDownloader closes .... any workaround on this ?
That's because you're running jdownloader as a client of your xming X server. Shutting down the X server automatically kills any attached clients.
The workaround is to run it inside xvfb instead of attaching it to your X display. Xvfb is a virtual display entirely contained in the readynas' memory. That way, you don't get the jdownloader's usual display, but if you've configured it correctly, you can still access it via the web interface. - giovannipAspirantUnfortunatly I got this error when run "nohup xvfb-run ./jd.sh &"
10 12/12/10 6:18:49 PM - INFO [jd.Main(main)] -> init Splash
Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using ':99' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.access$100(X11GraphicsEnvironment.java:52)
at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:155)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:131)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68)
at sun.awt.X11.XToolkit.<clinit>(XToolkit.java:91)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at java.awt.Toolkit$2.run(Toolkit.java:836)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:828)
at java.awt.Toolkit.getEventQueue(Toolkit.java:1678)
at java.awt.EventQueue.isDispatchThread(EventQueue.java:807)
at javax.swing.SwingUtilities.isEventDispatchThread(SwingUtilities.java:1336)
at jd.gui.swing.GuiRunnable.start(GuiRunnable.java:103)
at jd.gui.swing.GuiRunnable.waitForEDT(GuiRunnable.java:67)
at jd.Main.main(Unknown Source)
Any idea ?
Thanks again
G - boz0AspirantSounds like a xvfb problem, not a jdownloader-related problem.
You can try the xvfb settings by running a simple X program like xterm (apt-get install xterm). Launch it with "xvfb-run xterm" and see whether it throws an error. - giovannipAspirantHere the result I get:
nas-djworld2:~# nohup xvfb-run xterm
nohup: appending output to `nohup.out'
nas-djworld2:~#
nas-djworld2:~# cat nohup.out
Warning: This program is an suid-root program or is being run by the root user.
The full text of the error or warning message cannot be safely formatted
in this environment. You may get a more descriptive message by running the
program as a non-root user or by removing the suid bit on the executable.
xterm Xt error: Can't open display: %s
/usr/bin/xvfb-run: line 158: kill: (30773) - No such process - icyAspiranthi,
So, 9 months later, is there some return on experience ?
Is somenone use it every day? JDownloader doesn't cosume to much memory, forcing the nas to reboot every week? etc...
thx.
Related Content
NETGEAR Academy
Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!