~/.vnc/xstartup is run when a VNC client is connected. It opens vncconfig, an xterm, and then tries to run twm.
What I did was comment out the two lines in ~/.vnc/xstartup "for a normal desktop", AND 'sudo chmod +x /etc/X11/xinit/xinitrc'. If I didn't make xinitrc executable, the second line that exec's xinitrc fails and I only get a checkered screen.
xinitrc goes on to source /etc/X11/Xsession, which starts a normal desktop. The session is resumable.
(It is worth noting that the above applies only to Ubuntu package 'vnc4server'. Package 'vncserver' is version 3.3.x and doesn't look for ~/.vnc/xstartup. Instead, it fires up /etc/X11/Xsession directly. I guess one can also edit xstartup to exec Xsession instead of xinitrc, leaving xinitrc non-executable.)
I did not enable XDMCP in /etc/gdm/gdm.conf-custom or use xinetd. I start the vncserver manually through SSH, limited to localhost connections, and tunnel the VNC port.
- What are the vulnerabilities to having to +x /etc/xinit/xinitrc?
- Why twm and not a normal desktop by default? Is it purely a bandwidth concern or is there something more serious (security issues), or just nicer/sensible from an implementation perspective (normal desktop startup scripts doing desktop-y things that are unnecessary for remote login--like startup sounds)?
- Are there shortcomings to not using xinetd for VNC? I'm running the server on a semi-dedicated machine, so saving resources is not much of a problem. But even on personal machines, is VNC traffic heavy enough to warrant skipping over xinetd altogether?
- Does XDMCP provide a remote greeter/login screen upon connect?
- What connects opening an Xvnc session to XDMCP? What I mean is this: I tried enabling xdmcp in /etc/gdm/gdm.conf-custom, then started my vncserver as usual. But I saw no difference logging in through a VNC client (i.e.: no login screen). How do I tell that XDMCP is working?