GIT – A thread on ubuntuforms.org  , called “HOWTO: Set up VNC server with resumable sessions”, described how to do something that I have been trying to do with Xubuntu for a while.

remote desktop access is easier due to the inclusion of the vino-server. The thread went on for a number of pages and this post attempts to capture all of the bits relevant to getting this working on Xubuntu. This was done on a Fiesty Fawn installation, but should work on Edgy. The objective is

  • to allow remote access to a Xubuntu desktop and,
  • in this case, this will be in the form of a resumable session, and
  • to not use any GNOME libraries.
  1. the required applications:

sudo apt-get install vnc4server xinetd xvnc4viewer

  1. If you do not already have it installed, install ssh, which should bring in the client and the server:

sudo apt-get install ssh

  1. Open the “Login Window” applet in the Applications –> Settings menu. You should be prompted for your to access this.
  2. Choose the “Remote” tab and select one of the options from the Style dropdown. I select Plain.
  3. At the bottom of the tab, there is a button called “Configure XDMCP…”. Click and make sure that the “Honor indirect requests” is NOT selected.
  4. Using your favourite text editor, open /etc/gdm/gdm.conf for editing. You will need superuser privileges, so it should be something like:

sudo vi /etc/gdm/gdm.conf
OR
sudo nano /etc/gdm/gdm.conf

EDIT: The preferred file to edit is gdm.conf-custom as changes made to this file will survive an upgrade of GDM. Of the changes below, you should only need to add the RemoteGreeter line under [daemon] and AllowRemoteRoot under [security]. The [xdmcp] items were already in place.

  1. In this file, in the [daemon] section, uncomment (i.e. remove the leading ‘#’ sign) from the line which starts “RemoteGreeter=/usr/lib/gdm/gdmlogin”.
  2. In the [security] section, I change the AllowRemoteRoot to false.
  3. In the [xdmcp] section, make sure Enable=true and HonorIndirect=false.
  4. Now, to create an entry for xinetd to start each time it receives a connect request, create a file called Xvnc in /etc/xinetd.d. In /etc/xinetd.d/Xvnc, put the following text:

service Xvnc
{
type = UNLISTED
disable = no
socket_type = stream
protocol = tcp
wait = yes
user = root
server = /usr/bin/Xvnc
server_args = -inetd :1 -query localhost -geometry 1024×768 -depth 16 -once -fp /usr/share/fonts/X11/misc -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd
port = 5901
}

EDIT: Important: The text starting at “server_args…” and ending at “…/root/.vncpassword” is all ONE line. If you cut-and-paste, it might paste it as multiple lines instead of one long line.

EDIT2: Add “-extension XFIXES” to the end of the “server_args” line to get past the End of Stream problem.

EDIT3: Also note that the default setting to allow multiple logins in GDM has changed. I had a follow up post about this, but anotherstuart pointed out that it was missing here. See comments. Thanks!

NOTE: The font path in the -fp argument is slightly different from what was in the original thread. If you search in launchpad.net, you’ll find some bugs about this.

  1. Create a password for xinetd, by running

sudo vncpasswd /root/.vncpasswd

  1. Restart xinetd by running:

sudo /etc/init.d/xinetd stop
sudo killall Xvnc
sudo /etc/init.d/xinetd start

You may also need to reboot to get some of the other changes to take effect.

To test that it is working, either

  1. Use

xvnc4viewer :1

to start a session on the machine, or

  1. Connect from another machine using a client like tightvnc.

You should get a graphical login.

NOTE: The session created does not end if you terminate the connection. It persists until you actually log out. This is useful if you are on a connection that drops out or if you login to start a job and need to disconnect without killing the job.

Once this is working, you can also tunnel this over an ssh connection, depending on your required level of paranoia.

Print Friendly

Comments

comments

Bài viết liên quan