Some of us have run across situations where we want to be able to keep user-mode programs running in a Linux TTY session, but still want to be able to manage them remotely through SSH or other means.
One solution is the ‘linuxvnc’ utility, which can grab a TTY session and display it for use in a VNC window. I will be covering this utility, as tested on Ubuntu 7.04 Feisty (although it should work for virtually any distro).
For starters, let’s grab linuxvnc from the repositories with apt:
sudo apt-get install linuxvnc
Once that is done, fire it up: (root access is required to grab TTYs)
Where ‘X’ is the TTY # you want to grab. linuxvnc should indicate that it’s listening on port 5900.
You can now connect with any VNC client, such as RealVNC, KRDC, or whatever. One thing I’ve noted is that KRDC has trouble with linuxvnc sessions if it attempts to use ‘Tight’ VNC encoding. I would recommend using zlib instead.
Of course if you’re using VNC over the Internet, I strongly recommend tunneling it through SSH. That, however, is a tip for another day.