Running a GTK + Application on a Linux Machine, from Windows

I have installed GTK on a Linux machine. I am connecting to a Linux machine from a Telnet session to compile GTK programs From a Windows machine. I am using Cygwin on Windows Machine. but I cannot see the GUI of the output of my GTK program on my Windows machine.

When I run the program from my terminal, I get this error:

(helloworld:22576): Gtk-WARNING **: cannot open display:

      

I tried the solutions from each posted answer, but now I am not using the following errors:

$ ./helloworld
Invalid MIT-MAGIC-COOKIE-1 key
(helloworld:22710): Gtk-WARNING **: cannot open display: 172.25.0.161:0

      

and I am getting the following error on my Cygwin console:

client 6 rejected from IP 172.25.0.91 Auth name: MIT-MAGIC-COOKIE-1 ID: -1

      

+2


source to share


4 answers


You must set the DISPLAY variable in the telnet session to the IP address or DNS name of your Windows machine and add ": 0"

export DISPLAY=windows.your.domain:0

      



And you have to run the X server on a Windows machine (comes with Cygwin, but you have to run it).

+2


source


You need to start the X window system (install with Cygwin) on your Windows window and enable remote connections (probably from xhost ). Set the DISPLAY variable in your Linux box to the address of your Windows box and: 0, as such:

export DISPLAY=192.168.1.123:0

      




I can recommend using ssh over telnet for security reasons. In this case, you do not need to enable remote connections using xhost, and you do not need to set the DISPLAY variable. You need to enable forwarding the X .

+2


source


You have to install X server on your windows machine and make sure you have DISPLAY installed on yourmachine:0

or something like that. Or better yet, use ssh instead of telnet (like putty) and tunnel your X connection. However, you will have to do a bit of work on your research because the complete answer will be long.

+1


source


Install a small X server in Windows XMing32 , then start it, use putty as a console client and check the "X11 Forwarding" checkbox in Connection-> SSH-> X11.

Unfortunately X11 forwarding is not available via Telnet, you must start an SSH server on the target Linux and connect via SSH. (See if /etc/ssh/sshd_conf

requires enabling X11 Forwarding too).

+1


source







All Articles