Debian 5 multi-user VNC
- February 20th, 2009
- By Jason Zerbe
- Write comment
I found out a pretty pro way of setting up the equivalent of Windows Remote Desktop for Linux. This allows you to run a multi-user VNC onto a Linux box. I’m using Debian 5 – Lenny – as usual, because I like being able to compress installation procedures into a couple of apt-get commands and a little configuration file editing. Cheers to APT! I had to jot this one down.
I feel much the same way about my desktop/server setups as one of the authors of my source material does.
As a not completely new Linux user I have been frustrated over and over again at all the extra bloat and apps that I will never use that gets loaded onto my system when I do an install. Debian was the second distro that I tried and have used many others since, but I keep coming back. – Azerthoth
Anyways … install from a minimal Debian install. You can get the new Debian 5 at the usual place. Get your apt-get all how you like it, update and upgrade the initial minimal install.
I like my /etc/apt/sources.list like:
deb http://ftp.us.debian.org/debian/ lenny main contrib non-free
deb-src http://ftp.us.debian.org/debian/ lenny main contrib non-freedeb http://security.debian.org/ lenny/updates main
deb-src http://security.debian.org/ lenny/updates main
Replace “lenny” with “etch” if you are still using Debian 4.
Now to the good stuff. A large chuck of the following content has been taken from Azerthoth’s inspiraton article, “A minimal setup with X“. So … mad props to him! You will find my comments interspersed.
apt-get install xserver-xorg-core xorg xfsand accept the defaults.- See Azerthoth’s article (#8) for more information about what type of login manager you want to use. I rolled xdm:
apt-get install xdm - Again I did not want a large X-Window manager package installed on my machine plus a bunch of dependencies. So I went with Fluxbox:
apt-get install fluxbox
The next part of the setup was taken from Daniel Rigal’s article on “How to enable XDM and VNC for Linux and Solaris“. If you want background information on the process see the article for yourself.
vi /etc/X11/xdm/xdm-configand comment out the last line “DisplayManager.requestPort: 0” by adding an “!” on the front.vi /etc/X11/xdm/Xaccessand uncomment the line “#* #any host can get a login window” by removing the first “#”.vi /etc/X11/fs/configand comment out the last line “no-listen = tcp” by putting a “#” in front. Now restart the font server:/etc/init.d/xfs restart.
If you have followed my instructions so far, now it is time to install a VNC server and some dependencies, fonts, and xterm (the X-Window terminal emulator). I will be going with TightVNC.
apt-get install xutils xbase-clients xfonts-base xfonts-75dpi xfonts-100dpi xterm tightvncservervi /etc/X11/xdm/Xservers, comment out all other lines, and add “:0 /usr/bin/Xtightvnc /usr/bin/Xtightvnc -depth 24 -geometry 1280x1024". Modify the 1280×1024 if you want a smaller or larger screen resolution. I think 1280×1024 is about the max resolution you can use comfortably over a broadband connection without experiencing too much network lag. In my LAN it responds just like I am at a physical KVM.
A few final things.
- Restart the font server, “
/etc/init.d/xfs restart“, and the xdm server: “/etc/init.d/xdm restart“. If your iptables are configured correctly you should now be able to connect via tightvnc to your Linux box. - Quoting Daniel Rigal:
None of these three protocols is secure! You should not allow access to them through your firewall. If you want to deploy VNC over the internet you should tunnel it over SSH or some sort of VPN. Doing this is not covered in this document which assumes you are setting this up for use within your LAN or over a private dial-up service.
- Enjoy!