I'm running a guest Linux OS on top of Windows XP, which rotates its wallpapers using the PowerToy Wallpaper Changer. I'm hoping for a way for my guest OS to somehow detect which wallpaper the host is using, and automatically switch to it.

Why? Because if I run my guest OS in seamless mode and have transparent windows, I want the transparent background to match the host OS. It looks nice that way :).

A couple tidbits of relevant information:

  • Guest OS is Peppermint Ice (Ubuntu based)
  • Host OS is Windows XP
  • VirtualBox as virtualization software

I realize this is somewhat breaking borders between the host and the guest, but I want my pretty rotating wallpaper! I'm guessing there is a way using scripts and shared folders or something similar, if not by means of just querying the host OS.


This question will end needing programming. You can start listening to Desktop Settings changes, when a new setting is applied grab the current path to wallpaper from registry and "signal" to some app.

Thats a example I made and tested against Microsft Windows 7 64bits was compiled using mingw32 (linux devel here) Wallpaper Monitor. You can easily change/expand line 62.

  • Thanks, I'm guessing the same registry setting also works for Windows 7?
    – Jeff
    Jun 7 '11 at 21:02
  • 1
    Yes same @Jeff . Here is a small code of mine for setting random wp rejeane.c project in C.
    – dvd
    Jun 7 '11 at 22:13
  • Looks like you've given enough info here for me to get something working on my Windows 7 machine as well! Thanks!
    – Jeff
    Jun 8 '11 at 21:21

If you're using Windows PowerToys, the current active wallpaper will be at C:\WINDOWS\system32\toyhide.bmp.

You can set up the virtual machine to mount the system32 folder and add a cron job to set the wallpaper to the toyhide.bmp file every minute. It might be a good idea to mount this folder as read only just in case something tries to muck with it.

Edit: My cron solution annoyed me by always refreshing my wallpaper even when it hadn't changed, so instead I wrote a python script to run at startup. This script basically looks at the mounted toyhide.bmp and only refreshes the wallpaper if it has been modified, checking every second to reduce lag time.

import os
import time

# Update to wherever you mounted toyhide.bmp
fname = "/<mnt_location>/toyhide.bmp"

# Peppermint uses pcmanfm for setting the wallpaper. YMMV
wallpaper_cmd = "/usr/bin/pcmanfm  --set-wallpaper=%s" % fname

# Update the wallpaper on startup and save the mod time
mod_time = os.path.getmtime(fname)

while True:
        # If mod time changes, set wallpaper again and get new mod time
        if os.path.getmtime(fname) != mod_time:
            mod_time = os.path.getmtime(fname)
    except OSError:
        # Sometimes the mount seems to fail if my computer is sleeping.
        # Just catch the error and try again

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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