0

Which software should I use, if I want to set up a linux VNC terminal server that works in this way:

The VNC server should be able to accept up to X simultanous connections on the same port 5900. The VNC server should use 640x480 on 8 or 16bit color.

When the VNC server receives the connection, it should start a new "session" for a user, and auto-launch a specific linux application for that user. If the application is killed, crashes, or is exited in any way, user should be disconnected (kicked) from server. If the user disconnect, the application should be killed in a "graceful way", that allows the application to cleanup.

(There should be no way to "pick up" a old session)

Any ideas?

2 Answers2

0

You'd better go with NX. It's just like vnc but optimized, so it's much faster and more fluent on your screen. It's also easier to prepare profiles for your users.

you can set NX so he doesn't allow users to reconnect to an already opened sessions with:

DISABLE_PERSISTENT_SESSION

in the /etc/nxserver/node.conf file.

You can also set the command you want to be started at login in the NX client configuration. You can probably do it in the server configuration but I've never digged that far. Anyway I strongly suggest that you have a look at NX. It's available in centos extra repository and in other major linux distributions. It's based on the work of a commercial product which is partially open sourced. www.nomachine.com

Rosco
  • 455
  • 3
  • 6
  • NX only allows 2 concurrent connections. I want up to 10 concurrent connections. – sebastian nielsen Oct 27 '10 at 09:20
  • use the open source server version (freenx). It allows unlimited connections. – Rosco Oct 27 '10 at 14:46
  • OK, how I do to make FreeNX launch a application in a new session when a user connects? It should be "kiosk-like", so if the application crashes or exits, client should be disconnected. I just want to share a single application to the public. – sebastian nielsen Oct 27 '10 at 17:14
  • Use NODE_AUTOSTART. From the conf file: "This can be set to any executable, which is started after session startup". You can also find plenty of kiosk config in google "nx kiosk". There is also a "nx builder" app which is available for download but I guess it's for the commercial version only, but I'm not sure about this. – Rosco Oct 28 '10 at 09:23
  • Nope, FreeNX is not a solution. Too much settings on client side which gives too much work to lock down on server side. – sebastian nielsen Nov 01 '10 at 16:22
  • Ill stick with the VNC. Any ideas? – sebastian nielsen Nov 01 '10 at 16:22
  • If you want to restrict to a single application, you may want to try [winswitch](http://winswitch.org/) and define your own menu list (see FAQ) with just one application in it. (it supports NX, Xpra, VNC, ..) Feel free to ask if you need tweaks to the UI too. – totaam Jan 02 '12 at 09:16
0

Short answer is that you cannot do this with VNC. Each TCP port will be bound to a unique session. As far as I am aware you will have the same conundrum with Xpra, VNC, NX, etc. (going via a server, like freenx, and connecting via ssh is a workaround but not an ideal one!) You may be able to workaround this by writing a simple load-balancer type of application, but this will still require one port per client.

As for the rest of your question: the dimensions are specified with -screen. For just starting Xvnc with these options, something like this should work:

Xvnc -screen 640x480x8 :100

The Xvnc session and application startup: I would place all this in a script and start it from xinet.d

The tricky part is to prevent users from re-connecting to an existing session. This is a unusual requirement since that is one fundamental feature of VNC. You may be able to get away with parsing the output of the Xvnc process and killing it (with the app) when you see a disconnection event. For killing the Xvnc when the app terminates, just wait for the appication to terminate in your script and kill Xvnc if it is still running at that point.

totaam
  • 202
  • 4
  • 16