X11 is no longer included with OS X:
https://support.apple.com/en-us/HT201341
X11 server and client libraries for OS X are available from the XQuartz project:
http://xquartz.macosforge.org/
I'm not sure if it includes all the other X goodies like Xvfb. In that case you could compile it yourself; with these options:
--disable-xquartz --enable-xvfb --enable-xnest --enable-kdrive
More info here:
https://www.xquartz.org/Developer-Info.html
IMO:
It seems like you would be better of by using wkhtmltoimage straight on the mac osx, removing the need for X:
http://minimul.com/install-osx-wkhtmltoimage-binaries.html
$ type Xvfb; Xvfb is /opt/X11/bin/Xvfb
. You can simply run it like this:Xvfb :5 -ac -screen 0 1024x768x8 -extension GLX
- and then let your X11-application connect to this screen by settingDISPLAY=:5.0
. This link might be helpful: afitnerd.com/2011/09/06/headless-browser-testing-on-mac – HerebyDISPLAY=:5.0
and notDISPLAY=:5
? – Lactoprotein