Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

unable to open X server

I am trying to generate a screenshot of a firefox window in my terminal, but I keep getting an error:

root@host [~]# DISPLAY=:1 firefox http://www.cnn.com & sleep 5 && DISPLAY=:1 import -window root -crop 1264x948+0+25 -quality 90 /usr/local/apache/htdocs/screenshot1.jpg && pkill firefox
[1] 30200
import: unable to open X server `:1' @ import.c/ImportImageCommand/364.

Why is this happening? How can I fix it?

like image 920
soniccool Avatar asked Oct 09 '22 13:10

soniccool


1 Answers

Maybe try DISPLAY=:0, for example?

like image 73
Michael Krelin - hacker Avatar answered Oct 18 '22 22:10

Michael Krelin - hacker