Login

Login
  • Register
  • VectorDesign blog

    Testing Automation and general Tech Geek stuff

    Xvfb

    Posted in linux on 11 March 2015 by vectordesign
    Install Xvfb – the X Virtual FrameBuffer

    This piece of software emulates the framebuffer using virtual memory which lets you run X-Server in machines with no display devices. This service is required to make browsers run normally by making them believe there is a display available. To install xvfb in ubuntu or Debian, run the following command,

    sudo apt-get install xvfb
    

    Now lets run the xvfb service in a display number which is less likely to clash even if you add a display at later stage. For this tutorial, we will assume a display, 10.

    sudo Xvfb :10 -ac
    

    The parameter -ac makes xvfb run with access control off. The server should be running now.

    Install Fonts
    sudo apt-get install -y x11-xkb-utils
    sudo apt-get install -y xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic
    sudo apt-get install -y x-ttcidfont-conf cabextract ttf-mscorefonts-installer
    sudo dpkg-reconfigure --default-priority x-ttcidfont-conf

     

     

    Start browser headlessly in Ubuntu

    Before you can run a browser, you need to set the environment variable DISPLAY with the display number at which xvfb is running. Before we add the environmental variable as a persistent one, let us check whether everything works as expected.

    export DISPLAY=:10
    
    
    
    
    

    Leave a Reply