<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://ebasso.net/wiki/index.php?action=history&amp;feed=atom&amp;title=Install_the_Virtual_Frame_Buffer_on_Linux</id>
	<title>Install the Virtual Frame Buffer on Linux - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://ebasso.net/wiki/index.php?action=history&amp;feed=atom&amp;title=Install_the_Virtual_Frame_Buffer_on_Linux"/>
	<link rel="alternate" type="text/html" href="https://ebasso.net/wiki/index.php?title=Install_the_Virtual_Frame_Buffer_on_Linux&amp;action=history"/>
	<updated>2026-06-02T13:39:03Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://ebasso.net/wiki/index.php?title=Install_the_Virtual_Frame_Buffer_on_Linux&amp;diff=1020&amp;oldid=prev</id>
		<title>Ebasso: New page: Install Xvfb If the name of your machine is &lt;YourServerName&gt;, use the following:  [root@&lt;YourServerName&gt; R-2.6.1]# yum update xorg-x11-server-Xorg  [root@&lt;YourServerName&gt; R-2.6.1]# yum ins...</title>
		<link rel="alternate" type="text/html" href="https://ebasso.net/wiki/index.php?title=Install_the_Virtual_Frame_Buffer_on_Linux&amp;diff=1020&amp;oldid=prev"/>
		<updated>2010-08-19T22:37:05Z</updated>

		<summary type="html">&lt;p&gt;New page: Install Xvfb If the name of your machine is &amp;lt;YourServerName&amp;gt;, use the following:  [root@&amp;lt;YourServerName&amp;gt; R-2.6.1]# yum update xorg-x11-server-Xorg  [root@&amp;lt;YourServerName&amp;gt; R-2.6.1]# yum ins...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Install Xvfb&lt;br /&gt;
If the name of your machine is &amp;lt;YourServerName&amp;gt;, use the following:&lt;br /&gt;
&lt;br /&gt;
[root@&amp;lt;YourServerName&amp;gt; R-2.6.1]# yum update xorg-x11-server-Xorg &lt;br /&gt;
[root@&amp;lt;YourServerName&amp;gt; R-2.6.1]# yum install xorg-x11-server-Xvfb.x86_64&lt;br /&gt;
&lt;br /&gt;
Start and Test Xvfb&lt;br /&gt;
To start Xvfb, use the following command:&lt;br /&gt;
&lt;br /&gt;
[root@&amp;lt;YourServerName&amp;gt; R-2.6.1]# /usr/bin/Xvfb :2 -nolisten tcp -shmem&lt;br /&gt;
&lt;br /&gt;
This starts a Display on servernumber = 2 and screen number = 0.&lt;br /&gt;
&lt;br /&gt;
To test whether the X11, PNG and JPEG devices are available in R:&lt;br /&gt;
&lt;br /&gt;
[root@&amp;lt;YourServerName&amp;gt; R-2.6.1]# export DISPLAY=:2.0 &lt;br /&gt;
[root@&amp;lt;YourServerName&amp;gt; R-2.6.1]# bin/R&lt;br /&gt;
&lt;br /&gt;
You will see many lines of output. At the &amp;quot;&amp;gt;&amp;quot; prompt, run the capabilities() command. It will tell you whether the X11, JPEG and PNG devices are functioning. The following example output shows success:&lt;br /&gt;
&lt;br /&gt;
&amp;gt; capabilities() &lt;br /&gt;
   jpeg png tcltk X11 http/ftp sockets libxml fifo &lt;br /&gt;
   TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE &lt;br /&gt;
 cledit iconv NLS profmem &lt;br /&gt;
   TRUE TRUE TRUE FALSE&lt;br /&gt;
&lt;br /&gt;
Make configuration changes to ensure that Xvfb is started at boot-time&lt;br /&gt;
You need to make sure that Xvfb runs at all times on the machine or R will not function as needed. There are many ways to do this. This example uses a simple start/stop script and treats it as a service.&lt;br /&gt;
&lt;br /&gt;
The script:&lt;br /&gt;
&lt;br /&gt;
[root@&amp;lt;YourServerName&amp;gt; R-2.6.1]# cd /etc/init.d &lt;br /&gt;
[root@&amp;lt;YourServerName&amp;gt; init.d]# vi xvfb &lt;br /&gt;
   #!/bin/bash &lt;br /&gt;
   # &lt;br /&gt;
   # /etc/rc.d/init.d/xvfb &lt;br /&gt;
   # &lt;br /&gt;
   # Author: Brian Connolly (LabKey.org) &lt;br /&gt;
   # &lt;br /&gt;
   # chkconfig: 345 98 90 &lt;br /&gt;
   # description: Starts Virtual Framebuffer process to enable the  &lt;br /&gt;
   # LabKey server to use R. &lt;br /&gt;
   # &lt;br /&gt;
   #&lt;br /&gt;
