LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-03-2009, 06:15 PM   #1
ufmale
Member
 
Registered: Feb 2007
Posts: 386

Rep: Reputation: 30
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 "5n" mean? Is this a place where I ask vncserver to start up eventhough nobody has log in first.
 
Old 09-03-2009, 07:56 PM   #2
FragInHell
Member
 
Registered: Sep 2003
Location: Sydney Australia
Distribution: Redhat, Centos, Solaris, Ubuntu, SUSE
Posts: 282

Rep: Reputation: 45
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.
 
Old 09-07-2009, 05:12 PM   #3
ufmale
Member
 
Registered: Feb 2007
Posts: 386

Original Poster
Rep: Reputation: 30
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
 
Old 09-07-2009, 05:35 PM   #4
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
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)

Last edited by r3sistance; 09-07-2009 at 05:37 PM.
 
Old 09-07-2009, 06:29 PM   #5
FragInHell
Member
 
Registered: Sep 2003
Location: Sydney Australia
Distribution: Redhat, Centos, Solaris, Ubuntu, SUSE
Posts: 282

Rep: Reputation: 45
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.
 
Old 09-07-2009, 06:44 PM   #6
29t88
Member
 
Registered: Jan 2009
Distribution: CentOS 5.3
Posts: 62

Rep: Reputation: 17
Is it RHEL OR RH? Heard there config is completely different so XD Just asking Lol
 
Old 09-08-2009, 04:47 PM   #7
ufmale
Member
 
Registered: Feb 2007
Posts: 386

Original Poster
Rep: Reputation: 30
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?.
 
Old 09-08-2009, 05:22 PM   #8
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
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
 
Old 09-08-2009, 06:48 PM   #9
FragInHell
Member
 
Registered: Sep 2003
Location: Sydney Australia
Distribution: Redhat, Centos, Solaris, Ubuntu, SUSE
Posts: 282

Rep: Reputation: 45
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.
 
Old 09-21-2009, 12:04 PM   #10
snicklefritz
LQ Newbie
 
Registered: Sep 2009
Location: Atlanta, GA
Distribution: Ubuntu 10.04
Posts: 8

Rep: Reputation: 0
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
 
Old 09-21-2009, 12:11 PM   #11
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
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!
 
Old 09-21-2009, 01:23 PM   #12
snicklefritz
LQ Newbie
 
Registered: Sep 2009
Location: Atlanta, GA
Distribution: Ubuntu 10.04
Posts: 8

Rep: Reputation: 0
Quote:
Originally Posted by tredegar View Post
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
 
Old 09-21-2009, 01:41 PM   #13
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
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.
 
Old 09-21-2009, 03:27 PM   #14
ufmale
Member
 
Registered: Feb 2007
Posts: 386

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by snicklefritz View Post
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?
 
Old 09-21-2009, 05:02 PM   #15
tidww01
LQ Newbie
 
Registered: Dec 2005
Posts: 19

Rep: Reputation: 0
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.
 
  


Reply

Tags
resolution, tightvnc


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Connection refused on new vncserver lumix Linux - Networking 2 02-15-2009 06:02 PM
FC4 hangs after reboot. Is it possible to manually reboot to find problem hathmann Fedora 5 08-13-2006 03:57 AM
vncserver? sunpascal Linux - Newbie 4 02-23-2006 06:10 AM
No keyboard/mouse after reboot. Requires second reboot to work. rottie Linux - Hardware 6 01-16-2006 05:04 AM
Robust vncserver startup file (rc.vncserver) arobinson74 Slackware 4 05-14-2005 05:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration