Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I need to run a program on Mac remotely via ssh from a linux machine. The funny thing about the program is that it has a command line interface, but it always creates a GUI window, even if this is not necessary. Since I log in from a Linux machine, I get the following error:

<Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer,
_CGSDefaultConnection() is NULL.
couldn't allocate new Mac window

Can I somehow make it think that it connects to the WindowServer on the Mac? (again, I don't need to see that window)

share|improve this question

migrated from stackoverflow.com May 16 '12 at 8:38

This question came from our site for professional and enthusiast programmers.

    
What is the ssh command? Try removing -x options. –  Linuxios May 15 '12 at 13:03
    
Aren't you confusing X11 and the Mac Window Server? They are different technologies. –  trojanfoe May 15 '12 at 13:08
add comment

1 Answer

You've misdiagnosed the problem: Judging from the error message, the program is trying to open a window on the Mac console, which it doesn't have the right to access because you're not sitting at the keyboard (imagine if somebody else is, and a window suddenly pops up).

Linux runs X11, your Mac is running Window Server (unless you also set up X11). If you start up emacs in your ssh terminal, it might succeed in popping up a window on your linux box, with the help of the DISPLAY environment variable.

But your program isn't doing this. Perhaps it will, if you define the variable DISPLAY appropriately. Ssh can automate that with the -X option. You'll know it's set up right when you can make ordinary X programs, like emacs or xterm, pop up a window on your box. If you need to run a GUI program remotely, that's the only way to do it.

But since you say you don't actually need the GUI: Read your program's documentation and find out if there's a commandline option that suppresses it.

share|improve this answer
    
The OP mentions X11 in the title, but I think he is confused (the Mac WindowServer isn't X11 is it). –  trojanfoe May 15 '12 at 13:05
    
Since he's logging on FROM linux, a normal program would indeed be trying to open an X11 window on linux. He's got a different problem though, I see that now from the error message. –  alexis May 15 '12 at 13:07
    
Doesn't work. Get the same error. Do you think that the title is misleading (I am confused indeed) –  user1084871 May 15 '12 at 13:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.