Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Let me give a summary of my project specification. I have a windows server and bunch of debian clients on the same LAN, Debian machines do not have x window system, they are bound to command line use. I am running a QT application on system start so user only interacts with my GUI before he sees anything else.

According to my project requirements, we should allow system admins to view what end user is doing in debian machines at any time, therefore he should be able to see their screens at any time. He will be using a windows machine to do that. Therefore I am wondering if it is possible to share debian's screen with a windows server, and what would be involved in that.

Do I need VNC server setup on debian machines to accomplish that? Is there any other way?

share|improve this question
    
Does the QT app only run on the console? –  Tim Sep 5 '12 at 16:58
    
yes it is being run from the console since there is no GUI. –  erin c Sep 5 '12 at 17:20
    
The normal way to share an existing X session through VNC is with something like x11vnc. However, if you're not using X, and are instead running Qt embedded directly on the Linux framebuffer, x11vnc won't help you. I don't think there are any existing tools that will share a Linux framebuffer via VNC. Qt can be compiled with VNC server support, but as far as I understand this would replace your existing framebuffer display, rather than working simultaneously. –  Jim Paris Sep 5 '12 at 17:38
    
that's a bummer, I hope I can find a way to solve this problem. –  erin c Sep 5 '12 at 18:01
add comment

1 Answer

up vote 1 down vote accepted

In the case you only have terminal usage on the client side (you said that you have no kind of xserver running on the client hosts) I have a suggestion how you can achieve this. It's actually a minimal but easily expandable example that shows how you can monitor a terminal session on a remote host. I don't know any special software for that and probably there are a number of ways to achieve this more elegant, so please do not expect to much.

My first advice is to install rootsh on the client side.

It's a wrapper for shells which logs all echoed keystrokes and terminal output to a file and/or to syslog [rootsh website]

Unfortunately your debian repository is not packed with it, so you have to make your own binaries. Which is easy to achieve since rootsh has no fancy dependencies. Further more you need socat, a tool for bidirectional data transfer.

If you invoke rootsh like

./rootsh -i -f logfile

a new login shell starts an everything echoed on the terminal from this shell or any child process is written into logfile (also special characters originally intended for the tty).

Now you can create a TCP-socket on the client with

socat OPEN:logfile,ioreeof TCP-LISTEN:22222,fork

from which you can read from the admin's host. For instance with

 socat TCP:clientdomain:22222 STDOUT

or with netcat i.e. telnet (windows binaries for socat are available).

In the case you want to have a more secure data stream between the nodes you can also instruct socat to encrypt it via OPENSSL. You can find a great explanation on this in the article Securing Traffic Between two Socat Instances Using SSL.

I admit that my approach has several flaws, but it suffices to illustrate what's possible without any special tools.

share|improve this answer
    
Thanks for the thorough explanation, I will give it a try whenever I have chance and will let you know. –  erin c Sep 5 '12 at 17:50
    
One question though, I don't think that I will be able to monitor my program's GUI with your method, even though debian does not have x window system, when my program launches from command line, it launches its own GUI. So you interact with a GUI, Will I be able to view users actions on this GUI? –  erin c Sep 5 '12 at 17:57
    
if it's a textbased gui it's no problem since all terminal characters are transmitted. It is textbased, isn't it :) –  user1146332 Sep 5 '12 at 18:02
    
unfortunately it's not a text based GUI:) I guess there's no easy way of solving this problem –  erin c Sep 5 '12 at 18:04
    
So Qt could access your video-cards framebuffer directly!? That would be crazy! –  user1146332 Sep 5 '12 at 18:09
show 6 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.