Linux

How to install Xvfb and create systemd Xvfb service on CentOS 7 / 8 or RHEL 7 / 8

Xvfb or X virtual framebuffer is a display server implementing the X11 display server protocol.

In contrast to other display servers, Xvfb performs all graphical operations in virtual memory without showing any screen output.

From the point of view of the client, it acts exactly like any other X display server, serving requests and sending events and errors as appropriate.

However, no output is shown.

This virtual server does not require the computer it is running on to have any kind of graphics adapter, a screen or any input device. Only a network layer is necessary.

Read more about Xvfb on Wikipedia

How to Install Xfvb on CentOS 7 / 8 or RHEL 7 / 8

# yum install xorg-x11-server-Xvfb

Create systemd xvfb service on CentOS 7 / 8 or RHEL 7 / 8

# vi /etc/systemd/system/xvfb.service

Paste code below

[Unit]
Description=Xvfb headless plotting
After=network.target

[Service]
User=root
ExecStart=/usr/bin/Xvfb :0 -screen 0 1280x1024x24

[Install]
WantedBy=multi-user.target
Alias=Xvfb.service
Alias=xvfbd.service

Make excecutabe /etc/systemd/system/xvfb.service and reload systemd daemon with command

# chmod +x /etc/systemd/system/xvfb.service
# systemctl daemon-reload

Enable and start xvfb.service

# systemctl enable xvfb.service
# systemctl start xvfb.service

To check status of xvfb

# systemctl status xvfb.service

Recent Posts

How to fix yum update error thread.error: can’t start new thread

If you found error thread.error: can't start new thread on yum update command on CentOS…

5 months ago

How to securing Cockpit login with Google Two Factor Authenticator 2FA

Cockpit is a web-based graphical interface for servers, intended for everyone, especially those who are:…

8 months ago

How to install Cockpit on CentOS 7 / CentOS 9 Stream and configure Nginx reserve proxy

From cockpit-project.org, Cockpit is a web-based graphical interface for servers, intended for everyone, especially those…

10 months ago

How to install and configure Nginx with HTTP3 on CentOS 9 Stream / RHEL 9

We have been using Nginx with HTTP3 for more than 1 year on our production…

11 months ago

How to sync date time using Crony on CentOS 9 Stream / RHEL 9

On CentOS 7, to sync date time we often use NTPD. But on CentOS 9,…

11 months ago

How to install and enable REMI repository on CentOS 9 Stream

Remi repository is one of third-party repository that have latest update of PHP on Enterprise…

11 months ago