title: unable to open X server
body: <p>I am trying to generate a screenshot of a firefox window in my terminal, but I  keep getting an error:</p>
  
  <pre><code>root@host [~]# DISPLAY=:1 firefox http://www.cnn.com &amp; sleep 5 &amp;&amp; DISPLAY=:1 import -window root -crop 1264x948+0+25 -quality 90 /usr/local/apache/htdocs/screenshot1.jpg &amp;&amp; pkill firefox
  [1] 30200
  import: unable to open X server `:1' @ import.c/ImportImageCommand/364.
  </code></pre>
  
  <p>Why is this happening? How can I fix it?</p>