Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm attempting to setup an Ubuntu 10.10 box so that anyone can connect to port 5900 and be greeted by the gdm login manager. To do so, I added a vnc entry in /etc/services and I am starting Xvnc4 using this xinetd config file:

service vnc
{
  protocol = tcp
  socket_type = stream
  wait = no
  user = nobody
  server = /usr/bin/Xvnc
  server_args = -geometry 1000x700 -depth 24 -broadcast -inetd -once -securitytypes None
}

This kind of works...I can start multiple sessions all to port 5900, and I get an X screen. The problem is that I only get an empty, gray X screen with no applications started.

I know when you run vncserver from the command line it will look to your ~/.vnc/ directory for your passwd and xstartup files, and I think what I want to do is put "gnome-session" into the xstart file. However, which xstartup file? The running user is "nobody" who obviously doesn't have a ~/.vnc/ directory. I tried a /root/.vnc/xstartup file and a ~scott/.vnc/xstartup file and it doesn't look like they were even read.

I changed the xinetd vnc service so that it would "strace" Xvnc4. I looked thru all the "open" lines and didn't get a clue as to what file it was trying to read for xstart.

Can anyone help? I just want a terminal server where the user is presented with a gdm login screen.

share|improve this question
    
Please don't cross-post. –  Dennis Williamson Mar 20 '11 at 20:44

1 Answer 1

You need to run it as the user whose VNC session you want to start. You also probably need to set $HOME so it can find the .vnc directory. Try something along the lines of this:

service vnc
{
  protocol = tcp
  socket_type = stream
  wait = no
  user = someuser
  server = /usr/bin/env
  server_args = HOME=/home/someuser /usr/bin/Xvnc -geometry 1000x700 -depth 24 -broadcast -inetd -once -securitytypes None
}

You also probably want other environment settings; probably source ~/.bash_profile in xstartup, and you may also need to set $USER explicitly.

share|improve this answer
    
Isn't there some way I can set it up so I don't have to "fix" the user to a single individual? I want it to start at the gdm screen so they can login from there. You know, the same way multiple users can connect using ssh, except graphical with VNC / X. –  Scott Thomason Mar 20 '11 at 21:02
    
For that, you're almost right; there's no listener for -broadcast, though, as gdm doesn't enable XDMCP by default. You need to modify /etc/gdm/custom.conf to enable it. This Arch Wiki page describes the change to make; restarting gdm may be different on your distribution. –  geekosaur Mar 20 '11 at 21:11
    
There is no /etc/gdm/custom.conf on ubuntu 10.10....any hits? –  Scott Thomason Mar 21 '11 at 3:44
    
If you never had a reason to run gdmsetup (for example, to set up autologin), it probably won't exist; just create it with the [xdmcp] stuff in it. –  geekosaur Mar 21 '11 at 4:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.