HowTo: Create a boot-from-CD browser kiosk with Firefox and Linux

InfoDabble > Tech Notes > Linux > HowTo: Create a boot-from-CD browser kiosk with Firefox and Linux
Jump to: navigation, search

By Eric Hartwell - October 10, 2007

I needed to turn an old PC into a cheap, dedicated, browser appliance. The cleanest choice is a Linux/Firefox boot-from-CD; the hardware demands are minimal, and it is impossible for users to make any permanent changes.

After a little research, I decided to go with SLAX. SLAX is a small and beautiful Linux operating system which fits on and runs directly from a CD-ROM disc (or USB key, or hard disk). It's ideal for my purposes, because it's small, popular (i.e. current), easily customized, and auto-detects hardware and DHCP.

  • SLAX Popcorn Edition (PE) v 5.1.8 is a preconfigured pocket operating system which fits even 128MB USB Flash Drives. It contains only XFce desktop, Mozilla Firefox, beep-XMMS, Gaim, AbiWord.

With the addition of Firefox 2, a Firefox kiosk mode extension module, and a little fiddling with xinitrc, I was able to create a small, clean kiosk boot CD that works on practically any PC without modifying the hard disk.


Quick Start

In many cases the default kiosk configuration works fine, and all you have to do is change the start URL. Here's a procedure for Windows:

  1. Download the sample kiosk: Myslax-popcorn-5.1.8.iso (iso, 130MB), burn to CD, and test on your hardware. Or run the ISO image with Virtual PC or VMWare player with LiveCD.
  2. Copy the /rootcopy directory tree from the CD to your hard disk
  3. Edit the text file rootcopy\etc\X11\xinit\xinitrc. Change the URL in the last line from to whatever you need.
    You may need to [#Network customize the network settings] too.
    [Note: xinitrc uses unix newline codes; you may need a conversion utility].
  4. Download, install, and run MySLAX creator:
    • Select source: use the sample kiosk CD or ISO file
    • Modify boot options: Set MyRootcopy folder to the rootcopy folder on your hard disk.
    • Create ISO, then burn to CD
  5. Done!

Custom Setup

SLAX is easy to customize. Use the full toolkit if you have special requirements, or if you're running on a network without a DHCP server. This version uses Firefox 2 with Flash Player 9; the [KioskModeSLAXBootCD.htm original version] uses Firefox 1.5 without Flash.


  1. An old PC that can boot from CD
  2. SLAX v 5.1.8.
  3. SLAX No CD Ejection module, disables forced cd ejection when shutting down the system
  4. SLAX Mozilla Firefox module: Mozilla-Firefox +FlashPlayer 9 12.00 MB
  5. R-kiosk 0.5.2: Firefox 2 extension that defaults to full screen, disables all menus, toolbars, key commands and right button menus.
  6. A custom xinitrc script ( details below)


  • MySLAX creator [Windows XP/2000/NT] - optional, but very handy
  • A virtual computer (Or run the ISO image with Virtual PC or VMWare player with LiveCD) is useful for development and testing. You can boot directly from the ISO image instead of burning a new CD every time.


SLAX Popcorn Edition v 5.0.6
SLAX PE is a pocket operating system which fits even 128MB USB Flash Drives. It contains only XFce desktop, Mozilla Firefox, beep-XMMS, Gaim, AbiWord.
Image: SLAX PE desktop

MySLAX Creator Add modules page.

MySLAX Creator Modify boot options page.

Kiosk screen: No browser menus, toolbars, or desktop, just HTML.

  1. You can configure SLAX from scratch, but I started with SLAX Popcorn Edition. This is a 115M image which includes XFce desktop, X Window System and Firefox.
  2. By default, SLAX ejects the boot CD when it shuts down. For a kiosk, this is not a good thing. Download the No CD Ejection module and keep it handy for the next step
  3. SLAX is easy to modify by adding modules, but if you need to change only few files, it provides a straight file copy option. The SLAX CD contains a directory /rootcopy/ whose contents are copied to the root filesystem each time you boot SLAX, preserving all directories.

    I decided to use a custom xinitrc script ( details below) to install the Firefox kiosk extension, then start up directly into Firefox without enabling the interactive desktop.
    • Create a rootcopy directory
    • Copy r-kiosk-0.5.2-firefox.xpi to rootcopy/etc
    • Copy the custom xinitrc to rootcopy/etc/X11/xinit/xinitrc
      (see rootcopy Notes below)
  4. MySLAX creator allows you to create your own customised Slax live CD/ISO in Windows XP/2000/NT. Run MySLAX Creator to create a custom installation.
    • Start with Slax-popcorn.iso
    • Add the No_CD_Ejection module
    • Add the Mozilla-Firefox +FlashPlayer 9module
    • Select the gui start boot option so SLAX starts up in GUI mode, without a login prompt
    • Select any other SLAX boot options that are appropriate.
      Caution: SLAX usually needs "hotplug" enabled to detect the network
    • Point the "MyRootcopy folder" to the rootcopy directory from step 3
  5. Create your custom ISO and/or CD image (as a bonus, MySLAX has integrated CD burning support). Here's my sample kiosk: Myslax-popcorn-5.1.8.iso (iso, 130MB)
  6. That's it!

Using rootcopy to configure the X Window System

SLAX is easy to modify by adding modules, but if you need to change only few files, you can use straight file copy. The SLAX CD contains a directory /rootcopy/ whose contents are copied to the root filesystem each time you boot SLAX, preserving all directories. So, to use a custom xinitrc script, create a /rootcopy/etc/X11/xinit/ directory on the CD and store your xinitrc in it.

When the startx command initiates an X session, it reads a file called .xinitrc in your home directory to decide which window manager to use or other X clients to start. It also reads the sample or template file called xinitrc installed in the /etc/X11/xinit directory. With SLAX, the simplest approach it to put a custom xinitrc in the /rootcopy/etc/X11/xinit/ directory.

If your network doesn't use DHCP, you may need to customize the network settings first ([#Network see below]).

In my case, I want to run Firefox instead of the desktop manager:

  • Start up SLAX and get a copy of /etc/X11/xinit/xinitrc
  • Delete or comment out the code that starts the xfce4-session desktop manager
  • Delete or comment out the code that starts the xftaskbar4, xfdesktop, xfcalendar, and xfce4-panel
  • I left in the code to check the Autostart directories and to start xfce-mcs-manager and the xfwm4 daemon
  • Finally, at the end of the startup script run Firefox instead of the desktop:
  • If the user exits Firefox, the xinitrc script will end, and the system will shut down. If you don't want this to happen, you can put the kiosk application inside a loop:
    while true; do
    sleep 1

rootcopy Notes

  • Here is a zipped copy of my rootcopy directory tree: [images/]
  • Note: the x11 directory has to be 'X11', not 'x11'. I normally build on NTFS, but I've run into problems building the image on a FAT file system where it created an 'x11' directory even though I asked for 'X11'. SLAX happily loads the xinitrc into /etc/x11/xinit where it's never recognized.
  • Caution: The xinit shell script will not work if it has DOS/Windows CR/LF line terminators. Use an editor that supports Unix-style line endings, or a conversion utility to strip them before building the SLAX CD.

Changes to xinitrc

Changes to xinitrc
Original xinitrc (slax-popcorn-5.1.8) Modified xinitrc
# fix broken $UID on some system...
if test "x$UID" = "x"; then
UID=`id -u`
# create temp file for X resources
if [ -x /usr/bin/tempfile ]; then
  XRESOURCES="$(/usr/bin/tempfile -p xrdb-)"
elif [ -x /usr/bin/mcookie ]; then
# Has to go prior to merging Xft.xrdb, as its the "Defaults" file
test -r $HOME/.Xdefaults && cat $HOME/.Xdefaults >> $XRESOURCES
# Check if the user wants to override the above defaults (set by
# mcs ui plugin)
if test "x$XDG_CONFIG_HOME" = "x" ; then
if test -r $BASEDIR/Xft.xrdb; then
  cat $BASEDIR/Xft.xrdb >> $XRESOURCES
elif test -r $XFCE4HOME/Xft.xrdb; then
  mkdir -p $BASEDIR
  cp $XFCE4HOME/Xft.xrdb $BASEDIR/
  cat $BASEDIR/Xft.xrdb >> $XRESOURCES
  # Those are fallback settings, use the ui plugin to change it
  # or add your overrides to ~/.Xresources
  # Xft DPI: 96
  # Xft.hintstyle: hintnone/hintslight/hintmedium/hintfull
  # Xft hinting: 1/0
  cat >> $XRESOURCES << EOF
Xft.dpi: 96
Xft.hinting: 1
Xft.hintstyle: hintmedium
# ~/.Xresources contains overrides to the above
test -r $HOME/.Xresources && cat $HOME/.Xresources >> $XRESOURCES
# load all X resources
xrdb -nocpp -merge $XRESOURCES
# load local modmap
test -r $HOME/.Xmodmap && xmodmap $HOME/.Xmodmap
# Launch xscreensaver (if available), but only as non-root user
test $UID -gt 0 -a -z "$VNCSESSION" && xscreensaver -no-splash &
# Launch xscreensaver (if available), but only as non-root user
# Comment out the next line if you want to disable the screen saver
### test $UID -gt 0 -a -z "$VNCSESSION" && xscreensaver -no-splash &
# Use ssh-agent if installed and not already running.  Run it separately
# so it populates the environment here, so we can clean it up later.
sshagent=`which ssh-agent`
if test -z "$SSH_AGENT_PID" -a "$sshagent" -a "x$sshagent" != "xno"; then
eval `$sshagent -s`
# Use dbus-launch if installed.
if test x"$DBUS_SESSION_BUS_ADDRESS" = x""; then
dbuslaunch=`which dbus-launch`
if test x"$dbuslaunch" != x"" -a x"$dbuslaunch" != x"no"; then
eval `$dbuslaunch --sh-syntax --exit-with-session`
# Run xfce4-session if installed
xfcesm=`which xfce4-session`
case "x$xfcesm" in
if test $kill_sshagent -eq 1; then
eval `$sshagent -k`
exit 0
################## KIOSK: Skip xfce4-session startup
################## KIOSK: Skip xfce4-session startup
# Everything below here ONLY gets executed if you are NOT using xfce4-session
# (Xfce's session manager).  If you are using the session manager, everything
# below is handled by it, and the code below is not executed at all.  If you're
# not sure if you're using the session manager, type 'ps -e|grep xfce4-session'
# in a terminal while Xfce is running.
# this is only necessary when running w/o xfce4-session
xsetroot -solid black -cursor_name watch
# or use old-fashioned startup script otherwise
xfwm4 --daemon
# Start-up stuff from ~/Desktop/Autostart directory, if it exists
# (as it seems to be the new standard)
if test -d "$HOME/Desktop/Autostart"; then
  for i in `ls -1 -L ${HOME}/Desktop/Autostart/ 2>/dev/null`; do
    if test -x $HOME/Desktop/Autostart/$i; then
      $HOME/Desktop/Autostart/$i &
xfcalendar &
panel=`which xfce4-panel`
case "x$panel" in
while test $ret -ne 0; do
xmessage -center -file - -timeout 20 -title Error <<EOF
A crash occured in the panel
Please report this to the list
or on
Meanwhile the panel will be restarted
cat >&2 <<EOF
A crash occured in the panel
Please report this to the list
or on
Meanwhile the panel will be restarted
################## KIOSK: Skip desktop startup
################## KIOSK: Skip desktop startup
if test $kill_sshagent -eq 1; then
eval `$sshagent -k`
xsetroot -bg white -fg red  -solid black -cursor_name watch
############### KIOSK #################
# Disable DPMS screen blanker and powerdown
 xset s off 
 xset -dpms 
# Install the kiosk-mode FireFox extension
/usr/bin/firefox -install-global-extension /etc/r-kiosk-0.5.2-firefox.xpi
# Start the browser instead of the desktop 
while true; do
sleep 1


The custom xinitrc disables the xscreensaver during X startup, but this does not prevent the screen from blanking after a while. Using setterm -blank 0 has no effect either, because the default SLAX configuration uses APM or ACPI power management:

(/etc/rc.d/rc.M) /bin/setterm -blank 15 -powersave powerdown -powerdown 60 # Blank screen if idle 15 minutes, Power down in one hour

The following commands disable DPMS (thanks, SLAX forum!)

xset s off 
xset -dpms
  • s The s option lets you set the screen saver parameters. This option accepts up to two numerical parameters, a 'blank/noblank' flag, an 'expose/noexpose' flag, an 'on/off' flag, an 'activate/reset' flag, or the 'default' flag. If no parameters or the 'default' flag is used, the system will be set to its default screen saver characteristics. The 'on/off' flags simply turn the screen saver functions on or off. The length and period parameters for the screen saver function determines how long the server must be inactive for screen saving to activate, and the period to change the background pattern to avoid burn in. The arguments are specified in seconds. If only one numerical parameter is given, it will be used for the length.
  • -dpms The -dpms option disables DPMS (Energy Star) features.

Network Configuration Example

SLAX is extremely smart about network configuration: "SLAX uses DHCP to autoconfigure your network card's IP address, route tables and nameservers. If you are on the network with DHCP server then you shouldn't have any problem. Just boot SLAX and everything will work."

In my case, some of the workstations used DHCP and some had fixed IP. This is easy to script in xinitrc:

if ping -c 1 -w 2 | grep "ttl=" >nul
   echo Network detected.
   ifconfig eth0 netmask
   route add default gateway
   echo "nameserver" >> /etc/resolv.conf
   echo "nameserver" >> /etc/resolv.conf

The first line uses PING to see if the workstation is able to reach the server. A successful PING doesn't always return errorlevel 0, so instead the output is piped through GREP to look for the "ttl" line in a successful response. GREP does return errorlevel 0 if the text is found.

The remaining lines are fairly straightforward. The workstation is assigned the fixed IP, using the gateway and the nameservers and An excellent online reference is "Guide to IP Layer Network Administration with Linux" by Martin A. Brown.

How to save/restore settings

To save your settings, run "configsave" command with one argument - the storage location. So type for example configsave /mnt/sda1/ to save your configs in USB flash drive into file. It will save all changed files from /root, /etc, /home and /var directories. Note that that network settings (assigned IP address, etc) won't be saved because they are not kept in any file. If you wish to save network settings then add appropriate commands to /etc/rc.d/rc.local. This file will be saved/restored, and it's executed automatically (so your network settings will be set up).

To restore your previously saved backup, use "configrestore" command. You can also save settings to the root directory of your existing disk partition (for example to /mnt/hda1/ All settings found in the root folder of any of your disk partitions ( under the name will be restored automatically when SLAX boots.

Revision History

  • October 10, 2007 - disable screen blanker - thanks for the feedback!
  • May 11, 2007 - various clarifications - thanks for the feedback!
  • May 6, 2007 - updated for current versions
  • February 26, 2006 - added fixed IP setup ([KioskModeSLAXBootCDv1.htm v1])
  • February 21, 2006 - added quick start
  • February 19, 2006 - initial version