Firefox Browser¶
To run firefox or any other GUI application there are some extra steps involved to setup a display.
The /tmp/.X11-unix/
directory should be mounted in the container. This
can be accomplished by making it available to vagga under the name X11
by writing the following lines in your global configuration ~/.vagga.yaml
:
external-volumes:
X11: /tmp/.X11-unix/
Next, you can use the following vagga.yaml
file to setup the actual
configuration (we redefine the variable HOME
because firefox needs to
write profile information).
containers:
browser:
setup:
- !Ubuntu trusty
- !UbuntuUniverse
- !Install [firefox]
volumes:
/tmp: !Tmpfs
size: 100Mi
mode: 0o1777
subdirs:
.X11-unix:
/tmp/.X11-unix: !BindRW /volumes/X11
commands:
firefox: !Command
container: browser
environ: { HOME: /tmp }
run: [firefox]
When calling vagga, remember to export the DISPLAY
environment variable:
vagga -eDISPLAY firefox
To prevent DBUS-related errors also export the DBUS_SESSION_BUS_ADDRESS
environmental variable:
vagga -eDISPLAY -eDBUS_SESSION_BUS_ADDRESS firefox
WebGL Support¶
To enable webgl support further steps are necessary to install the drivers inside the container, that depends on your video card model.
To setup the proprietary nvidia drivers, download the driver from the
NVIDIA website in the
your working directory and use the following vagga.yaml
:
containers:
browser:
setup:
- !Ubuntu trusty
- !UbuntuUniverse
- !Install [binutils, pkg-config, mesa-utils]
- !Sh sh /work/NVIDIA-Linux-x86_64-331.67.run -a -N --ui=none --no-kernel-module
- !Sh nvidia-xconfig -a --use-display-device=None --enable-all-gpus --virtual=1280x1024
- !Install [firefox]
volumes:
/tmp: !Tmpfs
size: 100Mi
mode: 0o1777
subdirs:
.X11-unix:
/tmp/.X11-unix: !BindRW /volumes/X11
commands:
firefox: !Command
container: browser
environ: { HOME: /tmp }
run: [firefox]
For intel video cards use the following vagga.yaml
(this includes also
chromium and java plugin):
containers:
browser:
setup:
- !Ubuntu trusty
- !UbuntuUniverse
- !Install [chromium-browser]
- !Install [firefox, icedtea-plugin]
- !Install [xserver-xorg-video-intel, mesa-utils, libgl1-mesa-dri]
- !EnsureDir /root
volumes:
/tmp: !Tmpfs
size: 100Mi
mode: 0o1777
subdirs:
.X11-unix:
/tmp/.X11-unix: !BindRW /volumes/X11
/root: !BindRW /work/home
commands:
firefox: !Command
container: browser
environ: { HOME: /tmp }
run: [firefox]