Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

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.

share|improve this answer
    
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 rainydayz.org/node/8 –  symcbean Sep 15 '11 at 15:22
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.