title: Xvfb server does not work under different user
body: <p>I'm trying to run an Xvfb server on an Amazon EC2 instance and then have a selenium Firefox driver use the virtual display to save screenshots of websites.  I was formerly using PhantomJS, but it can not load all of the types of pages that I need it to.</p>
  
  <p>This server works fine when I run it on my local user on a remote Amazon EC2 instance, but when I try to run it as "qauser", my selenium Firefox driver cannot connect to the virtual display; it simply hangs when I try to initialize the webdriver.  If I attempt to launch firefox using the virtual display, I get "Error: Access was denied while trying to open files in your profile directory."</p>
  
  <p>If I su into qauser, and then run Xvfb and my application, it works fine.  If I run Xvfb as qauser, and run the webdriver as my own user, it works.  The problem occurs when I run both Xvfb and my application as qauser.  Does anyone have any idea of that might be wrong?</p>
  
  <p>My Xvfb server, and application which creates the webdriver are run with supervisord.  The config is posted here:</p>
  
  <pre><code>[program:QaServer]
  command = python /opt/corp/qa_tool/main.py
  environment = PATH='$PATH:/opt/bin:/usr/local/bin:/usr/bin', DISPLAY='localhost:99'
  user = qauser
  directory = /home/qauser
  priority = 1
  stdout_logfile = /opt/corp/qaData/qaTool.log
  redirect_stderr = true
  
  [program:Xvfb]
  command = Xvfb :99
  user = qauser
  directory = /home/qauser
  priority = 2
  stdout_logfile = /opt/corp/qaData/qvfb.log
  redirect_stderr = true
  </code></pre>