Firefox in Chroot Jail

Firefox in Chroot Jail

Overview

This document aims to show how to get Firefox working in a chroot jail. Specifically, an Arch Linux Chroot set up in Alpine Linux.

Procedure

On the host machine, link /tmp/.X11-unix to the chroot directory.

sudo mount -o bind /tmp/.X11-unix tmp/.X11-unix

Copy xauthority file to chroot. (Can be determined with the path $XAUTHORITY, which turns out to be the default path ~/.Xauthority on Alpine).

cp ~/.Xauthority home/paul/

Export the DISPLAY environment variable in the chroot. (You can check the $DISPLAY environment on the host machine, but it's usually going to be :0).

export DISPLAY=:0

Running firefox should work now!

Resources

https://unix.stackexchange.com/questions/44823/how-to-run-firefox-in-a-chroot-jail

https://unix.stackexchange.com/questions/10121/open-a-window-on-a-remote-x-display-why-cannot-open-display/10126#10126


home | index