LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   vncserver refused after reboot (https://www.linuxquestions.org/questions/linux-newbie-8/vncserver-refused-after-reboot-752522/)

ufmale 09-03-2009 06:15 PM

vncserver refused after reboot
 
Everytime, after I reboot my redhat machine, I cannot vnc to it.
It needs someone to login locally first before I can connect to it with vnc.

is there a way to get around it? I check the chkconfig and find the following line,

Code:

$ chkconfig
atd            0:off  1:off  2:off  3:on    4:on    5:on    6:off
vncserver      0:off  1:off  2:off  3:off  4:off  5:on    6:off
NetworkManager  0:off  1:off  2:off  3:off  4:off  5:off  6:off


What does "5:on" mean? Is this a place where I ask vncserver to start up eventhough nobody has log in first.

FragInHell 09-03-2009 07:56 PM

Hi.

It depends on what run level your systems is booting too, I'm guessing maybe 3.
who -r will tell which run level the system is running at.
If its only booting to run level 3, you can enable VNC to start on this level too.

chkconfig --level 35 vncserver on.

During system startup the runlevels dictate start up order.
So runlevel 1 is single user mode.
2 - adds a few more services such as network support.
3 - Multi usermode but without any GUI (Gnome or kde for example)
4 - Can't remember
5 - Mutli usermode with GUI (if installed)
6 - Reboot
0 - Power off.

chkconfig --list will show you all the services and runlevels.

ufmale 09-07-2009 05:12 PM

According to the who -r
it is level 5. However, the vncserver does not allow me to connect when nobody has not yet logon to the system.
Code:

run-level 5  Sep  1 19:31                  last=S

r3sistance 09-07-2009 05:35 PM

I would possibly try running the following command

chkconfig --level 345 vncserver on

I suspect as users have not logged in, it isn't fully loading up everything related to run level 5 but as it should touch run level 3 first I suspect this would fix the issue.

As per /etc/inittab from Centos here are the run levels as I believe they are defined for all/most fedora based distros

0 - halt (Do NOT set initdefault to this)
1 - Single user mode
2 - Multiuser, without NFS (The same as 3, if you do not have networking)
3 - Full multiuser mode
4 - unused
5 - X11
6 - reboot (Do NOT set initdefault to this)

FragInHell 09-07-2009 06:29 PM

ufmale, try r3sistance's suggestion that will set the vnc server to start on boot. In the mean time to start it without rebooting /etc/init.d/vncserver start will get you going.

29t88 09-07-2009 06:44 PM

Is it RHEL OR RH? Heard there config is completely different so XD Just asking Lol

ufmale 09-08-2009 04:47 PM

It is RHEL. I tried turning the service on 345, but it still didn't work.
After reading on the Net. it is actually a known problem.

I got the same problem with my Ubuntu. I ssh to the machine to activate the service, but it didn't work. it complained about the graphic is not available.

Does anyone have the same problem?.

tredegar 09-08-2009 05:22 PM

You have to start the vncserver as a user.

If you just put it in a startup script it'll be run as root, and that's not sensible and maybe disallowed by your distro's default security policy.
See here:
http://www.linuxquestions.org/questi...49#post3482249

FragInHell 09-08-2009 06:48 PM

Take a look in /etc/sysconfig/vncservers. You can use this to start VNC servers for certain users on startup.
Alternatively login as the user and then start the vncserver by hand.
For the best security consider using SSH Tunnels.

snicklefritz 09-21-2009 12:04 PM

Im having the same issue here but im on Ubuntu 8.04. What is the equivalent to "chkconfig" that I can use to set my runlevel for vnc?
Right now when I bootup I can ssh in and run w who-r and I see "run-level 2" but i cant connect using VNC. I started X manually thinking that might help but it didnt and was a noobie stab in the dark.
Im actually not a total noob but have been away from linux for a while and am a little rusty.
TIA

tredegar 09-21-2009 12:11 PM

Quote:

Im having the same issue here but im on Ubuntu 8.04.
Did you read my post at #8 and follow the link I gave there?

Welcome to LQ!

snicklefritz 09-21-2009 01:23 PM

Quote:

Originally Posted by tredegar (Post 3691882)
Did you read my post at #8 and follow the link I gave there?

Welcome to LQ!

I did and that worked. thanks!


I do have a question though....

in the line you provided you have 1024x768 as the resolution...what if the native resolution that is set already is smaller?
In other words, If im sitting at home and log into this machine and I go to adjust my screen resolution it says 800x600. I happened to notice this after i was logged in from work already and had to install a driver in order to adjust the resolution, then i needed to reboot. Once i did that was when i had my vnc issues.
My question is...if your local settings are 800x600 and you specify 1024x768 when starting up vnc does the local setting stay the way it is (800x600) or should it change to the one specified in the line you provided?


sorry for the long explanation just to ask that question :)

thanks again though

tredegar 09-21-2009 01:41 PM

You can set the vncserver resolution to whatever you like (within limits!). It is just the resolution that is generated by the vncserver, the physical screens on that PC can have different resolutions.

If the physical resolution is 800x600, you can use that for the vncserver as well. If the vncserver's resolution is larger than can be displayed on your remote PC, you'll get scroll-bars to scroll around it (this makes using it a PITA though). Just experiment with different settings until you find one you are comfortable with.

Quote:

thanks again though
Thank you for the thanks, but it's faster just to click the "Thumb-up" icon at the bottom of my post.
Have fun.

ufmale 09-21-2009 03:27 PM

Quote:

Originally Posted by snicklefritz (Post 3691954)
I did and that worked. thanks!


I do have a question though....

in the line you provided you have 1024x768 as the resolution...what if the native resolution that is set already is smaller?
In other words, If im sitting at home and log into this machine and I go to adjust my screen resolution it says 800x600. I happened to notice this after i was logged in from work already and had to install a driver in order to adjust the resolution, then i needed to reboot. Once i did that was when i had my vnc issues.
My question is...if your local settings are 800x600 and you specify 1024x768 when starting up vnc does the local setting stay the way it is (800x600) or should it change to the one specified in the line you provided?


sorry for the long explanation just to ask that question :)

thanks again though

snicklefritz: I tried, but it didn't work. did you do it on RHEL?

tidww01 09-21-2009 05:02 PM

As noted, vnc has to be started by a user. As far as the resolution, look in the directory .vnc under the home directory of the user that started vnc. There should be an xstartup file (I believe that's the name). It contains the startup parameters including the resolution. As noted, your machines resolution and the vncserver resolution can be the same or different, it doesn't matter. Also note that you should stop the vnc server the individual user started before you reboot. If you don't, it's likely it won't start up again complaining about lock files. Just remove the lock files and start it again. I'm not familar with vnc on Linux, but I've seen a number of Unix distro where ssh can conflict with the default display of :10. Usually you just pick a different a different port or move ssh. Also, with vnc if you log off the vnc xterm, the screen will often disappear. In that case, stop and start the user vnc session. Note, vnc can be a big security hole. Always run it with a password.


All times are GMT -5. The time now is 10:45 PM.