Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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 can start the xvfb instance just fine

Xvfb :1 -screen 0 800x600x24

I can then launch firefox and have it load correctly but the window is always smaller than the resolution I set during the xvfb command.

firefox --display=:1

enter image description here

You can see the black bar, that's the full resolution. It appears it's sizing to what the page wants but it will never fill it out completely.

share|improve this question
What is your goal? – izx Jun 26 '12 at 14:53
I want to get an accurate screenshot at different resolutions. Since this is not the exact resolution it messes up my tests. – Ryan Detzel Jun 26 '12 at 15:01

Here is a solution, not pretty but works. Uses xdotool to set size after Firefox is running.


xdotool search --onlyvisible firefox

This will display a single window ID, windowid. Then:

xdotool windowmove windowid 0 0
xdotool windowsize windowid 1280 720

You must first do the windowmove and follow it by the windowsize.

In some cases once I did this, the size and position were correct forever more, in other cases had to run again each time I ran Firefox.

share|improve this answer

Assume the border is there and compensate accordingly in your capture. If you need 1024x768, then set the screen size to 1034x778 and capture 1024x768

Xvfb :1 -screen 0 1034x778x24 > /dev/null &
ffmpeg -t 1 -s 1024x768 -f x11grab -i :1.0+10,10 -f mjpeg screenshot.png
share|improve this answer

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.