Showing posts with label vncserver. Show all posts
Showing posts with label vncserver. Show all posts

Friday, December 19, 2008

vncserver + timeout

vncserver + Timeout

Solution:
Add IdleTimeout option to command
su user -c "vncserver :#display IdleTimeout=0"

Tuesday, October 14, 2008

How to use VNC server on CentOS

How to use VNC server on CentOS

Assume you have CentOS installed with Gnome. If you want to remotely access the GUI to that machine, you can use vnc-server and a vnc client (like Chicken of the VNC). Here's how:

ssh to the machine. If it is behind a firewall, you might have to set up a tunnel.
Make sure vnc-server is installed:

% sudo yum install vnc-server

Run vnc-server:

% vnc-server

This is just to initially create configs and choose a password. Now Edit the file ~/.vnc/xstartup so it runs a gnome session instead of crappy twm:

#!/bin/sh

# Uncomment the following two lines for normal desktop:
# 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 &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
exec gnome-session &

Kill off your vnc server and restart it:

% killall Xvnc
% vnc-server

Connect to your vnc server with host and display number reported with your favorite client. Yay.

Thursday, February 21, 2008

can't start vncserver

root@svr5:/usr/ports/net/tightvnc# vncserver
Couldn't start Xvnc; trying default font path.
Please set correct fontPath in the vncserver script.
Couldn't start Xvnc process.

Couldn't open RGB_DB '/usr/local/lib/X11/rgb'
21/02/08 18:32:09 Xvnc version TightVNC-1.3.8
21/02/08 18:32:09 Copyright (C) 2000-2006 Constantin Kaplinsky
21/02/08 18:32:09 Copyright (C) 1999 AT&T Laboratories Cambridge
21/02/08 18:32:09 All Rights Reserved.
21/02/08 18:32:09 See http://www.tightvnc.com/ for information on TightVNC
21/02/08 18:32:09 Desktop name 'X' (svr5.at.mikorn.com:1)
21/02/08 18:32:09 Protocol versions supported: 3.7t, 3.7, 3.3
21/02/08 18:32:09 Listening for VNC connections on TCP port 5901
21/02/08 18:32:09 Listening for HTTP connections on TCP port 5801
21/02/08 18:32:09 URL http://svr5.at.mikorn.com:5801
_FontTransSocketUNIXConnect: Can't connect: errno = 2
failed to set default font path 'unix/:7100'
Fatal server error:
could not open default font 'fixed'
Couldn't open RGB_DB '/usr/local/lib/X11/rgb'
21/02/08 18:32:10 Xvnc version TightVNC-1.3.8
21/02/08 18:32:10 Copyright (C) 2000-2006 Constantin Kaplinsky
21/02/08 18:32:10 Copyright (C) 1999 AT&T Laboratories Cambridge
21/02/08 18:32:10 All Rights Reserved.
21/02/08 18:32:10 See http://www.tightvnc.com/ for information on TightVNC
21/02/08 18:32:10 Desktop name 'X' (svr5.at.mikorn.com:1)
21/02/08 18:32:10 Protocol versions supported: 3.7t, 3.7, 3.3
21/02/08 18:32:10 Listening for VNC connections on TCP port 5901
21/02/08 18:32:10 Listening for HTTP connections on TCP port 5801
21/02/08 18:32:10 URL http://svr5.at.mikorn.com:5801

Fatal server error:
could not open default font 'fixed'

Solution: Modify
root@svr5:/usr/ports/net/tightvnc# vi /usr/local/bin/vncserver
...
# Here is another example of setting the font path:
$fontPath = "/usr/lib/X11/fonts/misc/,/usr/lib/X11/fonts/75dpi/";
...
to
# Here is another example of setting the font path:
$fontPath = "/usr/X11R6/lib/X11/fonts/misc/,/usr/X11R6/lib/X11/fonts/75dpi/";