Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a server running 12.04 32bit.

I would like to change the wallpaper via an ssh connection.

I tried the following command, but it didn't change the wallpaper. The command works if I am on the server (physically sat down with a keyboard and monitor connected), but not via an ssh connection.

gsettings set org.gnome.desktop.background picture-uri "file:///tmp/ozvsk.jpg"

Any ideas?

share|improve this question
are you getting any particular error? What is the full ssh command that you are using? – ImaginaryRobots Nov 19 '12 at 22:53

I think you can try the following:

ssh user@remotehost

Once you are logged in the remote host you need to export the "Display" so you can search it with this.

env | grep 'DISPLAY'

The result is:


Now you can export the DISPLAY.

export DISPLAY=:0

Then you can set the background.

gsettings set org.gnome.desktop.background picture-uri "file:///tmp/ozvsk.jpg"


share|improve this answer
env | grep 'DISPLAY' is empty for me. When I export DISPLAY=:0 and execute gsettings ... nothing happens – Sergey Jul 24 '13 at 9:39
if you want to do ssh on localhost, try this: ssh -X user@, then you can search the Display with env | grep 'DISPLAY' (eg: DISPLAY=localhost:10.0). Finally use the gsettings: gsettings set org.gnome.desktop.background picture-uri "file:///home/user/wallpaper.jpg". Hope this will be helpful. – Roman Raguet Jul 24 '13 at 14:50

Your Answer


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.