title: Render WebGL in Xfvb
body: <p>I want to headless test WebGL code using Xvfb. Does anybody know how to do that?</p>
  
  <p>I have 2 machines - both running Ubuntu. One with NVidia card and one with ATI:</p>
  
  <p>The NVidia machine:</p>
  
  <pre><code>ipmi:~ $&gt;xvfb-run glxinfo
  name of display: :455
  display: :455  screen: 0
  direct rendering: No (If you want to find out why, try setting LIBGL_DEBUG=verbose)
  server glx vendor string: SGI
  server glx version string: 1.4
  server glx extensions:
      GLX_ARB_multisample, GLX_EXT_visual_info, GLX_EXT_visual_rating, 
      GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_OML_swap_method, 
      GLX_SGI_make_current_read, GLX_SGIS_multisample, GLX_SGIX_fbconfig, 
      GLX_SGIX_pbuffer, GLX_MESA_copy_sub_buffer, GLX_INTEL_swap_event
  client glx vendor string: NVIDIA Corporation
  client glx version string: 1.4
  ...
  
  ipmi:~ $&gt;xvfb-run glxgears
  3725 frames in 5.0 seconds = 741.884 FPS
  3840 frames in 5.0 seconds = 767.310 FPS
  4080 frames in 5.0 seconds = 814.811 FPS
  4120 frames in 5.0 seconds = 821.859 FPS
  </code></pre>
  
  <p>The ATI machine:</p>
  
  <pre><code>shaka:~ $&gt;xvfb-run glxinfo
  name of display: :99
  display: :99  screen: 0
  direct rendering: Yes
  server glx vendor string: SGI
  server glx version string: 1.4
  server glx extensions:
      GLX_ARB_multisample, GLX_EXT_visual_info, GLX_EXT_visual_rating, 
      GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_OML_swap_method, 
      GLX_SGI_make_current_read, GLX_SGIS_multisample, GLX_SGIX_fbconfig, 
      GLX_SGIX_pbuffer, GLX_MESA_copy_sub_buffer, GLX_INTEL_swap_event
  client glx vendor string: Mesa Project and SGI
  client glx version string: 1.4
  
  shaka:~ $&gt;xvfb-run glxgears
  4326 frames in 5.0 seconds = 865.095 FPS
  4343 frames in 5.0 seconds = 868.540 FPS
  </code></pre>
  
  <p>Even if shaka supports direct rendering using Mesa, I can't get a WebGL context.</p>
  
  <p>Thanks!</p>