This procedure starts from a fresh install of Ubuntu-Desktop-10.10.
install
xdm
, vnc4server
, and xinetd
.sudo apt-get install xdm vnc4server xinetdWhen asked during installation what the default display manager should be, keep the setting as gdm.
Configure xdm to be able to answer XDMCP requests, comment out the following line in
/etc/X11/xdm/xdm-config
:! SECURITY: do not listen for XDMCP or Chooser requests ! Comment out this line if you want to manage X terminals with xdm !DisplayManager.requestPort: 0Configure XDM to answer XDMCP requests from localhost, and to listen to just localhost by adding the following lines to
/etc/X11/xdm/Xaccess
:localhost LISTEN localhost
Configure XDM to not bring up a physical display by commenting out the following line in
/etc/X11/xdm/Xservers
:#:0 local /usr/bin/X :0 vt7 -nolisten tcp
Configure the startup script to allow XDM to start despite gdm taking care of the screen by removing
/etc/X11/default-display-manager
:sudo mv /etc/X11/default-display-manager /etc/X11/default-display-manager.disable
Add the VNC port definition to
/etc/services
if it has not already been added:vnc 5900/tcp
Configure the VNC incoming port by creating
/etc/xinetd.d/vnc
:service vnc { only_from = localhost 192.168.0.0/24 disable = no id = vnc socket_type = stream protocol = tcp wait = no user = nobody server = /usr/bin/Xvnc4 server_args = -inetd -query localhost -once -SecurityTypes=None -pn -fp /usr/share/fonts/X11/misc/,/usr/share/fonts/X11/75dpi/,/usr/share/fonts/X11/100dpi/ -desktop Ubuntu log_on_failure += USERID }In this configuration connections are restricted to the local network (
192.168.0.*
).After all these pieces are done, restart the services to load the new configurations:
sudo /etc/init.d/xdm restart sudo /etc/init.d/xinetd restart
Now you should be able to use VNC to get a login screen.
There is a problem with gnome in this setup where it has a keyboard shortcut assigned to 'd', which can be fixed by going into
System -> Preferences -> Keyboard Shortcuts
and disabling, or reassigning the "Hide all normal windows and set focus to the desktop" shortcut key (source). This may happen because the default key binding is Mod4+D
, and there is no Mod4 modifier key on the VNC connection.
Great! Thank you. I will try.
ReplyDeleteIt works! Thank you again!
ReplyDeleteTHANK YOU. i've been looking all over for 10.10 instructions for this, and so far found only pre-10.10 (which are no longer valid). :-D
ReplyDeleteThankyou very much.. This is literally the only detailed tutorial on setting up some kind of headless login to Ubuntu 10.10.
ReplyDeleteWhat Squeeb said! Thanks very much, worked perfectly.
ReplyDeleteMay also want to note that you can modify the resolution by including something like
-geometry 1280x900
In the server_args section.
As a Linux newbie I following this slavishly and it worked (using TightVNC as the remote Windows client), except for two things:
ReplyDelete1. As soon as I add a geometry entry to server_args - eg '-geometry 1280x1024' - I get the screen (of the right size), but no login prompt. Can only get the login prompt if I leave it at the (1024x768) default.
2. How do I get it to power down remotely? If I use the remote power icon and shutdown entry, it breaks the TightVNC session, but the box does not shut down. I can only do that with a keyboard/mouse/monitor on the remote box, which slightly defeats the object.
Comments appreciated.
Nick W:
ReplyDelete1. I would expect that if i stick the geometry on the end of the command line it would work just fine, I will try that out later and see what happens.
2. When I try to shut down a remote box I usually use the "shutdown" command in a shell, and often the connection is SSH instead of a graphical session.
After a bit more investigation, seems to depend where you put it: at the end of server_args, doesn't work, after the -once, it does. Possibly there's some order of processing arguments?
ReplyDeleteAlso, it seems that I need to have a keyboard and mouse plugged into the headless box or, again, no login screen. Do you find the same?
I'm a novice on this, s/w developer, but almost never on Linux (embedded and Windows). Only installed Ubuntu for the first time on Friday, so your guide was dead useful!
There may be some order that the options need to be in, but the manual doesn't mention any, did the geometry option show up as the name of the VNC desktop?
ReplyDeleteThe server is physically an old laptop with a broken screen so I don't know if this configuration works completely headless, though it should since the only displays on the display manager are virtual. I have set up a headless box in the past using another XDM on Gentoo, so it is possible.
hi... previous your solution works fine with fresh Ubuntu10.10, but some how after some updates it does not work anymore. The VNC still able to prompt userId and password, but after entering password... the VNC shutdown.
ReplyDeleteError log below:
Thu May 19 08:52:37 2011 xdm info (pid 2578): sourcing /etc/X11/xdm/Xsetup
Thu May 19 08:52:49 2011 xdm info (pid 2578): sourcing /etc/X11/xdm/Xstartup
Thu May 19 08:52:49 2011 xdm info (pid 2595): executing session /etc/X11/xdm/Xsession
Thu May 19 08:52:49 2011 xdm info (pid 2578): sourcing /etc/X11/xdm/Xreset
Thu May 19 08:52:49 2011 xdm error (pid 2578): cannot remove process ID file /var/run/xdm.pid: Permission denied
I noticed this is no longer working on the server where it was set up. When I get it working again I will post an update.
ReplyDeleteInterestingly, on an installation with all the updates already done, this guide still works.
ReplyDeleteAnd on the system I had where it stopped working, it is working again.
Question, why doesn't this look like a normal Ubuntu desktop when I log in? All the panels are an ugly bright gray color instead of the normal charcoal..
DeleteI saw a normal desktop when I did it, and didn't notice any color differences when I was using it in the past.
DeleteDon't get me wrong, it's a great write-up. I'm guessing it's because your guide incorporates xdm, rather than gdm, and the ubu window manager isn't displaying correctly because of it. Then again, I'm still on 10.04 and not 10.10, but this is the closest guide, so far, for what I hope to accomplish. I'm trying to get it to where my girl can be on her login, physically, but I can still login to my desktop, remotely, at the same time so I can work on my android developer stuff. Thanks for a good guide to start with! :-)
DeleteThe situation you are describing is something that the VNC server without any extra setup can usually handle, with the added advantage of being able to disconnect and reconnect to the same session. If you start up a VNC server with plenty of color and get the session initiation script to start the right desktop it should just work without any of this guide.
DeletePerfect. Someone had this solution posted _nearly_ correctly at another site, and it didn't quite work. Thanks!
ReplyDeletePerfect! Other guides didn't work for one reason or another...
ReplyDelete