LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   vnc on Centos 5.7 worked and then didn't after restart (https://www.linuxquestions.org/questions/linux-networking-3/vnc-on-centos-5-7-worked-and-then-didnt-after-restart-912172/)

frznchckn 11-06-2011 09:52 AM

vnc on Centos 5.7 worked and then didn't after restart
 
I have an old laptop that I want to have sit on a shelf. WOL is working properly and I thought I had vnc working for those few times I did want a gui.

I was able to connect to the laptop via TightVNC from my windows 7 box. After I restarted the Centos laptop, I could no longer vnc in.

Does this have something to do with the fact that no one is logged into the laptop yet, so there's no desktop to actually vnc into?

I've confirmed via "vino-preferences" and iptables that ports 5900 and 5901 are open. I think something online specified 5901 but TightVNC only seemed to work on 5900? I'm not sure on that one.

So what do I need to do to be able to vnc in without anyone having logged into the laptop at the console?

Thanks.

bmarx 11-06-2011 11:19 AM

A simple check, but is vncserver running? Do you have it set to start up at boot? What happens if you try to telnet to port 5900?

frznchckn 11-06-2011 02:11 PM

No, it looks like it's not running

$ telnet 192.168.1.101 5900
Trying 192.168.1.101...
telnet: Unable to connect to remote host: Connection refused

$ telnet 192.168.1.101 5901
Trying 192.168.1.101...
telnet: Unable to connect to remote host: Connection refused

Is vncserver started when I log into the console? I'll try to figure out how to start it at boot then.

frznchckn 11-06-2011 04:18 PM

Okay, I followed the directions at

http://wiki.centos.org/HowTos/VNC-Server

and I can now vnc in after boot up and I get a gnome login screen. Wonderful. I can open applications and what not, but then I tried to add a new user via the gui "system-config-users". It prompted me for the root password and then no window. I try to run it from the cmd line via sudo and get the following:

Xlib: connection to "couch:1.0" refused by server
Xlib: No protocol specified

system-config-users requires a currently running X server

Yeah, the laptop is called "couch". Anyways, um, I'm obviously running an server so what gives?

Mavman 11-06-2011 05:15 PM

I think the x server has to be running all the time.
Go to /etc/inittab and your line probably reads
Code:

id:3:initdefault:
Change that to -
Code:

id:5:initdefault:
That should make it force the gui as the default log on option, otherwise vnc probably won't work. You'll need to do a reboot after that or just do an 'init 5' to force the runlevel change and go into effect.

frznchckn 11-06-2011 06:17 PM

I do have it set for runlevel 5. The gui login screen is the default, so I am running X

That error about not having an X session came from a terminal from within the VNC session. That's why I'm so confused as I definitely have X running.

Mavman 11-06-2011 08:36 PM

Well, the only 2 things I can think of right this minute would be to verify that the service is set to startup by itself (chkconfig vncserver on), and then make sure iptables isn't blocking it somehow.


All times are GMT -5. The time now is 08:42 PM.