Skip to content

Instantly share code, notes, and snippets.

@bndynet
Created July 10, 2018 02:37
Show Gist options
  • Save bndynet/cfab58172f37c0632d529a87371f0b93 to your computer and use it in GitHub Desktop.
Save bndynet/cfab58172f37c0632d529a87371f0b93 to your computer and use it in GitHub Desktop.
Xvfb - X virtual frame buffer

Xvfb, or X virtual frame buffer is needed by selenium and chromedriver or gekodriver, so it can srun via cron with your PC locked, or without your script taking focus from the user section

Install Xvfb on CentOS

  • yum install xorg-x11-server-Xvfb

  • Copy below to /etc/systemd/system/Xvfb.service

    [Unit]
    Description=X Virtual Frame Buffer Service
    After=network.target
    
    [Service]
    ExecStart=/usr/bin/Xvfb :99 -screen 0 1024x768x24
    
    [Install]
    WantedBy=multi-user.target
    
  • chmod +x /etc/systemd/system/Xvfb.service

  • systemctl enable Xvfb.service

  • systemctl start Xvfb.service

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment