Kubuntu as an Xwindows Server

When on Windows, I normaly use the XLive CD to connect to my Unix machines (they can be Linux and Solaris) and access remotely the X applications with their output showing on my Windows PC.

Well I’ve moved my work computer from XP to Kubuntu 8.04, and since then I struggle to do the same as I did with the XLive CD.

Basically with the XLive CD this is how it works:

– On your windows PC after starting the XLive CD, the X server starts and bind to the TCP X port to hear incoming connections. These incoming connections come from the client I try to access.

– On the client side I just do and export=ip_my_windows_machine:0.0 and start the X application.

– That’s it.

On Kubuntu I’ve tried several configurations to allow the KDE display manager to listen to network connections. I’ve searched a lot, changed the xorg.conf file, the kdm.rc file, and yes it didn’t work….

Well the issue was that I needed a paradigm change in how to connect to my client machines. I took me a while to see that I do not need to fiddle with my KDE configuration…

So how you can you do it?

Simple:

– Connect to your client machine through ssh (You’re using ssh, righ? ) and edit the file sshd.conf or ssh_config (It depends on your version) located in /etc/ or one of it’s subdirectories like sshd.

– Edit the file and make sure that you have a line ForwardX11 yes

– Save and restart the ssh deamon.

Now on your workstation instead of connecting with just ssh user@IP use ssh -X user@IP. With this command all X connections will be forwarded automatically to your Kubuntu desktop, just like you did an export DISPLAY and so on.

X-Windows access on your Windows PC

Sometimes you need to run graphical Unix/Linux applications on your Windows client PC. Text access is easy, there are several ssh clients available, and windows has a telnet client. What about X-Windows?

The solution is XLiveCD: http://xlivecd.indiana.edu/

This is a CD that just makes your Windows PC into a X-Windows client (Correct terminology would be Server… 😉 ). With this you can just start a ssh session into your remote Unix/Linux box, and from there just run any graphical application that you need. The application will display along your other Windows applications.

By the way if you have Nero Image or something similar, you even don’t need to burn a CD…

Also as a bonus the CD has a complete CYGWin set of commands, and so you also get tail, grep, uniq…