# Debain, VNC server connection issues



## LightWrath

Good evening there

Recently I've been trying to setup a debain 6.04 server with remote KVM and VNC access

Now after having many other problems which I've gotten around I've hit an issue in installing a VNC server with Gnome desktop environment. Now I'm generally a windows user, so linux I can refer to as a challenge.

Anyway here's how I've currently setup the VNC server (TightVNCserver)

Firstly I've installed Gnome 
Entered the following commands in SSH.

apt-get install gnome
apt-get install nano
apt-get install TightVNCserver
vncserver
*password* set the password for the server
n (apon question of running in veiw only mode)
vncserver -kill :1
nano /root/.vnc/xstartup
> (Change file to this)

#!/bin/sh

xrdb $HOME/.Xresources
xsetroot -solid grey
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
gnome-session &
export XKL_XMODMAP_DISABLE=1
/etc/X11/Xsession

CTRL + X
Y (Save)
>
vncserver :1 (Open the server on display 1)

Once that has been completed, going to the client and entering the ip and port EG (137.213.13.17:1)

However this fails to connect.

I'm unable to test from another client

I have opened the ports 5500-5905 on my home router
disabled windows firewall

I've been able to connect to another vnc server about 3 weeks ago fine, then changed the server and had to setup again.

On the VNC server logs, we have this.

nano /root/.vnc/domain:1.log

08/02/12 20:24:29 Xvnc version TightVNC-1.3.9
08/02/12 20:24:29 Copyright (C) 2000-2007 TightVNC Group
08/02/12 20:24:29 Copyright (C) 1999 AT&T Laboratories Cambridge
08/02/12 20:24:29 All Rights Reserved.
08/02/12 20:24:29 See http://www.tightvnc.com/ for information on TightVNC
08/02/12 20:24:29 Desktop name 'X' (IPADDRESS:1)
08/02/12 20:24:29 Protocol versions supported: 3.3, 3.7, 3.8, 3.7t, 3.8t
08/02/12 20:24:29 Listening for VNC connections on TCP port 5901
xrdb: No such file or directory
xrdb: can't open file '/root/.Xresources'
Option "--login" is no longer supported in this version of gnome-terminal; you $
Xlib: extension "RANDR" missing on display ":1.0".
Xlib: extension "RANDR" missing on display ":1.0".
gnome-session[2394]: WARNING: GSIdleMonitor: IDLETIME counter not found
Xlib: extension "RANDR" missing on display ":1.0".
Xlib: extension "RANDR" missing on display ":1.0".

** (gnome-settings-daemon:2484): WARNING **: Unable to start xrandr manager: Ra$
Xlib: extension "RANDR" missing on display ":1.0".
GNOME_KEYRING_CONTROL=/tmp/keyring-X7j13w

Xlib: extension "RANDR" missing on display ":1.0".
GNOME_KEYRING_CONTROL=/tmp/keyring-X7j13w
GNOME_KEYRING_PID=2491
GNOME_KEYRING_CONTROL=/tmp/keyring-X7j13w
SSH_AUTH_SOCK=/tmp/keyring-X7j13w/ssh
GNOME_KEYRING_CONTROL=/tmp/keyring-X7j13w
SSH_AUTH_SOCK=/tmp/keyring-X7j13w/ssh
Xlib: extension "RANDR" missing on display ":1.0".
Xlib: extension "RANDR" missing on display ":1.0".
Xlib: extension "RANDR" missing on display ":1.0".
Xlib: extension "RANDR" missing on display ":1.0".

** (gnome-power-manager:2482): WARNING **: No idle counter.
The program 'gnome-power-manager' received an X Window System error.
This probably reflects a bug in the program.
The error was 'XSyncBadCounter'.
(Details: serial 104 error_code 129 request_code 133 minor_code 5)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line

that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)

** (gnome-settings-daemon:2484): WARNING **: Neither XKeyboard not Xfree86's ke$
no way to support keyboard autorepeat rate settings

** (gnome-settings-daemon:2484): WARNING **: XKB extension not available

** (gnome-settings-daemon:2484): WARNING **: Neither XKeyboard not Xfree86's ke$
no way to support keyboard autorepeat rate settings
Xlib: extension "XInputExtension" missing on display ":1.0".
Xlib: extension "XInputExtension" missing on display ":1.0".
Xlib: extension "XInputExtension" missing on display ":1.0".
Xlib: extension "XInputExtension" missing on display ":1.0".
Xlib: extension "XInputExtension" missing on display ":1.0".
Xlib: extension "XInputExtension" missing on display ":1.0".
Xlib: extension "XInputExtension" missing on display ":1.0".
Xlib: extension "XInputExtension" missing on display ":1.0".

