User avatar
esbeeb
Posts: 111
Joined: Sun Feb 05, 2012 12:23 am

No spare HDMI monitor? XDMCP setup HOWTO

Sat Oct 27, 2012 5:22 pm

It seems no one has written a concise guide to enabling XDMCP on the Raspberry Pi yet. Here is a quick walkthrough for the newbies.

Why bother? Because I have no spare HDMI monitor to hook up to my Raspberry Pi, and I'm too cheap to buy one (about $100CDN new is the cheapest I can find), or buy a ~$30CDN HDMI-to-SVGA converter dongle. Remote login from my existing Kubuntu PC is the easiest and most lightweight way to get to my Raspberry Pi's LXDE desktop, IMHO.

Security Warning: Yes, XDMCP is horribly insecure, and therefore has a bad reputation, but I don't mind, because I'm behind a firewall, and I trust the other people and computers on my LAN to not to do anything mischevious. So don't blame me if you encounter security-related problems down the road from following these directions!

This tutorial will work for anyone remotely logging in from a computer with some kind of Linux distro (such as Ubuntu, Xubuntu, Lubuntu, Kubuntu, etc.) where it's easy to install "remmina", which supports XDMCP login. XDMCP is disabled by default in (Raspbian Wheezy), and raspi-config has no option to conveniently turn it on.

(Side note: Feature request to raspi-config developers: Could you please add the ability to enable XDMCP (rather than regular graphical login, and text-based console) in the "Boot Behaviour" menu item?)

Step 1): Remotely log into your Raspi over SSH. Here's a tutorial, in case you need it. If you don't have DNS set up on your LAN, take note of your raspberry Pi's IP address (as you'll need it in step 7).

Step 2): Ensure regular graphical login is disabled. Run the command:

Code: Select all

sudo raspi-config
Then from the "Boot Behaviour" menu item, answer "No" to the question "Should we boot straight to Desktop". Select "Finish", but don't reboot just yet.

Step 3): Make a backup copy of /etc/lightdm.conf with a command like:

Code: Select all

sudo mv /etc/lightdm/lightdm.conf /etc/lightdm/lightdm.conf.orig
As a fallback, you can always copy the original lightdm.conf back into place, if you ever want to undo XDMCP login (and then re-enable regular graphical login from raspi-config).

Step 4): Create a new /etc/lightdm/lightdm.conf, using a command like:

Code: Select all

sudo nano /etc/lightdm/lightdm.conf
Enter this text:

Code: Select all

[LightDM]
start-default-seat=false
xserver-allow-tcp=True

[SeatDefaults]
xserver-allow-tcp=false
greeter-session=lightdm-greeter
greeter-hide-users=true
session-wrapper=/etc/X11/Xsession
autologin-user=pi

[XDMCPServer]
enabled=true

[VNCServer]
Exit nano, saving as you go (accomplished with Ctrl-x, y, Enter):

Step 5): reboot, with a command like:

Code: Select all

sudo reboot
Step 6): On your Linux computer where you'll be initiating the remote login, install "remmina". I'm using Kubuntu 12.04, and this is a standard package, installable from the "Software Center".

Step 7): Launch remmina, and in the "Connection" Menu, click "New." Set up a connection to your Raspberry Pi, giving it a name like "Raspberry Pi". For "Protocol", choose XDMCP, and provide the hostname or IP address in the "Server" field. (Note: On my LAN, I have DNS set up such that I can just use the hostrname "raspberrypi", but you night need to use the IP address of your raspberry pi instead.) All other options I left as the defaults. Save.

Step 8): Back in Remmina's main window, double click your new connection to connect. It logs in directly to the Raspberry Pi's LXDE desktop, fullscreen, after a pause of 10ish seconds (and I have my Raspberry Pi overclocked to 1000MHz). Since you specified "autologin-user=pi" in your /etc/lightdm/lightdm.conf, you aren't even asked for a password. Note: One bad side effect of this is that if you log out of LXDE, the Remmina connection does not terminate. The LXDE desktop just reloads again after another 10ish seconds. Once the desktop has reloaded (which I do just to ensure that any changes to my desktop settings, etc. have all been committed to disk), I just move my mouse pointer to the upper center of the screen to reveal Remmina's little control panel for that connection, then click the plug icon on the right to "Disconnect". I've done this many times, and there doesn't seem to be any bad side effects from doing this.

Tip: To temporarily minimize the Remmina connection, and return to your original Linux PC, move your mouse pointer to the upper center of the screen to reveal Remmina's little control panel for that connection, then click the blue down arrow icon second from the right to "Minimize Window".

User avatar
esbeeb
Posts: 111
Joined: Sun Feb 05, 2012 12:23 am

Re: No spare HDMI monitor? XDMCP setup HOWTO

Sun Oct 28, 2012 3:45 pm

If you want to be asked for a password (which will be sent unencrypted across the network) when logging into your XDMCP session on your Raspberry Pi, use this in your /etc/lightdm/lightdm.conf instead:

Code: Select all

[LightDM]
start-default-seat=false

xserver-allow-tcp=True
[SeatDefaults]
xserver-allow-tcp=false
greeter-session=lightdm-greeter
greeter-hide-users=false
greeter-show-manual-login=true
session-wrapper=/etc/X11/Xsession

[XDMCPServer]
enabled=true

[VNCServer]
The advantage to doing it this way is that when you Logout of your LXDE session, you'll return to the "Greeter" screen, and then you can "Disconnect" (in Remmina's control panel in the top center) more cleanly.

Note that the Greeter's Power button icon in the top right does not seem to work, if you want to try to power down your Raspberry Pi. The only way I'm aware of properly powering down the Raspberry Pi is to remotely log in over ssh, and use a command like:

Code: Select all

