Tuesday, July 29, 2014

How to execute X11 applications from Raspberry Pi and display them on MS-Windows

Good thing about X-Window is that it is designed to be running via network from the beginning. According to Wiki,
 Unlike most earlier display protocols, X was specifically designed to be used over network connections rather than on an integral or attached display device. X features network transparency: the machine where an application program (the client application) runs can differ from the user's local machine (the display server). X's network protocol is based on X command primitives.

Microsoft Windows has a nice application called "Remote Desktop" or "Remote Desktop Connection". It allows us to remotely control other computer via network.

X-Window born with the feature. Between the same X-Window systems, it is only matter of setting an environment variable, "display"; eg "DISPLAY=192.168.0.xxx:0".

However, between X-Window and MS-Windows, we need two components to get it working. One is Xming and another is PuTTY; PuTTY is MIT license and Xming consists of open source libraries and exceptions.

Once you installed Xming, you can see the service running in the Windows tray.

There isn't much you can do with the icon but it indicates that now you can display X-Window applications on your MS-Windows.

Now let's connect to the Raspberry Pi with PuTTY.
Open PuTTY and go to "X11" category: "Connection" -> "SSH" -> "X11".
Then, check "Enable X11-forwarding".


You can save the setting in "Session" category.
Type in the IP address or host name of your Raspberry Pi and save the setting.
After you are connected to Raspberry Pi, now you can run X11 applications such as xclock.
BTW, you may not have any X11 applications installed yet. "xclock" is a part of x11-apps and you can install it with a command, "sudo apt-get install x11-apps".

Be warned that do not try to run heavy applications. Raspberry Pi isn't strong enough to execute heavy X11 applications.

The screenshot of Eclipse above is running on Raspberry Pi: "sudo get-apt install eclipse" after "sudo apt-get update". It took a few minutes to show the first screen.

No comments:

Post a Comment

About Me

My photo
Tomorrow may not come, so I want to do my best now.