2 Replies Latest reply on Oct 19, 2010 3:37 PM by rfkrocktk

    Is there a guide to running headless on Linux?

    rfkrocktk Level 1

      When I run the following build:

       

       

      <target name="compile.client.test" depends="setup.test">
           <mxmlc file="${client.test.src.file}" output="${client.test.bin.file}"
                     fork="true" maxmemory="256m" debug="true" optimize="true"
                     incremental="true">
                <default-size width="800" height="600"/>
                <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
                <source-path path-element="${client.main.src.dir}"/>
                <source-path path-element="${client.test.src.dir}"/>
                <library-path dir="${client.main.lib.dir}" append="true" includes="*.swc"/>
                <library-path dir="${client.test.lib.dir}" append="true" includes="*.swc"/>
                <compiler.verbose-stacktraces>true</compiler.verbose-stacktraces>
                <compiler.headless-server>true</compiler.headless-server>
                <static-link-runtime-shared-libraries>true</static-link-runtime-shared-libraries>
           </mxmlc>
      </target>
      
      <target name="test.client" depends="compile.client.test">
           <flexunit swf="${client.test.bin.file}" 
                haltonfailure="true" verbose="false" localtrusted="true"
                headless="true" todir="${client.flexunit.bin.dir}"/>
      </target>
      

       

       

      I get the following error:

       

       

      Buildfile: /home/rfkrocktk/Documents/Helios/activeinterview/build.xml
      setup:
      setup.main:
      setup.test:
      compile.client.test:
          [mxmlc] Loading configuration file /opt/adobe/flex/4.1.0.16076/frameworks/flex-config.xml
          [mxmlc] /home/rfkrocktk/Documents/Helios/activeinterview/activeinterview-client/build/test/test.application.swf is up-to-date and does not have to be rebuilt.
      test.client:
       [flexunit] Starting xvnc
      
      BUILD FAILED
      /home/rfkrocktk/Documents/Helios/activeinterview/build.xml:84: java.io.IOException: Cannot run program "vncserver": java.io.IOException: error=2, No such file or directory
      
      Total time: 3 seconds
      

       

       

      I assumed that this means that I don't have a VNC server implementation installed, so I installed one:

       

       

      sudo apt-get install vnc4server
      

       

       

      Now the error I'm getting is this:

       

       

      Buildfile: /home/rfkrocktk/Documents/Helios/activeinterview/build.xml
      setup:
      setup.main:
      setup.test:
      compile.client.test:
          [mxmlc] Loading configuration file /opt/adobe/flex/4.1.0.16076/frameworks/flex-config.xml
          [mxmlc] /home/rfkrocktk/Documents/Helios/activeinterview/activeinterview-client/build/test/test.application.swf is up-to-date and does not have to be rebuilt.
      test.client:
       [flexunit] Starting xvnc
       [flexunit] You will require a password to access your desktops.
       [flexunit] Password:
       [flexunit] getpassword error: Invalid argument
       [flexunit] You will require a password to access your desktops.
       [flexunit] getpassword error: Invalid argument
       [flexunit] Password:
       [flexunit] You will require a password to access your desktops.
       [flexunit] getpassword error: Invalid argument
       [flexunit] Password:
      
      BUILD FAILED
      /home/rfkrocktk/Documents/Helios/activeinterview/build.xml:84: java.io.IOException: org.flexunit.ant.launcher.commands.headless.XvncException: Could not start xvnc using displays 99-101; Consider adding to your launch script: killall Xvnc Xrealvnc; rm -fv /tmp/.X*-lock /tmp/.X11-unix/X*
      
      Total time: 3 seconds
      

       

       

      What does this mean? Do I need my Linux user password in order to start a vnc screen?

       

      I have checked and the VNC server doesn't seem to be running, and I have run the scripts that it recommends. Any ideas? (I'm running Ubuntu 9.10 64bit if that helps any.)

        • 1. Re: Is there a guide to running headless on Linux?
          legrosb Level 3

          @rfkrocktk - I've put together some documentation on the Wiki for supporting Continuous Integration @ http://docs.flexunit.org/index.php?title=Continuous_Integration_Support.  Basically the FlexUnit Ant task supports integration with Xvnc much like the Hudson Xvnc plugin it was designed to mimic.  Both plugins require a vncserver impl to be installed and setup correctly to work; you can find more info on the wiki @ http://docs.flexunit.org/index.php?title=Ant_Task#Xvnc_Support.  vnc4server requires a user password to be setup for the user running it before it can be used in any capacity.  My advise is to log into the machine as the user running your build script, type "vncserver", give the instance a password and attempt to manually start the vncserver on display 99, "vncserver :99".  If all works kill it using "vncserver -kill :99" and try running the build again.

           

          If you run into more issues, try out the guide on Continuous Integration Support.  If the guide doesn't address your issues, let us know and we'll figure it out.  Please keep in mind the Xvnc support in the Ant task is intended for us with CI solutions other than Hudson.  If you are using Hudson to run your build, try out the Xvnc plugin and set headless="false" to see if you have any better luck.

           

          Let us know how it goes.

           

          -Brian

          • 2. Re: Is there a guide to running headless on Linux?
            rfkrocktk Level 1

            Thanks so much for your response, it completely solved my problem.

             

            Basically, for the future's sake, here is the whole process I went through on Ubuntu.

             

            First, install a VNC server:

            sudo apt-get install vnc4server
            

             

            Next, start and configure the server:

            vncserver
            

             

            At this point, it should ask you to create a password for VNC. Do so, then continue.

             

            Start a VNC screen on screen 99:

            vncserver :99
            

             

            If that goes through alright, then kill the screens created. (For me, when I ran vncserver for the first time, it created a screen at :1, so we'll kill both of the screens created)

            vncserver -kill :99
            vncserver -kill :1
            

             

            Done. Now, it "just works."