3

When I execute an application with xvfb-run, I can either explicitly specify an X11 server number (i.e. 44), or I can use --auto-servernum, which will assign one for me.

If I use --auto-servernum, how do I know what number it picked?

I'm trying to use this in a script, so if xvfb-run could output that somewhere so that I can use subsequent commands on the right X11 server, that'd be helpful.

Brad
  • 5,686
  • 8
  • 52
  • 83

1 Answers1

4

It is put into the DISPLAY environment variable. You can see this by running

printenv DISPLAY
xvfb-run printenv DISPLAY
printenv DISPLAY

The first and last will show your regular display, the middle one will show the xvfb one.

user2554330
  • 206
  • 1
  • 5