SSH – How to Remotely Log In with Full Graphical Desktop Over X11

remote desktopsshx11

I have two machines, both running kubuntu: server & client. I'd like to connect to server from client and start the full graphical interface without fear that some commands would be run as client user.

So, ssh -XC works and I can also start graphical programs from it just fine.

However, when I type startkde in the ssh console, it says "KDE seems to be already running on this display." Which is true, but not for the same user account.

I tried exiting graphical interface and logging in from tty, but that then (unsurprisingly) failed to start any graphical programs, including kde.

How then can I do this such that I could simply log in just as I log in with a local user? Use client machine as a dumb terminal.

Best Answer

XDMCP is designed for this. On your server, you need to enable XDMCP support in your desktop manager:

  • if you're using kdm, look for

    [Xdmcp]
    Enable=false
    

    at the end of your kdmrc, change false to true and restart kdm;

  • if you're using lightdm, add

    [XDMCPServer]
    enabled=true
    port=177
    

    to /etc/lightdm/lightdm.conf and restart lightdm.

Then on your client, start X using

X -query ${SERVER_IP}

(with the appropriate IP address instead), and your server's login screen should show up on your client.

Related Question