sudo shutdown -Ph now

Tips:

1) The greeter background is a harsh white by default. To change it to a much more mellow rich red color, edit (as root) /etc/lightdm/lightdm-gtk-greeter.conf, with a command like:

Code: Select all

sudo nano /etc/lightdm/lightdm-gtk-greeter.conf
...and change the line:

Code: Select all

background=#ffffff
...to:

Code: Select all

background=#65000a
...then exit, saving as you go (accomplished with Ctrl-X, y, Enter), and restart lightdm with a command like:

Code: Select all

sudo service lightdm restart

2) If you ever run into trouble, where your XDMCP connection hangs, showing only a black screen when you connect, restarting lightdm and re-trying your XDMCP connection usually clears it up.

User avatar
esbeeb
Posts: 111
Joined: Sun Feb 05, 2012 12:23 am

Re: No spare HDMI monitor? XDMCP setup HOWTO

Sun Oct 28, 2012 3:58 pm

Oops, correction to Step 2) above. You want to ensure regular graphical login is enabled, not disabled (by answering "Yes" to the question "Should we boot straight to Desktop"). This way lightdm gets started at boot time, which offers XDMCP login (once you've changed /etc/lightdm/lightdm.conf accordingly in step 4).

If you say "No" (and don't enable graphical login), then when you initiate an XDMCP connection with Reminna (in Step 8), you'll only get a black screen and nothing happens. You'll have to click "Disconnect" (in Remmina's control panel in the upper center) and try again later once you've fixed lightdm's behaviour.

User avatar
esbeeb
Posts: 111
Joined: Sun Feb 05, 2012 12:23 am

Re: No spare HDMI monitor? XDMCP setup HOWTO

Sun Oct 28, 2012 4:14 pm

One more gotcha:

In "raspi-config", in "Boot Behaviour", when you answer "Yes" to the question "Should we boot straight to Desktop", then "Finish", raspi-config silently puts back the line:

Code: Select all

autologin-user=pi
...in your /etc/lightdm/lightdm.conf

So if you want to be asked for a password over XDMCP, you'll have to re-edit /etc/lightdm/lightdm.conf accordingly, and restart lightdm again.

iks1
Posts: 1
Joined: Fri Mar 15, 2013 11:17 am

Re: No spare HDMI monitor? XDMCP setup HOWTO

Fri Mar 15, 2013 11:22 am

Hello,

Nice tutorial, but my /etc/lightdm/lightdm.conf gets overwritten with some defaults everytime I reboot my Pi... Tried reinstalling LightDM but ended up with same results. Tried creating lightdm.override file, but it is deleted after reboot. I guess that the whole dir /etc/lightdm/ is somehow restored after each reboot...
Any idea what to do?

Thank you,
-Andrej

ampbrownie
Posts: 4
Joined: Thu Mar 21, 2013 8:29 pm

Re: No spare HDMI monitor? XDMCP setup HOWTO

Sat Mar 30, 2013 7:50 pm

@iks1,
my config doesn't get overwritten. Are you on the latest image with a good SD card?

I am just having trouble with Remmina. The Ubuntu version doesn't have the XDMCP protocol listed, so I tried the others, and no go.

I am giving x11 forwarding a shot, from the terminal. To far this command works:

From my Ubuntu box:
then, in that shell type:

Code: Select all

/usr/bin/galculator
You should get galculator to popup right there in your linux machine, just like you opened it locally.

More about xforawding here:
http://www.raspberrypi.org/phpBB3/viewt ... 1&p=196712

cstockmayer
Posts: 1
Joined: Sat Nov 02, 2013 3:17 pm

Re: No spare HDMI monitor? XDMCP setup HOWTO

Sat Nov 02, 2013 3:28 pm

the steps 6-8 can also done with starting an alternate X-server as root:

Code: Select all

X :1 -query IP_OF_RASPI &
note: a running firewall on your Linux-Server can block the query!

User avatar
thagrol
Posts: 2097
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: No spare HDMI monitor? XDMCP setup HOWTO

Sat Nov 02, 2013 9:22 pm

If you're running windows on your PC try Cygwin-X or xming. You'll need to use these in single window mode though.
Attempts to contact me outside of thes forums will be ignored unless signed in triplicate, sent in, sent back, queried, lost, found, subjected to public enquiry, lost again, and finally buried in soft peat for three months and recycled as firelighters

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12514
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: No spare HDMI monitor? XDMCP setup HOWTO

Sat Nov 02, 2013 10:55 pm

esbeeb wrote:Why bother? Because I have no spare HDMI monitor to hook up to my Raspberry Pi, and I'm too cheap to buy one (about $100CDN new is the cheapest I can find), or buy a ~$30CDN HDMI-to-SVGA converter dongle.
Another perhaps cheaper option that is often overlooked is to buy a second hand "VGA" LCD monitor that has (as many LCD monitors do) an DVI-D input connector. DVI-D is just as compatible with a PI as HDMI is, only it doesn't support sound, but for sound you can use amplified speaker boxes on the 3.5mm stereo connector. So you just need a cheap HDMI to DVI-D cable instead of an HDMI to HDMI cable.

Oakafka
Posts: 1
Joined: Tue May 31, 2016 3:11 pm

Re: No spare HDMI monitor? XDMCP setup HOWTO

Wed Jun 01, 2016 2:03 pm

Hello. your idea is very good. But here I got another problem. I use my pc to conect raspberry following your solution and conect successfully. But I find out it is a long time delay when I run rviz on raspberry, and the rasp CPU usually go up to 17-20% and slow down. Is it cause by the brandwidth?

my rasp OS is jessie, my PC OS is Ubuntu 14.04 LTS.
Please let me know if I could provide more infomation!

Return to “Beginners”