Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer
    
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? –  davenewza Oct 16 '13 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 '13 at 10:40
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.