VNC won't start properly at boot.
Corné Beerse
cbeerse "at" lycos.nl
Fri Nov 12 09:33:01 2004
Ronald Hall wrote:
> I'm ready to toss my stupid box out the window.. having a strange problem
> with VNC I just cannot figure out. I'm trying to get VNC to start
> automatically when the system comes up. I've tried to do that 2 ways..
There are more ways, and unfortunatly, your choices are not the best.
> First, by doing it through rc.local:
>
> su - username -c "vncserver :2 -name SystemName -depth 16 -geometry
> 800x600"
>
> That fails with a black screen and an X for a cursor.. no windows
> manager..
The problem here is that the environment (`env` and `set` variables) are not as
they are with a login. It takes a lot of work to get it going but you don't need to.
>
> Then I tried loading through the vncserver service and the
> /etc/sysconfig/vncservers file.. which I had:
>
> VNCSERVERS="2:username"
> VNCSERVERARGS[2]="-name SystemName -geometry 800x600 -depth 16"
>
> That also fails with a black screen and an X for a cursor.
This is a better aproach. I don't know your distribution (guess between SuSE and
RedHat) but I think your edits in the sysconfig area are not effectuated.
In the end, these edits either go into /etc/X11/gdm/gdm.conf (if gnome is your
display manager) or in /etc/X11/xdm/Xservers. Details follow.
>
> No, what doesn't make sense, and is driving me INSANE, is that if I just
> MANUALLY start up VNC via an SSH session after my system boots up (And I
> have VNC Services disabled and nothing in rc.local) it comes up with a
> Gnome desktop just fine. I also uncommented the 2 lines out of the
> ~HOME/.vnc/xstartup file that Redhat suggests. Its just strange if I
> invoke it manually it works but if I try to do it at startup it fails.
It's RedHat. Thats not bad. Both RedHat and SuSE have something pre-configured.
If you scan trough their documentation (try /usr/share/doc/ and such) then you
will find their ideas about how to start vnc-sessions.
>
> ANY ideas here? I know the simple answer is just to start it when I need
> it, but this is driving me INSANE and I can't figure out why it won't load
> properly. Any insight would be greatly appreciated. I am currently
> running Fedora Core 3, and VNC 4.0.7 I believe.
In '/etc/X11/xdm/Xservers':
# vncsession :7, using vncpassword from root.
:7 ROOTVNC local /usr/bin/Xvnc -geometry 800x600 -depth 8 -rfbwait
120000 -rfbauth /root/.vnc/passwd :7
# vncsession :4, no vncpassword.
:4 FREEVNC local /usr/bin/Xvnc -geometry 800x600 -depth 8 -rfbwait
120000 -alwaysshared -dontdisconnect :4
For gdm based machines, I updated '/etc/X11/gdm/gdm.conf' in a similar way:
- add server definitions (at the end,
the double inserted lines are continuation of the previous line!!)
[server-ROOTVNC]
# vncsession, using vncpassword from root
name=ROOTVNC server
flexible=false
command=/usr/bin/Xvnc -geometry 800x600 -depth 8 -rfbwait 120000
-rfbauth /root/.vnc/passwd
[server-FREEVNC]
# vncsession, using no vncpassword
name=FREEVNC server
flexible=false
command=/usr/bin/Xvnc -geometry 800x600 -depth 8 -rfbwait 120000
-alwaysshared -dontdisconnect
- in the [servers] section, add and/or replace lines that indicate an Xserver:
# use roots vncsession on :7
7=ROOTVNC
# use the free-access vncsession on :4.
4=FREEVNC
There is a change the above gives you a blank (black) vnc-session. If so, also
update the next settings (from
http://www.sourcecodecorner.com/articles/vnc/linux.asp):
########
2) edit 'xdm-config' and comment out the line '! DisplayManager.requestPort: 0'
(should be the last line)
a) RedHat 6.2, 7.1, 7.2 - '/etc/X11/xdm/xdm-config'
3) edit 'kdmrc' and enable XDMCP on port 177 (if kde is new enough)
a) RedHat 7.2 - '/etc/kde/kdm/kdmrc'
b) If running Gnome as your desktop, start gdmconfig, select Expert
Mode, ensure that Enable XDMCP is checked. (You must be logged in as root)
4) edit Xaccess and uncomment the line '* #any host can get a login window'
a) RedHat 6.2, 7.1, 7.2 -' /etc/X11/xdm/Xaccess'
########
If you want more than 2 or 3 vnc-sessions at startup, better follow the entire
instruction on http://www.sourcecodecorner.com/articles/vnc/linux.asp . That
will give you the 'inetd' setup as also described at
http://www.realvnc.com/v4/man/Xvnc.html .
CBee