I have some unit tests that need an X11 display so I plan to start Xvfb before running them, but to start Xvfb I will need a free display number to connect it to. My best guess
Possibly a bit off-topic, but if you use xvfb-run to start your Xserver-needing command, then just running
xvfb-run
# xvfb-run -a your command
does the trick.