Source:Http://www.limodev.cn/blog
Contact information of the author: Li xianjing <xianjimli at Hotmail dot com>
As a Linux programmer, working on a terminal (programming) in most cases may be more convenient. The server is in the data center and everyone is connected to the same server. The local machine runs a terminal (such as securecrt) in windows, which is a typical configuration.
If the developed software does not contain a GUI, there is no problem at all. At least I have been doing this for several years. However, it is troublesome to write the GTK + program recently. First, we tried to run Linux on Vmware. Of course we can, but the compilation was too slow. In addition, when I get used to writing a little bit, I just need to compile and test it. Compilation is too slow to waste too much time, so I have to find another way.
We know that X Window is a C/S model. Applications run on one computer and are displayed on another computer. Therefore, the simplest way to solve the above problem is to install an X Window server on the local machine (Windows) and display the programs running on the server on the local machine.
There are many X Window servers running in windows, some of which are commercial and some are free of charge. The most commonly used free X Window server may be xcygwin, which can be downloaded free of charge on the http://x.cygwin.com/website.
After the download, install it directly, which is no different from installing cygwin. Just make some configuration. Here we assume:
Linux Server IP Address: 10.20.30.246
Windows Client IP Address: 10.20.30.243
In Windows xcygwin:
O add authentication information to allow machines with IP address 10.20.30.246 to access the xserver.
$ Xhost + 10.20.30.246
O start X Window Server
$/Usr/x11r6/bin/startxwin. bat
On a Linux Server Terminal:
O set the display environment variable
[Root @ Linux USR] # export display = 10.20.30.243: 0
O run the application
[Root @ Linux USR] # GTK-demo