Skip to content

Instantly share code, notes, and snippets.

@jzfgo
Created July 8, 2015 17:07
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jzfgo/91006178753df6f503c1 to your computer and use it in GitHub Desktop.
Save jzfgo/91006178753df6f503c1 to your computer and use it in GitHub Desktop.
Manage Xvfb (Virtual Framebuffer X Server) as a service for systemd based distros (CentOS 7, Ubuntu 15...)
[Unit]
Description=Virtual Frame Buffer X Server
After=network.target
[Service]
ExecStart=/usr/bin/Xvfb :42 -screen 0 1x1x24 -ac +extension GLX +render -noreset
[Install]
WantedBy=multi-user.target
@jzfgo
Copy link
Author

jzfgo commented Jul 8, 2015

  1. Save as /etc/systemd/system/xvfb.service
  2. Enable with sudo systemctl enable xvfb.service
  3. Start with sudo systemctl start xvfb.service
  4. Check status with sudo systemctl status xvfb.service. You should see something like:
xvfb.service - Virtual Frame Buffer X Server
   Loaded: loaded (/etc/systemd/system/xvfb.service; enabled)
   Active: active (running) since Wed 2015-07-08 19:16:17 CEST; 2min 40s ago
 Main PID: 5119 (Xvfb)
   CGroup: /system.slice/xvfb.service
           └─5119 /usr/bin/Xvfb :42 -screen 0 1x1x24 -ac +extension GLX +render -noreset

More info on Xvfb options:

Based on:
http://askubuntu.com/a/621256

Advanced version (for multiple instances):
http://superuser.com/a/912648

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