Visokio website     Downloads     Video tutorials     KnowledgeBase  
Printing: PDF Export from Linux OS without a GUI - Visokio Forums
Printing: PDF Export from Linux OS without a GUI
  •     donald June 27, 2014 11:51AM
    There are some additional library dependencies which are required to enable printing and PDF download from mobile Server installations when running on Linux OS without a GUI. You might experience printing Mobile reports with "black images".
    Please follow these instructions to workaround this issue.

    MAIN SOLUTION (should work across different Linux distributions; tested on CentOS and Ubuntu 14.04): Use XVFB

    You need to install these additional packages on your headless Linux machine: xvfb, libxss1
    On Ubuntu Server 14.04 you also need dbus-x11 libnss3 libgconf2-4 libfontconfig libpangocairo-1.0-0 libXcomposite1 libasound2 libxtst6 libcupsmime1 libgtk2.0-0
    sudo apt-get install xvfb libxss1 ...


    Then you just need to start Omniscope Server through this command:
    xvfb-run -a --server-args='-screen 0, 1024x768x24' ./omniscope-server-headless.sh


    If this command fails, run xvfb-run with "-e /dev/stdout" option to see the error messages in the console.
    e.g. in case of Font error you may need to install these additional packages:
    sudo apt-get install -y xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic

    If you are running the Omniscope Server through Upstart background service, in the visokio-omniscope server installation directory modify the _launch.sh file (last line) from:
    "$JAVA_CMD" $JAVA_VM_PARS $ADD_VM_PARS -cp "$JAVA_CP" "$@"
    to
    xvfb-run --server-args='-screen 0, 1024x768x24' "$JAVA_CMD" $JAVA_VM_PARS $ADD_VM_PARS -cp "$JAVA_CP" "$@"

    Then start the service as usual as per instructions http://www.visokio.com/kb/linux-installs
    N.B. xvfb-run seems not compatible with privbind. So if you are using privbind to bind to reserved port (e.g. 80) you need to use an alternative solution: e.g. setting up Linux IPTABLES to redirect port 80 to Omniscope port 8080 see here for reference https://www.frozentux.net/iptables-tutorial/iptables-tutorial.html#REDIRECTTARGET

  • 6 Comments
  • antonio     antonio May 18, 2015 7:52AM
    xvfb-run is not compatible with privbind

    Omniscope ships with a launch script "omniscope-server.init" that uses privbind to allow serving from port 80. This means that printing will not work on a default installation of Omniscope on a headless Linux server after following the above steps.

    If you are using privbind to bind to reserved port (e.g. 80) you need to use an alternative solution: e.g. setting up Linux IPTABLES to redirect port 80 to Omniscope port 8080 see here for reference https://www.frozentux.net/iptables-tutorial/iptables-tutorial.html#REDIRECTTARGET

    sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080
  • antonio     antonio May 18, 2015 12:22PM
    For simplicity we can share a Linux Ubuntu Server virtual machine with Omniscope Server.
    Please ask for access to this.

    This VM has Omniscope Server installed (not activated) and running* as service** on startup.

    Omniscope Update:
    To enable automatic daily Omniscope update*** edit cron rule (sudo crontab -e) removing the # comment .
    To update Omniscope manually, execute the installLatestAlphaBuild_EmailResult_RestartService.sh script
    in the /home/visokio/visokio-omniscope/scripts folder.

    Ubuntu Server 14.04 64 bit VM info:
    Ram: 8192MB
    Disk: 30GB
    network: DHCP
    Hostname: omniscope-server-vm
    Credentials:
    Username: visokio
    Password: visokio

    Omniscope Server:
    Configured 8000MB max memory
    Mobile on port 8080 and 8443
    Admin on port 48443 and 48080
    Credentials:
    Username: admin
    Password: admin

    Notes:
    *It uses xvfb to run Omniscope within a virtual UI environment to enable Mobile Printing.
    **omniscope-server service installed as upstart /etc/init script
    ***(it downloads and installs keeping the previous version)
  •     kiboro July 23, 2015 10:10AM
    This does not work on a brand new install of CentOS 7, Gnome Desktop. Here's how to do it in there:

    # this is the xvfb package on CentOS
    yum -y install xorg-x11-server-Xvfb

    # yeah - you need to add fluffy dice before you can drive this car
    yum -y install libXScrnSaver

    # CentOS has a different convention for this symlink, check you're on 1.0.1e though
    ln -s /usr/lib64/libcrypto.so.1.0.1e /usr/lib64/libcrypto.so.1.0.0

    # now it should work
    xvfb-run --server-args='-screen 0, 1024x768x24' ./omniscope-server-headless.sh
  •     briann August 11, 2015 4:27AM
    Re-visiting this on CentOS as had no luck previously and now it's urgent.

    Tried all the above and still it fails, black blocks on page as expected. We have this working on Ubuntu and it's just fine using the same method.

    Minimal Install with centos and just adding the above required packages.

    I do get the usual message in the console advising bug in Chromium Browser.

    EDIT: Using latest 2.9-beta[Plus] b1753
  •     briann August 11, 2015 6:15AM
    Interestingly, if I use Windows 10 and Microsoft Edge ONLY, it works and I can print or print to a PDF printer. However download as PDF doesn't work either (black page). Also when printing, no error about Chromium Browser on the console.
  • antonio     antonio August 19, 2015 10:06AM
    A solution to use both xvfb and bind your server to port 80 and 443 is to use authbind

    Install authbind, e.g. with sudo apt-get install authbind
    Configure authbind ports:

    sudo touch /etc/authbind/byport/80
    sudo chown visokio /etc/authbind/byport/80
    sudo chmod 755 /etc/authbind/byport/80
    sudo touch /etc/authbind/byport/443
    sudo chown visokio /etc/authbind/byport/443
    sudo chmod 755 /etc/authbind/byport/443


    Then after editing the _launch.sh script file to add xfvb-run command as per main forum post, start Omniscope with:
    authbind --deep ./omniscope-server-headless.sh

    Alternatively configure omniscope-server.conf Upstart service file in init folder to launch Omniscope:

    exec su -s /bin/sh -c 'exec /usr/bin/authbind "$0" "$@"' $USER -- --deep "$INSTALL_DIR/omniscope-server-headless.sh" > $LOG_FILE 2>&1


    See attached script files for reference.

Welcome!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership