× NETGEAR will be terminating ReadyCLOUD service by July 1st, 2023. For more details click here.
Orbi WiFi 7 RBE973
Reply

Complete guide for JDownloader (and VNC) in OS6

villa1
Tutor

Complete guide for JDownloader (and VNC) in OS6

Hi,

this if my first tip (I hope not last) were I'm going to explain how to install and configure a VNC screen sharing system to get JDownloader (or any X-window application) running.

Below steps are intented to be run with a minimum of Unix/Linux understanding, if you are newbie in Linux, don't try it, you can mess up your NAS!!.

Remember to backup valuable data in your NAS before any attempt to continue reading, it's always better loosing time backing up than crying later 😉

I've tested it both in x86 and ARM processors.

  • First you have to enable SSH within your Netgear NAS: You can loose support in case SSH has been enabled!!!

    After connect through SSH into the server as root (your admin frontview password will be the same for root).

    Let's start with the command line... Wait... have you back up your data already?, no?, well, later on, complains to /dev/null.

    ok, go ahead... Wait... did you understand the joke about /dev/null?, no??, I recommend you to stop here.

    Don't say I didn't warn you about you can mess up your NAS data if you're bit lost with VNC, SSH, root account, package installation skills, /dev/null and you don't have a minimum set of Linux (debian) skills.

    If you are now connected as root into your NAS, remember.
    Big power comes with big responsibility

    If you're still here reading, well... may the force be with you.

    Now I will put a secuence of commands you have to run as root, I will explain them later.
    Note: Run them one by one, understanding what is showing each command. If you don't understand output, stop after running the first.


    There is one change to be done to start.

    Check /etc/apt/sources.list, and include below line and save the file:

    deb http://ftp.se.debian.org/debian/ wheezy main contrib non-free


    Time to install new packages:

    apt-get update
    apt-get install dialog
    apt-get install bzip2
    apt-get install tightvncserver
    apt-get install x11vnc
    apt-get install xvfb
    apt-get install xli
    apt-get install fluxbox menu
    apt-get install fbautostart
    apt-get install unrar
    apt-get install xterm
    mkdir -p /usr/X11R6/bin/Xvfb
    cd /usr/X11R6/bin/Xvfb/
    ln -s /usr/bin/Xvfb .
    apt-get install xmodmap
    apt-get install x11-xserver-utils


    I use vnc through xvfb, it's faster and memory consumption is lower than tightVNC, feel free to use one or another, this document is based on xvfb. Window Manager will be fluxbox, another low-memory-consumption window manager.

  • Now, it's time to install java.
    Download it from Oracle web page from your laptop and copy it into the NAS over AFP or SMB in a folder (Video shared resource for example) and returning to the SSH connection you've opened previously, run the following...
    TIP: there is a way to download Oracle software with wget directly from the NAS (try "wget oracle" in google).

    mkdir  /usr/java
    cd /data/[shared resource where you've placed the jdk downloaded]
    gzip -d jdk-7u6-linux-x64.tar.gz
    tar xvf jdk-7u6-linux-x64.tar
    mv jdk1.7.0_06/ /usr/java/
    update-alternatives --install /usr/bin/java java /usr/java/jdk1.7.0_51/bin/java 1
    java -version


  • Note: "java -version" command has to give an output about current java version that has to be the same as the one installed by you 🙂

    Now, install jDownloader.

    cd /root
    wget http://installer.jdownloader.org/jd_unix_0_9.sh
    chmod 755 jd_unix_0_9.sh
    ./jd_unix_0_9.sh


    It has to give you an output similar to this:


    testing JVM in /usr ...
    Starting Installer ...
    SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
    SLF4J: Defaulting to no-operation (NOP) logger implementation
    SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
    This will install JDownloader on your computer.
    OK [o, Enter], Cancel [c]
    o

    JDownloader Downloadmanager
    JDownloader is distributed in the hope that it will be useful, but without
    any warranty; without even the implied warranty of merchantability or
    fitness for a particular purpose. See the GNU General Public License for
    more details.

    Want to contribute?
    Check out the Sourcecode and "Gettings Started" Developer Tutorial!

    JDownloader is FREE Software.
    If you paid for it you should claim your money back.
    Make sure that you downloaded the official JDownloader Version at
    JDownloader.org.
    Where should JDownloader be installed?
    [/opt/jdownloader]


    Create a desktop icon?
    Yes [y, Enter], No [n]
    n
    Extracting files ...


    Please wait. Completing Systemintegration.
    Setup has finished installing JDownloader on your computer.
    Run JDownloader?
    Yes [y, Enter], No [n]
    n
    Finishing installation ...


    Answers to the above questions are: "o" (to continue), "/opt/jdownloader" (folder where to install it), "n" (to avoid creating destktop icon) and "n" (to don't run jdownload now).


    Time to create vnc password:


    # vncpasswd
    Using password file /root/.vnc/passwd
    VNC directory /root/.vnc does not exist, creating.
    Password: typeyourpasswordhere
    Verify: typeit again
    Would you like to enter a view-only password (y/n)? n



    and the tricky part:

    create the following file into /etc/init.d/jd and set 755 permissions (chmod 755 /etc/init.d/jd). Copy/paste below content:

    #! /bin/sh
    #set -e
    # Run VNC in OS6 by Carlos Villabrille
    export USER="root"
    export PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/var/run/vncserver"
    NAME="jd"

    XVFB="/usr/bin/X11/Xvfb"
    XVFBARGS=":1 -screen 0 1024x700x24 -fbdir /var/run "
    PIDFILE="/var/run/xvfb.pid"

    start()
    {
    echo -n "Starting virtual X frame buffer: Xvfb"
    export DISPLAY=:1
    /sbin/start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile --background --exec $XVFB -- $XVFBARGS
    /bin/sleep 2
    /usr/bin/x11vnc -display :1 -bg -xkb -shared -8to24 -o /var/log/x11vnclog -nolookup -rfbauth /root/.vnc/passwd -forever -nap -many &
    /usr/bin/x-window-manager &
    echo "Conect with vnclient :1"


    }
    stop()
    {
    export DISPLAY=:1
    /usr/bin/x11vnc -R stop
    /sbin/start-stop-daemon --stop --quiet --pidfile $PIDFILE
    }
    case "$1" in
    start)
    echo -n "Starting VNC server (connect with vnc on :1): "
    start
    ;;
    stop)
    echo -n "Stopping VNC Server "
    stop
    ;;
    restart)
    echo -n "Restarting VNC server "
    stop
    start
    ;;
    *)
    echo "Usage: /etc/init.d/$NAME {start|stop|restart}"
    exit 1
    ;;
    esac
    exit 0


    Set it to start on next boot:

    ln -s  /etc/init.d/jd  /etc/rc3.d/S99jd


    Now, it's time to connect through a VNC client to your NAS IP port 5901
    ip_of_your_nas:1

    After login with your prevsiouly set password in the VNC client, open a bash shell (right button and will appear a menu, find "shell" or "bash" option) and run

    /opt/jdownloader/JDLauncher &


    Actually, you can install any X-Window application you need like iceweasel for browsing any graphical application. As you wish.
  • Message 1 of 1
    Top Contributors
    Discussion stats
    • 0 replies
    • 7953 views
    • 1 kudo
    • 1 in conversation
    Announcements