Xlib: extension "XInputExtension" missing on display ":1.0".
Xlib: extension "XInputExtension" missing on display ":1.0".
Xlib: extension "RANDR" missing on display ":1.0".
Window manager warning: Failed to read saved session file /root/.config/metacit$
Window manager warning: Log level 32: could not find XKB extension.
Window manager warning: Screen 0 on display ":1.0" already has a window manager$
Xlib: extension "RANDR" missing on display ":1.0".
Xlib: extension "RANDR" missing on display ":1.0".
Window manager warning: Failed to read saved session file /root/.config/metacit$
Window manager warning: Log level 32: could not find XKB extension.
Window manager warning: Screen 0 on display ":1.0" already has a window manager$
Xlib: extension "RANDR" missing on display ":1.0".
Xlib: extension "RANDR" missing on display ":1.0".

** (gnome-user-share:2589): WARNING **: gnome-user-share cannot be started as r$
Xlib: extension "RANDR" missing on display ":1.0".
Xlib: extension "RANDR" missing on display ":1.0".
Xlib: extension "RANDR" missing on display ":1.0".
Xlib: extension "RANDR" missing on display ":1.0".
Xlib: extension "RANDR" missing on display ":1.0".

Xlib: extension "RANDR" missing on display ":1.0".
Xlib: extension "RANDR" missing on display ":1.0".
Xlib: extension "RANDR" missing on display ":1.0".
gnome-terminal: Fatal IO error 11 (Resource temporarily unavailable) on X serve$
kerneloops-applet: Fatal IO error 11 (Resource temporarily unavailable) on X se$
nm-applet: Fatal IO error 104 (Connection reset by peer) on X server :1.0.
gnome-settings-daemon: Fatal IO error 104 (Connection reset by peer) on X serve$
gdu-notification-daemon: Fatal IO error 111 (Connection refused) on X server :1$
GConf Error: Failed to contact configuration server; the most common cause is a$

** (update-notifier:2591): WARNING **: not starting for system user

GConf Error: Failed to contact configuration server; the most common cause is a$
GConf Error: Failed to contact configuration server; the most common cause is a$
GConf Error: Failed to contact configuration server; the most common cause is a$

** (gnome-screensaver:2607): WARNING **: Error retrieving configuration key '/a$

** (gnome-screensaver:2607): WARNING **: Error retrieving configuration key '/a$
GConf Error: Failed to contact configuration server; the most common cause is a$

** (gnome-screensaver:2607): WARNING **: Error retrieving configuration key '/a$
GConf Error: Failed to contact configuration server; the most common cause is a$

** (gnome-screensaver:2607): WARNING **: Error retrieving configuration key '/d$

** (gnome-screensaver:2607): WARNING **: Error retrieving configuration key '/d$
GConf Error: Failed to contact configuration server; the most common cause is a$

** (gnome-screensaver:2607): WARNING **: Error retrieving configuration key '/d$

** (gnome-screensaver:2607): WARNING **: Error retrieving configuration key '/a$

** (gnome-screensaver:2607): WARNING **: Error retrieving configuration key '/a$

** (gnome-screensaver:2607): WARNING **: Error retrieving configuration key '/a$

** (gnome-screensaver:2607): WARNING **: Error retrieving configuration key '/a$

** (gnome-screensaver:2607): WARNING **: Error retrieving configuration key '/a$

** (gnome-screensaver:2607): WARNING **: Error retrieving configuration key '/a$

** (gnome-screensaver:2607): WARNING **: Error retrieving configuration key '/a$

** (gnome-screensaver:2607): WARNING **: Error retrieving configuration key '/a$

** (gnome-screensaver:2607): WARNING **: Error retrieving configuration key '/a$

** (gnome-screensaver:2607): WARNING **: Error retrieving configuration key '/a$
bluetooth-applet: Fatal IO error 11 (Resource temporarily unavailable) on X ser$

** (gnome-screensaver:2607): WARNING **: Error retrieving configuration key '/a$

** (gnome-screensaver:2607): WARNING **: Error retrieving configuration key '/a$

** (gnome-screensaver:2607): WARNING **: Error retrieving configuration key '/a$
gnome-screensaver: Fatal IO error 11 (Resource temporarily unavailable) on X se$

(polkit-gnome-authentication-agent-1:2613): Gtk-WARNING **: cannot open display$
The application 'gnome-session' lost its connection to the display :1.0;

(polkit-gnome-authentication-agent-1:2613): Gtk-WARNING **: cannot open display$
The application 'gnome-session' lost its connection to the display :1.0;
most likely the X server was shut down or you killed/destroyed
the application.
The application 'nautilus' lost its connection to the display :1.0;
most likely the X server was shut down or you killed/destroyed
the application.

