3

I am trying to install an Adobe AIR file running ssh in a terminal (no GUI):

sudo Adobe\ AIR\ Application\ Installer -silent -eulaAccepted MyAirApp.air

But I receive the following error:

(Adobe AIR Application Installer:7509): Gtk-WARNING **: cannot open display:

How can this be done?

EDIT: This command is being run remotely using SSH

1 Answer 1

4

How to run a Adobe AIR application on a headless server

The problem is not that you are trying to run it from a terminal. The problem is that there is no graphical display running on the machine. You seem to be running on a headless server.

I'm aware of two possibilities:

  • If you connect with ssh, you can add the -X option and allow the Adobe AIR application to use your local display
  • You can fool Adobe AIR into believing that there is a display running by installing xvfb. Use the script bellow which I've copied from this post:

Copy this code into a file named xvfb_wrapper.sh:

#!/bin/sh
# 
# Author: Matthew Wilson, rPath, Inc. 
# 
# This could probably be done more elegantly in Python... 

pid='' 
for ((d=0; d < 20; d++)); do 
    DISPLAY=:$d 
    Xvfb -ac $DISPLAY > /dev/null 2>&1 & 
    sleep 2 
    jobs -l %1 > /dev/null 
    pid=$(jobs -l %1 2>&1 | grep Running | awk '{print $2}') 
    if [ -z "$pid" ]; then 
        continue 
    fi 
    if ps $pid > /dev/null 2>&1; then 
        break 
    fi 
done 

if [ -z "$pid" ]; then 
    echo "unable to start Xvfb" 
    exit 1 
fi 

trap "kill -9 $pid" SIGINT SIGTERM EXIT 

export DISPLAY=$DISPLAY 

$*

Call chmod +x xvfb_wrapper.sh to give it execution rights. Call your application with the xvfb_wrapper.sh in front of it. In this example this would be:

sudo xfvb_wrapper.sh "Adobe AIR Application Installer" -silent -eulaAccepted MyAirApp.air

Edit: Added information from comments and the script from link.

3
  • Thanks for the answer - it makes sense then. I am running this command by SSH remotely. Running the command directly on the box works. How would we get it to run successfully through SSH? Also by using xvfb?
    – Dave New
    Oct 16, 2013 at 9:58
  • It will work with ssh too. But with ssh you aren't forced to use xvfb, you can use the -X option with ssh and allow Adobe AIR to use your local display.
    – MadMike
    Oct 16, 2013 at 10:40
  • You can use xvfb-run command instead of the script. Dec 22, 2015 at 10:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .