Posted at

xvfb on ubuntuで自動起動させる

More than 1 year has passed since last update.

Ubuntu16.04とかだと/etc/init.d/につくるのはダサイのでsystemdでやるような感じで。


/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


をつくって

sudo systemctl enable /etc/systemd/system/xvfb.service

sudo service xvfb start

これでOK。

参考:

Configure xvfb for Vivid (15.04) as a service using systemd