Error: Unable to initialize gtk, is DISPLAY set properly?

Arshad picture Arshad · Feb 19, 2014 · Viewed 38.3k times · Source

I'm trying to run Image application from server "bert"

I connected through my OSX Maverick as

ssh [email protected]

I compiled my file with

$ make

but when I run the resulting file

$ ./window

it gives me the following error:

Error: Unable to initialize gtk, is DISPLAY set properly?

How can I solve this problem?

Answer

Endre picture Endre · Mar 4, 2014

You should connect with the -X or -Y option to be able to launch graphical applications:

ssh -X [email protected]

If that doesn't help, you should consult /etc/ssh/sshd_config whether X11Forwarding is enabled.