[HOW TO] install JDownloader2 GUI vnc

i have created manual for simple installation of JDownloader2 with gui. I hope it helps you if you are interested. Tested on rapsberry pi 2

  1. step install packages:

    sudo apt-get update && sudo apt-get install openbox x11vnc Xvfb -y

  2. create jdownload directory

    mkdir ~osmc/jdownloader

  3. download jdownloader2

    cd ~osmc/jdownloader && wget http://installer.jdownloader.org/JDownloader.jar

  4. download and install Java8

    cd ~osmc && wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u121-b13/e9e7ea248e2c4826b92b3f075a80e441/jdk-8u121-linux-arm32-vfp-hflt.tar.gz

  5. Now extract java8 to /opt directory

    sudo tar zxfv jdk-8u121-linux-x64.tar.gz -C /opt

  6. install java8 so system can use it

    sudo update-alternatives --install "/usr/bin/java" "java" /opt/jdk1.8.0_121/bin/java 1

  7. check if java is installed

    java -version

output:

osmc@osmc:/etc/systemd/system$ java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) Client VM (build 25.121-b13, mixed mode)
osmc@osmc:/etc/systemd/system$
  1. systemd starting unit all file place to /etc/systemd/system

    osmc@osmc:/etc/systemd/system$ cat xvfb.service
    [Unit]
    Description=Xvfb

    [Service]
    ExecStart=/usr/bin/Xvfb :1 -screen 0 1600x900x24
    User=osmc

    [Install]
    WantedBy=multi-user.target

    osmc@osmc:/etc/systemd/system$

    osmc@osmc:/etc/systemd/system$ cat openbox.service
    [Unit]
    Description=Openbox

    [Service]
    Environment=“DISPLAY=:1”
    ExecStart=/usr/bin/openbox-session
    User=osmc

    [Install]
    WantedBy=multi-user.target

    osmc@osmc:/etc/systemd/system$

    osmc@osmc:/etc/systemd/system$ cat vnc.service
    [Unit]
    Description=x11vnc

    [Service]
    ExecStart=/usr/bin/x11vnc -forever -display :1 -xkb
    User=osmc

    [Install]
    WantedBy=multi-user.target

    osmc@osmc:/etc/systemd/system$

    osmc@osmc:/etc/systemd/system$ cat jdownloader.service
    [Unit]
    Description=JDownloader
    Before=shutdown.target
    After=networking.service
    Conflicts=shutdown.target

    [Service]
    Type=forking
    EnvironmentFile=/etc/JDownloader2.cfg
    Environment=DISPLAY=:1
    Restart=no
    TimeoutSec=5min
    IgnoreSIGPIPE=no
    KillMode=process
    GuessMainPID=no
    RemainAfterExit=no
    ExecStart=/sbin/start-stop-daemon --start --quiet --background --make-pidfile --pidfile $PIDFILE --chuid $RUN_AS --exec $COMMAND
    ExecStop=/sbin/start-stop-daemon --stop --quiet --pidfile $PIDFILE
    osmc@osmc:/etc/systemd/system$

Config file for jdownloader2 in /etc/

osmc@osmc:/etc/systemd/system$ cat /etc/JDownloader2.cfg
DESC=“JDownloader 2”
NAME=JDownloader2
COMMAND="/usr/bin/java – -jar /home/osmc/jdownloader/JDownloader.jar"
RUN_AS=osmc
PIDFILE=/var/run/jdownloader.pid
osmc@osmc:/etc/systemd/system$

  1. Always reload systemd daemon if you are making some changes to your config files

    sudo systemctl daemon-reload

  2. If you want autostart after reboot you have to enable services like bellow

    sudo systemctl enable xvfb.service

to check if is enabled use

`sudo systemctl is-enabled xvfb.service`
  1. start all services

    sudo systemctl start xvfb.service
    sudo systemctl start openbox.service
    sudo systemctl start vnc.service
    sudo systemctl start jdownloader.service

5 you can always check with status if the service is running

osmc@osmc:/etc/systemd/system$ `sudo systemctl status vnc.service`
* vnc.service - x11vnc
   Loaded: loaded (/etc/systemd/system/vnc.service; enabled)
   `Active: active (running)` since Mon 2017-04-10 12:51:26 CEST; 6h ago
 Main PID: 301 (x11vnc)
   CGroup: /system.slice/vnc.service
           `-301 /usr/bin/x11vnc -forever -display :1 -xkb -rfbauth /home/osmc/.vnc/passwd
osmc@osmc:/etc/systemd/system$

Notes:

If you would like use password protected vnc you have to create password, but please note vnc has not encrypted communication outside your network you can use ssh tunnel

x11vnc -storepasswd and store to /home/osmc/.vnc/passwd

config file have extra parameter -rfbauth /home/osmc/.vnc/passwd

root@osmc:/etc/systemd/system# cat vnc.service
[Unit]
Description=x11vnc

[Service]
ExecStart=/usr/bin/x11vnc -forever -display :1 -xkb -rfbauth /home/osmc/.vnc/passwd
User=osmc

[Install]
WantedBy=multi-user.target

root@osmc:/etc/systemd/system#

now install vncviewer and enjoy!!! vnc should listen on port yourip:5900