(xdg-user-dirs-gtk-update:2615): Gtk-WARNING **: cannot open display: :1.0

(evolution-alarm-notify:2601): Gtk-WARNING **: cannot open display: :1.0

(gnome-panel:2565): GVFS-RemoteVolumeMonitor-WARNING **: cannot connect to the $

(gnome-panel:2565): GVFS-RemoteVolumeMonitor-WARNING **: cannot connect to the $

(gnome-panel:2565): GVFS-RemoteVolumeMonitor-WARNING **: cannot connect to the $
GConf Error: Failed to contact configuration server; the most common cause is a$
GConf Error: Failed to contact configuration server; the most common cause is a$
GConf Error: Failed to contact configuration server; the most common cause is a$

GConf Error: Failed to contact configuration server; the most common cause is a$
GConf Error: Failed to contact configuration server; the most common cause is a$
/usr/lib/pymodules/python2.6/gtk-2.0/gtk/__init__.py:57: GtkWarning: could not $
warnings.warn(str(e), _gtk.Warning)

Thank you for any information you can give

~LightWrath


----------



## iansjack

You don't say whether you are running a firewall on the Debian server. If so you will, of course, have to add a rule to allow access to the VNC server.


----------



## LightWrath

Hey there, 

Yeah forgot to add that part

The server is totally unmanaged, so all ports are open, nothing blocking it,
The IP address is also static and not behind a NAT or other hardware firewall


----------



## LightWrath

Hello there, So I have resolved the issue of getting the connection.

To do this I'll changed the file in /root/.vnc/xstartup to the below:

#!/bin/sh

unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
#xsetroot -solid grey
#vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
gnome-session &

With this change the client will establish a connection, authenticate and open up the environment
However the display I get is just a grey screen

Here is the log:

09/02/12 19:03:54 Xvnc version TightVNC-1.3.9
09/02/12 19:03:54 Copyright (C) 2000-2007 TightVNC Group
09/02/12 19:03:54 Copyright (C) 1999 AT&T Laboratories Cambridge
09/02/12 19:03:54 All Rights Reserved.
09/02/12 19:03:54 See http://www.tightvnc.com/ for information on TightVNC
09/02/12 19:03:54 Desktop name 'X' (SERVER_IP:1)
09/02/12 19:03:54 Protocol versions supported: 3.3, 3.7, 3.8, 3.7t, 3.8t
09/02/12 19:03:54 Listening for VNC connections on TCP port 5901
exec: 4: /etc/X11/xinit/xinitrc: Permission denied

09/02/12 19:04:00 Got connection from client 
09/02/12 19:04:00 Using protocol version 3.8
09/02/12 19:04:00 Enabling TightVNC protocol extensions
09/02/12 19:04:04 Full-control authentication passed by 94.9.76.41
09/02/12 19:04:04 Pixel format for client 94.9.76.41:
09/02/12 19:04:04 32 bpp, depth 24, little endian
09/02/12 19:04:04 true colour: max r 255 g 255 b 255, shift r 16 g 8 b 0
09/02/12 19:04:04 no translation needed
09/02/12 19:04:04 Using tight encoding for client 94.9.76.41
09/02/12 19:04:04 rfbProcessClientNormalMessage: ignoring unknown encoding 8
09/02/12 19:04:04 Using tight encoding for client 94.9.76.41
09/02/12 19:04:04 rfbProcessClientNormalMessage: ignoring unknown encoding 8
09/02/12 19:04:04 Enabling X-style cursor updates for client 94.9.76.41
09/02/12 19:04:04 Enabling cursor position updates for client 94.9.76.41
09/02/12 19:04:04 Using image quality level 6 for client 94.9.76.41
09/02/12 19:04:04 Enabling LastRect protocol extension for client 94.9.76.41
09/02/12 19:04:04 rfbProcessClientNormalMessage: ignoring unknown encoding -223
09/02/12 19:08:28 Client 94.9.76.41 gone
09/02/12 19:08:28 Statistics:
09/02/12 19:08:28 key events received 1, pointer events 304
09/02/12 19:08:28 framebuffer updates 1, rectangles 15, bytes 1068
09/02/12 19:08:28 LastRect markers 1, bytes 12
09/02/12 19:08:28 cursor shape updates 1, bytes 82
09/02/12 19:08:28 cursor position updates 1, bytes 12
09/02/12 19:08:28 tight rectangles 12, bytes 962
09/02/12 19:08:28 raw bytes equivalent 3145740, compression ratio 3270.000000

Thank you


----------

