Home Server X11 VNC server

Index.

03-Nov-2011: initial release.
12-Dec-2012: adjusted for Slackware.
04-Feb-2014: adjusted for Slackware 14.1.
10-Feb-2014: now uses inetd to start Xvnc.

 

Introduction.

There are times that it is convenient to run X programs from your home server on a remote workstation. If you are on a Linux or Unix machine this is not a problem if you are logged in using ssh and have X11 forwarding enabled. From a Windows machine it is more difficult. You can install Cygwin to run X applications or use a commercial product, but easier is to make the X screen available over the network using the VNC protocol. You can even configure it so that X and VNC are only running on the network. However, to make it secure you need to take some precautions.

 

Installation.

First you need to install Xorg, a desktop environment and some tools. I use XFCE4 because it’s light an low on resources. Desktops like KDE or Gnome are too heavy to run over the network and can really slowdown your server. Keep it simple. As login screen use xdm, not kdm. Using xdm is ugly compared to kdm, but it’s simple and it supports the xdmcp protocol. Make sure it works and set the default runlevel of the server to 4 in /etc/inittab.

Slackware 14.1 has an extra package tigervnc, install it using installpkg tigervnc-1.1.0-i486-1.txz. In that package you find the Xvnc binary, this is an X server with a virtual display. We are going to start the remote X screen with the xdm login screen. But we start it from inetd so that it doesn’t run when we don’t need it.

Uncomment the last line (use a !) in /etc/X11/xdm/xdm-config:

! SECURITY: do not listen for XDMCP or Chooser requests
! Comment out this line if you want to manage X terminals with xdm
!DisplayManager.requestPort:	0

 

Then edit /etc/X11/xdm/Xaccess to uncomment line:

*                                       #any host can get a login window

 

Note that this is not secure, the whole world can now access your X server if you open your firewall for vnc connections. So, don’t allow vnc from he Internet. But if you do need it, use a vpn connection to your home network and then start a vnc session.

If you don’t want a X login screen on the home server, edit /etc/X11/xdm/Xservers and comment out the line:

#:0 local /usr/bin/X :0

 

Next we add a line to /etc/inetd.conf so that we can start the vnc connection:

# VNC
5901	stream	tcp	nowait	nobody	/usr/bin/Xvnc Xvnc -inetd -query 127.0.0
.1 -once securitytypes=none

 

Do a kill -HUP `pidof inetd` to restart inetd.

Now from a Linux machine connected on your local network try it using the following command:

mbroek@mgmtws:/mnt/home/mbroek/Downloads$ vncviewer homsrv.wpl.ym:1

TigerVNC Viewer for X version 1.1.0 - built Oct 11 2013 15:15:44
Copyright (C) 1999-2011 TigerVNC Team and many others (see README.txt)
See http://www.tigervnc.org for information on TigerVNC.

Mon Feb 10 21:14:42 2014
 CConn:       connected to host homsrv.wpl.ym port 5901

 

That’s it.

 

Download.

See the download page for the script and configuration files.