Question : Problem: What is the best practice for configuring vncserver for remote vnc access to work with gdm?

I have been trying to make VNC work on CentOS 5. But i only get a basic X Windows environment when I log in (no Gnome).

I edited the /etc/sysconfig/vncservers file and added the following two lines:

VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 1600x1200 -depth 16"

I ran vncpasswd and created a password.
I then ran vncserver and the directory /.vnc was created under my /root directory.
I edited the xstartup file and uncommented these lines:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc

I also appended the following line:
gnome-session &

I restarted the vncserver service with "service vncserver restart"

Now, when I log in via a VNC client, I get a basic X Windows environment, with no Gnome whatsoever.

Please help.




Answer : Problem: What is the best practice for configuring vncserver for remote vnc access to work with gdm?

the exec line in your xstartup is the reason you are getting a standard X session without gnome.

yours is "exec /etc/X11/xinit/xinitrc"

and it should be something like "exec /path/to/your/gnome-session &"

the problem with this approach is that you arent given a gdm login screen.

what you have is a Xsession running as ROOT, and thats a bad thing(TM)

gdm can be configured to launch a network listener on startup, (this is off by default for security reasons)

XDMCP is the protocol you want to set gdm to listen for when it starts.

there are plenty of docs specific to your distro on how to do this so I'm going to refer you there.

the next thing you need to so is setup your xinit.d daemon to listen on a particular port and start a particular xsession linked to the network listening port on XDMCP.

XDMCP is not secure by default so I highly suggest that you use ssh portforwarding to forward all X traffic from a local port on the remote machine, to a local port on the client machine, then all X traffic (including passwords) are sent in an encrypted connection.

the ssh forwarding is the easy part, the XDMCP part is the difficult part.

you probably have to edit your /etc/services file to add new service definitions.

you probably have to edit your xinit.d services to add a new service.

You'll likely need some distro specific help as centos 5 is relatively new some docs may not be available yet.

Also, just as a word of caution.

Understand the security implications and risks that are inherent with doing what you ask, there are so many that the default installs generally make doing this hard on purpose.

move forward at your own risk, and make sure you know what you are doing and why you are doing it if you start to edit some system config file.
Random Solutions  
 
programming4us programming4us