Giter VIP home page Giter VIP logo

nxsession's Introduction

Persistent X sessions using NX

nxsession uses NX 3 and bash scripts to start and manage persistent X sessions. Think of it as screen or tmux for X.

It is better than ssh -X because:

  1. The NX session is not killed if the network disconnects.
  2. It is more responsive as it reduces number of round-trips between the client and server.

It is better than VNC because:

  1. It has much lower bandwidth requirement.
  2. It plays well with multi-monitor setups.

The code is just one bash script each for the viewer and host - nxviewer and nxhost that call NX 3 binaries nxproxy and nxagent respectively. At present, it has been tested on Linux host and Linux/Mac OS X viewer setups. A Windows viewer might be possible using nxlogin.

How to use

Say you have two machines work and home. You are at home and want to run programs on work:

home> nxviewer work:3
# this starts an NX session on work with windows on home.
# by default, it opens xterm from which you launch other programs.
# once you are done, suspend the session with:
home> nxviewer suspend :3
# at work, you can get back the windows with:
work> nxviewer :3

Or, if you are at work and intend to continue on home later:

work> nxviewer :3
# this starts and displays an NX session on work.
# at home, you can move all windows from work with:
home> nxviewer work:3 -f

Install host and viewer on Linux (without root access)

x2go maintains compiled binaries for all NX 3 libraries. For example, rpm's for RHEL are here. Download rpm’s for the appropriate version of RHEL.

  1. libNX_X11-6
  2. libNX_Xcomposite1
  3. libNX_Xdamage1
  4. libNX_Xdmcp6
  5. libNX_Xext6
  6. libNX_Xfixes3
  7. libNX_Xinerama1
  8. libNX_Xpm4
  9. libNX_Xrandr2
  10. libNX_Xrender1
  11. libNX_Xtst6
  12. libXcomp3
  13. libXcompext3
  14. libXcompshad3
  15. nxagent
  16. nxproxy

The viewer needs only nxproxy and libXcomp3, while the host needs all the packages except nxproxy. For a complete host+viewer setup, simply get all packages.

Extract the rpm into a folder:

mkdir nx
cd nx
for rpm in <downloads>/*.rpm; do
    rpm2cpio $rpm | cpio -idmv
done

You should get folders inside nx/ as follows:

etc -> unused
usr ->
  bin -> wrappers for executables
  lib64 -> libraries
    nx ->
      bin -> actual executables
  share -> man pages, docs, etc.

We will remove the wrappers and move the actual executables in their place. The wrappers are probably needed for a full-fledged nxclient-nxserver setup or for x2go. Also, add rpath to the executables so that they can find their libraries. Finally, copy nxviewer and nxhost scripts into the bin folder.

cd usr/bin
mv ../lib64/nx/bin/* .
rm -r ../lib64/nx
patchelf --set-rpath '$ORIGIN/../lib64' nxagent
patchelf --set-rpath '$ORIGIN/../lib64' nxproxy
cp <path to repo>/nxviewer .
cp <path to repo>/nxhost .

Before using nxviewer, add the bin folder to PATH. On the host, make sure the login shell adds the bin folder to PATH by editing the appropriate rc file (~/.bashrc, ~/.profile, ~/.tcshrc). Test your host installation by running ssh <host> -t nxhost from the viewer. It should print nxhost's help message.

Install viewer on Mac OS X

Download the X2Go Client dmg from here and copy nxviewer into the same folder as the nxproxy executable and add the folder to PATH. We have tried to use only common UNIX commands that should be installed on OS X by default. If that is not the case, please open an issue.

Notes

  1. A new session executes ~/.nx/xstartup if available. Else, it will try xterm.
  2. If you closed your terminal and cannot open any new programs in the session, ssh to the remote machine and run env DISPLAY=:<display> xterm &.
  3. If you left the session connected to one machine and want to access it on another, add -f to force the first machine to disconnect.
  4. Run nxviewer -h to see all available commands and options.

nxsession's People

Contributors

mtikekar avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.