Skip to content

Running without a Display

Ben Fry edited this page May 14, 2015 · 2 revisions

Let's say you want to run a Processing sketch on a server. Like maybe you want to generate several million PDF and JPEG images using a handful of Amazon EC2 instances.

This is called “headless” mode, and to do so, it's necessary to install what's known as a virtual frame buffer.

On Ubuntu 14.04, these are the things you need to install first:

sudo apt-get install xvfb libxrender1 libxtst6 libxi6 

Then you create a fake "display" that Processing can use:

sudo Xvfb :1 -screen 0 1024x768x24
export DISPLAY=":1"

Finally, run a sketch that's been exported as a Linux application from the PDE.

Why?

It's necessary to use the virtual frame buffer because it would require a truly ridiculous amount of work to make Processing so general that it could be done without a display. This would involve a great deal of code and abstraction that simply doesn't make sense when 99.9999% of the code created with Processing will be run with a display. Happily, this method works well and prevents us from needing to double the size of PApplet.

Clone this wiki locally