Click to See Complete Forum and Search --> : VNC server startup ports


VRay
12-25-2001, 02:15 PM
I start vncserver, all goes well, it creates a few files, /tmp/.x11-unix/X1, and a profile for the user (log and pid files) and I connect on ports 5801 and 5901. The problem comes in when I reboot and start vncserver again - vncserver finds profiles for X display :1, says x1 is already running (though it is not, or if it is, the port is not open)it will now start display :2 (ports 5802 and 5902), then 3 and on and on, so the port number I connect to keeps changing. I only want to allow a single port for vnc to be accessed through the firewall. Any ideas on how I can configure vnc to use that one port over and over? If I manually delete the profile for X1, then it is ok, and vnc starts on display X1. I have a feeling there is a simple solution to this that I have missed...

RH7.2

BTW Happy Holidays, linux geeks! Why the hell am I doing this on Christmas day???

jumpedintothefire
12-25-2001, 03:02 PM
Does /etc/rc.d/init.d/vncserver exist?
if not make/find one.

Then you can do a start stop like other services.

Then use chkconfig to set the run levels for the automation.

The Whizzard
12-25-2001, 04:39 PM
When you reboot, you most likely didn't shutdown vncserver. You must issue a "vncserver -kill :1" to shutdown vncserver. Replace :1 if there are other instances of vncserver you wish to shutdown. "vncserver -kill :2" for instance.

As JITF stated, creating an RC script will automaticaly start/stop vncserver when booting/rebooting.

[ 25 December 2001: Message edited by: The Whizzard ]

TC
12-25-2001, 05:10 PM
Don't run the VNCServer through a firewall. Use it with ssh instead, thus only port 22 needs to be open. As a bonus it is also faster as it is encrypted.
http://www.uk.research.att.com/vnc/sshvnc.html

Makes a nice VPN connection.

TC
;)