how do you permanently disable the screen saver in Xvfb?

Solution 1:

Uncontrollable screen saver is often due to the default configuration of X, which is most conveniently changed by editing or creating a new /etc/X11/xorg.conf. Use sudo nano /etc/X11/xorg.conf to edit the file. Add the following section:

Section "ServerFlags"
    Option "BlankTime" "0"
EndSection

For more information see the xorg.conf manual page

Solution 2:

The connection between Xvfb and screensavers is tenuous. Screensavers are controlled by the X system, such as xfce, not by Xvfb. Xvfb is merely a screen to output pixels to, hence high CPU usage in screensaver apps and Xvfb must be disabled at the X(-org) level. You should set "*mode: off" in file /etc/X11/app-defaults/XScreenSaver and restart X or reboot.