Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to run an applescript that uses Finder; however, I have to run it as a user connected via ssh. So there's no UI. And the script fails with -10810 error when there's no UI.

Is there any alternative for X11's Xvfb that I could use for Mac server 10.6 to fake a display and make the script work?



Edit: To explain the problem more precisely - the script works if there's a user logged in with UI (e.g., when the user that uses ssh to run the script is also logged in via VNC). However, when I only log in using ssh, the error appears. Which leads me to believe that the script needs UI to be able to use Finder.

So I guess running X11 and Xvfb on the server won't really help, because it won't allow me to run the script anyway (I need to start Finder).

share|improve this question
up vote 0 down vote accepted

It's not just the Finder, AppleScript is really intended to control programs running within an Aqua UI session; trying to use it from a pure command-line environment (or even X11) seems doomed to failure. If you're in a command-line environment, I'd use a shell script if at all possible -- there are commands available to do pretty much anything the Finder can do.

share|improve this answer

Xvfb is not "Linux's", it's X11.

Mac OS X includes X11 support, called XQuartz (aka, installed with the system by default since version 10.5. It includes Xvfb (/usr/X11/bin/xvfb).

EDIT: Now, that you explained better what you need, it's more clear. What you want is headless setup, to run GUI apps on that you need to either setup VNC server or use Apple Remote Desktop.

share|improve this answer
You're right, I haven't explained myself correctly. Anyway, I think this won't really help - the problem is that there must be a user logged in with UI (i.e., not using ssh), otherwise the script fails. And X11 won't allow me to run finder or will it? – Tomas Brambora Feb 23 '11 at 10:50
As of this writing, xvfb is no longer installed by default on OSX. – meatspace Nov 16 '15 at 17:23

Your Answer


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.