0

I'm connecting to a ubuntu 11.04 through ssh, and I'm trying to run this command(is a Image Magick command):

*This command saves any visible window on an X server and outputs it as an image file.

sudo import -window root -display :0 screen.png
No protocol specified import: unable to open X server `:0' @ error/import.c/ImportImageCommand/362.

I think that the problem is unity, because if I try this in ubuntu before 11.04 it runs without problems(The older versions uses gnome instead of unity). Somebody knows how to connect to the x server in ubuntu 11.04?

Thanks in advance.

xBoy
  • 3
  • 1
  • 2

1 Answers1

1

try running

xhost +localhost

On the server before grabbing the window.

Edit

BTW you need to be logged in as the same user whom has logged into the X server and set DISPLAY before running xhost.

symcbean
  • 21,009
  • 1
  • 31
  • 52
  • No luck with this, doing exactly what you told me gives me this: No protocol specified xhost: unable to open display ":0" – xBoy Sep 15 '11 at 14:47
  • Then you're running sudo as the same user who is logged in - see also http://www.rainydayz.org/node/8 – symcbean Sep 15 '11 at 15:22