title: Mac 10.6 server / tomcat / jenkins / vncserver can not run in directory
body: <p>First let me point out I'm a newbie with tomcat &amp; Jenkins. This is the first CI server i have setup.</p>
  
  <p>Im developing a flex app, and my goal is to have jenkins auto-build and run flexUnit tests after changes are pushed to github.</p>
  
  <p>so far I have:</p>
  
  <ol>
  <li><p>installed Jenkins (1.450) under tomcat (6.0.33) on a headless mac mini server running (10.6.8) 
  (basically following "Servlet Container Installation on Mac OS X Server (10.6)" @ 
  <a href="http://wiki.wocommunity.org/display/WO/Installing+and+Configuring+Jenkins+Build+Server" rel="nofollow">http://wiki.wocommunity.org/display/WO/Installing+and+Configuring+Jenkins+Build+Server</a>)</p></li>
  <li><p>downloaded flexSDK, setup user authentication and configured github hooks.</p></li>
  </ol>
  
  <p>at this point everything is working fine, jenkins will build a simple flex app once changes are pushed to github</p>
  
  <p>now I'm attempting to build the flexUnit Sample CI Project. on first attempt it gets stuck waiting for a replay from Flash Player Debugger (projector). After some research I found flash player needs to run in a virtual display. So I installed Xvnc Jenkins/Hudson Plugin (https://wiki.jenkins-ci.org/display/JENKINS/Xvnc+Plugin). </p>
  
  <p>Os X has a built in vnc server however it doesn't seem to communicate with Xvnc, so I installed tightvnc (via macports).</p>
  
  <p>Then I setup the VNC password in my jobs workspace by running the following command in terminal 
  "sudo -u _appserver vncpasswd /Library/Jenkins/jobs/flexUnitSampleCIProject/workspace/.vnc/passwd"</p>
  
  <p>And this is where I'm stuck, when I try to build flexUnitSampleCIProject I get the following error </p>
  
  <pre><code>FATAL: Cannot run program "vncserver" (in directory "/Library/Jenkins/jobs/flexUnitSampleCIProject/workspace"): error=2, No such file or directory
  java.io.IOException: Cannot run program "vncserver" (in directory "/Library/Jenkins/jobs/flexUnitSampleCIProject/workspace"): error=2, No such file or directory
  </code></pre>
  
  <p>My gut feeling is this is a permissions issue since jenkins is running under the user _appserver </p>
  
  <p>So I ran ran the following command in terminal<br>
  "sudo -u _appserver vncserver :6" and i get the following error
  "vncserver: Wrong type or access mode of /Users/admin/.vnc."</p>
  
  <p>However I read sudo doesn't inherit the home folder of the user (in this case "_appserver") and "su _appserver" dosen't work so I'm not sure where to go from here </p>
  
  <p>Has anyone had any luck running flexUnit on mac server/tomcat/jenkins?</p>
  
  <p>any ideas would be greatly appreciated </p>