&lt;br /&gt;
XVFB_OUTPUT=/usr/local/labkey/Xvfb.out    XVFB=/usr/bin/Xvfb    XVFB_OPTIONS=&amp;quot;:2 -nolisten tcp -shmem&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Source function library.    . /etc/init.d/functions&lt;br /&gt;
&lt;br /&gt;
   start() {            echo -n &amp;quot;Starting : X Virtual Frame Buffer &amp;quot;            $XVFB $XVFB_OPTIONS &amp;gt;&amp;gt;$XVFB_OUTPUT 2&amp;gt;&amp;amp;1&amp;amp;            RETVAL=$?            echo            return $RETVAL    }&lt;br /&gt;
&lt;br /&gt;
stop() {            echo -n &amp;quot;Shutting down : X Virtual Frame Buffer&amp;quot;            echo            killproc Xvfb            echo            return 0    }&lt;br /&gt;
&lt;br /&gt;
case &amp;quot;$1&amp;quot; in        start)            start            ;;        stop)            stop            ;;        *)            echo &amp;quot;Usage: xvfb {start|stop}&amp;quot;            exit 1            ;;    esac    exit $?&lt;br /&gt;
&lt;br /&gt;
Now test the script with the standard:&lt;br /&gt;
&lt;br /&gt;
[root@&amp;lt;YourServerName&amp;gt; etc]# /etc/init.d/xvfb start &lt;br /&gt;
[root@&amp;lt;YourServerName&amp;gt; etc]# /etc/init.d/xvfb stop &lt;br /&gt;
[root@&amp;lt;YourServerName&amp;gt; etc]# /etc/init.d/xvfb&lt;br /&gt;
&lt;br /&gt;
This should work without a hitch.&lt;br /&gt;
&lt;br /&gt;
Note: Any error messages produced by Xvfb will be sent to the file set in&lt;br /&gt;
&lt;br /&gt;
$XVFB_OUTPUT.&lt;br /&gt;
&lt;br /&gt;
If you experience problems, these messages can provide further guidance.&lt;br /&gt;
&lt;br /&gt;
The last thing to do is to run chkconfig to finish off the configuration. This creates the appropriate start and kills links in the rc#.d directories. The script above contains a line in the header comments that says &amp;quot;# chkconfig: 345 98 90&amp;quot;. This tells the chkconfig tool that xvfb script should be executed at runlevels 3,4,5. It also specifies the start and stop priority (98 for start and 90 for stop). You should change these appropriately.&lt;br /&gt;
&lt;br /&gt;
[root@&amp;lt;YourServerName&amp;gt; init.d]# chkconfig --add xvfb&lt;br /&gt;
&lt;br /&gt;
Check the results:&lt;br /&gt;
&lt;br /&gt;
[root@&amp;lt;YourServerName&amp;gt; init.d]# chkconfig --list xvfb &lt;br /&gt;
xvfb 0:off 1:off 2:off 3:on 4:on 5:on 6:off&lt;br /&gt;
&lt;br /&gt;
Verify that the appropriate soft links have been created:&lt;br /&gt;
&lt;br /&gt;
[root@&amp;lt;YourServerName&amp;gt; init.d]# ls -la /etc/rc5.d/ | grep xvfb &lt;br /&gt;
lrwxrwxrwx 1 root root 14 2008-01-22 18:05 S98xvfb -&amp;gt; ../init.d/xvfb&lt;br /&gt;
&lt;br /&gt;
Start the Xvfb Process and Setup the DISPLAY Env Variable&lt;br /&gt;
Start the process using:&lt;br /&gt;
&lt;br /&gt;
[root@&amp;lt;YourServerName&amp;gt; init.d]# /etc/init.d/xvfb start&lt;br /&gt;
&lt;br /&gt;
Now you will need to the set the DISPLAY env variable for the user. This is the DISPLAY variable that is used to run the TOMCAT server. Add the following the .bash_profile for this user. On this serer, the TOMCAT process is run by the user tomcat&lt;br /&gt;
&lt;br /&gt;
[root@&amp;lt;YourServerName&amp;gt; ~]# vi ~tomcat/.bash_profile &lt;br /&gt;
[added] &lt;br /&gt;
# Set DISPLAY variable for using LabKey and R. &lt;br /&gt;
DISPLAY=:2.0 &lt;br /&gt;
export DISPLAY&lt;br /&gt;
&lt;br /&gt;
Restart the LabKey Server or it will not have the DISPLAY variable set&lt;br /&gt;
On this server, we have created a start/stop script for TOMCAT within /etc/init.d. So I will use that to start and stop the server&lt;/div&gt;</summary>
		<author><name>Ebasso</name></author>
	</entry>
</feed>