PDA

View Full Version : load vncserver at boot time


klingon
21st June 2009, 12:28 AM
So I installed tigervnc, configured /etc/sysconfig/vncserver, used vncpasswd as the user im trying to log in as to set passwd, disabled firewalls, set chkconfig --add vncserver but still whenever i try to connect to the vnc server I get "unable to connect to host: Connection refused (10061)". If I run the "vncserver" command as my normal user, I can connect fine then. This really wearing on me, any help is greatly appreciated. It is weird if I try to stop vncserver it says [ok] and then if I try to stop again it says [Failed] but if I check the status of vncserver it says Xvnc is running..

scottro
21st June 2009, 02:18 AM
Hrrm.

I'm assuming that tigervnc still works as vnc has always worked. (And actually, the server aspect works quite well, IMHO--there's a small bug with the viewer and Macs, but a bug's been filed and they're working on it.)

Let's say the user is called klingon. You should be able to do this. (Untested with tigervnc).

As klingon, start the server. Set your password.

pkill Xvnc

See if it's stopped. (Also, at this point, make sure that you haven't eneabled it as a service, that is, if it is running as service please do, as root or with root privilege, service vncserver (or whatever it's called) stop.

Now, in /etc/sysconfig/vncserver, you'll see some sample lines, which should be commented out with a # sign.

Copy one and edit it so it read

VNCSERVERS="1:klingon

Then

service vncserver start

At this point, you should be able to login from another machine.

To make it run at boot

chkconfig vncserver on

This should work after a reboot.

klingon
21st June 2009, 05:48 AM

Thankyou, I ran through all the steps you provided a second time. Still when I try to connect I get the connection refused message. If I ssh in and run vncserver as user, I can connect fine.. Is there any difference in configuration between running "service vncserver start" and running "vncserver".

nmap shows the ports are open when running either command to start server. ive tried using a default xstartup. firewall and selinux are confirmed not interfering.

scottro
21st June 2009, 07:41 AM
There really shouldn't be a difference. If you set up sysconfig/vncservers as mentioned, and then type

service vncserver start

what do you see in the terminal? You should be seeing something very similar to what you see when you start it as the user, that it is starting for user klingon on display 1.

klingon
21st June 2009, 05:25 PM
SOLVED!

Im an idiot >( So I checked over all my config files again and noticed /etc/sysconfig/vncservers had the "localhost" switch active effectively preventing anybody from connecting. The first time I saw this I thought it meant prevent public IPs from connecting. This would explain why nmap showed the port open on localhost but not the IP. I guess running the command "vncserver" does not use the same config file so it didnt have this problem.

scottro
21st June 2009, 05:43 PM
Ah, glad you got it fixed. I was puzzled when you were saying it wasn't working.

klingon
21st June 2009, 06:13 PM
Thanks, its working great now. Feels a bit faster than the previous vnc implementation I had on F10. I was wondering whether I should use tigervnc-server or tigervnc-server-module. Any advantages to using one over the other?

scottro
21st June 2009, 07:04 PM
I agree--it does seem faster to me as well, with responsiveness matching nx-server.

As for your question--I wasn't even aware of tigervnc-server-module, so I don't know what, if any, advantage or disadvantage there is.

scottro
21st June 2009, 07:15 PM
To go back to the question--the description for the module package says that it provides the module to the X server. If you just install the module, without installing tigervnc-server, you won't have a vncserver command..

So, I'm not really clear what the module does--it's not required for the tigervnc or the tigervnc-server package.