-
Notifications
You must be signed in to change notification settings - Fork 213
Xvfb on Debian 7
David Corking edited this page Jun 20, 2014
·
3 revisions
On Debian 7, you can launch X virtual frame buffer with an init script to launch cucumber tests with javascript :
- Create a init script
vi /etc/init.d/Xvfb
#!/bin/sh
### BEGIN INIT INFO
# Provides: Xvfb
# Required-Start: $local_fs $remote_fs
# Required-Stop:
# X-Start-Before:
# Default-Start: 2 3 4 5
# Default-Stop:
### END INIT INFO
N=/etc/init.d/Xvfb
set -e
case "$1" in
start)
Xvfb :99 -screen 0 640x480x8 -nolisten tcp -fbdir /var/run -auth . >> /dev/null &
;;
stop|reload|restart|force-reload)
;;
*)
echo "Usage: $N {start|stop|restart|force-reload}" >&2exit 1
;;
esac
exit 0
##### end of script ######
- Put the correct permissions
chmod 755 /etc/init.d/Xvfb
- If you want to start Xvfb automatically after boot
update-rc.d Xvfb defaults
- Start Xvfb
/etc/init.d/Xvfb start
- Define DISPLAY parameter for your session
echo 'export DISPLAY=:99' >> ~/.bashrc
- define manually the DISPLAY parameter
export DISPLAY=:99
After that, you can run 'bundle exec rake cucumber' with X virtual frame buffer