Howto: create a boot from USB/CD kiosk pc

Ernie BeekCyber Analyst
CERTIFIED EXPERT
Published:
Some time ago I was asked to set up a web portal PC to put at our entrance. When customers arrive, they could see a webpage 'promoting' our company. So I tried to set up a windows 7 PC as a kiosk PC..........

I will spare you all the annoyances I encountered when trying to achieve that. Finally, I had a kiosk running (sort of) and was thinking that there might be an easier way. A way where I could take any random machine, plug a USB in it (or slide a CD in) and it would work.

After some searching I came across webconverger. That looked nice and is working perfectly for me now. The only thing was that explanations were not straightforward and at some times incomplete, resulting in having to ask my friend Google to help me out a lot. Once it is clear how to set it up it's easy, but before you get there (especially when you're not a Linux guru, which I'm not).

That's why I'm putting those steps here so you can set it up fairly simple and fast without having to figure everything out as you go.

So here we go.

1. Install up a Linux machine for building the boot image


We'll need this machine so we can build the boot image(s). This is fairly simple, we can just use all the default setting. I chose a Debian distribution for this because the webconverger is Debian based. I won't go in to much detail here because this is straightforward.

I downloaded a minimal CD installation http://cdimage.debian.org/debian-cd/6.0.3/i386/iso-cd/debian-6.0.3-i386-netinst.iso and installed it in a VM on ESX. For this I used the following settings:

all default installation
set locales
create user
partition disks: guided, use entire disk, all files in one location
software selection: graphical desktop environment, standard system utilities
install GRUB boot loader to the master boot record: yes

And within 20 minutes I had my building machine.

2. Setting up the building machine


Note: all of the following was done using the root terminal in Debain so there is no need to 'sudo' every time.

First we have to add some entries to the package resource list:
gedit /etc/apt/sources.list
and add the following lines:

deb http://live.debian.net/ sid-snapshots main contrib non-free
deb http://live.debian.net/ sid-snapshots main contrib non-free


Save the file and exit gedit.

Run an update
apt-get update
But now we will get an error like:
W: GPG error: http://live.debian.net sid-snapshots Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6F95B4996CA7B5A6

Open in new window


This is because we added repositories, but didn’t have the key yet. Now we do: the error gives us the public key we need: 6F95B4996CA7B5A6.

Let's add this key to our system:
gpg --keyserver subkeys.pgp.net --recv 6F95B4996CA7B5A6
                      gpg --export --armor 6F95B4996CA7B5A6 | apt-key add

Open in new window


You should get an output like:

/home/helpdesk$ gpg --keyserver subkeys.pgp.net --recv 6F95B4996CA7B5A6
                      gpg: requesting key 6CA7B5A6 from hkp server subkeys.pgp.net
                      gpg: /root/.gnupg/trustdb.gpg: trustdb created
                      gpg: key 6CA7B5A6: public key "Debian Live Signing Key <debian-live@lists.debian.org>" imported
                      gpg: no ultimately trusted keys found
                      gpg: Total number processed: 1
                      gpg:               imported: 1  (RSA: 1)
                      /home/helpdesk$ gpg --export --armor 6F95B4996CA7B5A6 | apt-key add -
                      OK

Open in new window


Now update again apt-get update and you can see the machine connecting to the live sites now:

/home/helpdesk$ apt-get update
                      Hit http://ftp.nl.debian.org squeeze Release.gpg
                      Ign http://ftp.nl.debian.org/debian/ squeeze/main Translation-en                            
                      Ign http://ftp.nl.debian.org/debian/ squeeze/main Translation-en_US                         
                      Hit http://ftp.nl.debian.org squeeze-updates Release.gpg                                     
                      Ign http://ftp.nl.debian.org/debian/ squeeze-updates/main Translation-en                     
                      Ign http://ftp.nl.debian.org/debian/ squeeze-updates/main Translation-en_US                  
                      Hit http://ftp.nl.debian.org squeeze Release                                                 
                      Hit http://ftp.nl.debian.org squeeze-updates Release                                                                
                      Hit http://ftp.nl.debian.org squeeze/main Sources                                                                   
                      Hit http://ftp.nl.debian.org squeeze/main i386 Packages                                      
                      Hit http://ftp.nl.debian.org squeeze-updates/main Sources/DiffIndex    
                      Hit http://ftp.nl.debian.org squeeze-updates/main i386 Packages/DiffIndex
                      Hit http://ftp.nl.debian.org squeeze-updates/main i386 Packages        
                      Hit http://security.debian.org squeeze/updates Release.gpg             
                      Ign http://security.debian.org/ squeeze/updates/main Translation-en    
                      Ign http://security.debian.org/ squeeze/updates/main Translation-en_US
                      Hit http://security.debian.org squeeze/updates Release   
                      Hit http://security.debian.org squeeze/updates/main Sources
                      Hit http://security.debian.org squeeze/updates/main i386 Packages
                      [b]Get:1 http://live.debian.net sid-snapshots Release.gpg [835 B]
                      Ign http://live.debian.net/ sid-snapshots/contrib Translation-en
                      Ign http://live.debian.net/ sid-snapshots/contrib Translation-en_US
                      Ign http://live.debian.net/ sid-snapshots/main Translation-en
                      Ign http://live.debian.net/ sid-snapshots/main Translation-en_US
                      Ign http://live.debian.net/ sid-snapshots/non-free Translation-en
                      Ign http://live.debian.net/ sid-snapshots/non-free Translation-en_US
                      Get:2 http://live.debian.net sid-snapshots Release [68.3 kB]
                      Hit http://live.debian.net sid-snapshots/main Sources
                      Hit http://live.debian.net sid-snapshots/contrib Sources
                      Hit http://live.debian.net sid-snapshots/non-free Sources
                      Hit http://live.debian.net sid-snapshots/main i386 Packages
                      Hit http://live.debian.net sid-snapshots/contrib i386 Packages
                      Hit http://live.debian.net sid-snapshots/non-free i386 Packages[/b]
                      Fetched 836 B in 5s (161 B/s)
                      Reading package lists... Done

Open in new window


Install additional packets
Now we need to install some additional packets we will need to be able to build and get the webconverger:

apt-get install live-helper
                      Apt-get install git

Open in new window


This should look similar to:

/home/helpdesk$ apt-get install live-helper
                      Reading package lists... Done
                      Building dependency tree       
                      Reading state information... Done
                      The following extra packages will be installed:
                        debootstrap gnu-fdisk live-boot-doc live-build live-config-doc live-manual-html
                      Suggested packages:
                        memtest86+ memtest86 parted squashfs-tools mtd-tools syslinux grub uuid-runtime win32-loader
                      The following NEW packages will be installed:
                        debootstrap gnu-fdisk live-boot-doc live-build live-config-doc live-helper live-manual-html
                      0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
                      Need to get 2,363 kB of archives.
                      After this operation, 8,998 kB of additional disk space will be used.
                      Do you want to continue [Y/n]? Y
                      Get:1 http://live.debian.net/ sid-snapshots/main live-boot-doc all 3.0~a21+20111008.113554 [64.6 kB]
                      Get:2 http://live.debian.net/ sid-snapshots/main live-build all 3.0~a37+20111013.180312 [1,136 kB]
                      Get:3 http://live.debian.net/ sid-snapshots/main live-config-doc all 3.0~a28+20111012.185239 [41.9 kB]
                      Get:4 http://ftp.nl.debian.org/debian/ squeeze/main debootstrap all 1.0.26+squeeze1 [57.5 kB]                               
                      Get:5 http://ftp.nl.debian.org/debian/ squeeze/main live-helper all 2.0.12-2 [49.6 kB]                                      
                      Get:6 http://ftp.nl.debian.org/debian/ squeeze/main live-manual-html all 1:2.0.2-1 [903 kB]                                 
                      Get:7 http://ftp.nl.debian.org/debian/ squeeze/main gnu-fdisk i386 1.2.4-3 [111 kB]                                         
                      Fetched 2,363 kB in 8s (281 kB/s)                                                                                           
                      Selecting previously deselected package live-boot-doc.
                      (Reading database ... 128084 files and directories currently installed.)
                      Unpacking live-boot-doc (from .../live-boot-doc_3.0~a21+20111008.113554_all.deb) ...
                      Selecting previously deselected package debootstrap.
                      Unpacking debootstrap (from .../debootstrap_1.0.26+squeeze1_all.deb) ...
                      Selecting previously deselected package live-build.
                      Unpacking live-build (from .../live-build_3.0~a37+20111013.180312_all.deb) ...
                      Selecting previously deselected package live-config-doc.
                      Unpacking live-config-doc (from .../live-config-doc_3.0~a28+20111012.185239_all.deb) ...
                      Selecting previously deselected package live-helper.
                      Unpacking live-helper (from .../live-helper_2.0.12-2_all.deb) ...
                      Selecting previously deselected package live-manual-html.
                      Unpacking live-manual-html (from .../live-manual-html_1%3a2.0.2-1_all.deb) ...
                      Selecting previously deselected package gnu-fdisk.
                      Unpacking gnu-fdisk (from .../gnu-fdisk_1.2.4-3_i386.deb) ...
                      Adding 'diversion of /usr/share/man/man8/cfdisk.8.gz to /usr/share/man/man8/cfdisk.distrib.8.gz by gnu-fdisk'
                      Adding 'diversion of /usr/share/man/man8/fdisk.8.gz to /usr/share/man/man8/fdisk.distrib.8.gz by gnu-fdisk'
                      Adding 'diversion of /sbin/fdisk to /sbin/fdisk.distrib by gnu-fdisk'
                      Adding 'diversion of /sbin/cfdisk to /sbin/cfdisk.distrib by gnu-fdisk'
                      Processing triggers for man-db ...
                      Processing triggers for install-info ...
                      Setting up live-boot-doc (3.0~a21+20111008.113554) ...
                      Setting up debootstrap (1.0.26+squeeze1) ...
                      Setting up live-build (3.0~a37+20111013.180312) ...
                      Setting up live-config-doc (3.0~a28+20111012.185239) ...
                      Setting up live-helper (2.0.12-2) ...
                      Setting up live-manual-html (1:2.0.2-1) ...
                      Setting up gnu-fdisk (1.2.4-3) ...
                      
                      /home/helpdesk$ apt-get install git
                      Reading package lists... Done
                      Building dependency tree       
                      Reading state information... Done
                      The following extra packages will be installed:
                        liberror-perl rsync
                      Suggested packages:
                        git-doc git-arch git-cvs git-svn git-email git-daemon-run git-gui gitk gitweb openssh-server
                      The following NEW packages will be installed:
                        git liberror-perl rsync
                      0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
                      Need to get 5,222 kB of archives.
                      After this operation, 11.0 MB of additional disk space will be used.
                      Do you want to continue [Y/n]? Y
                      Get:1 http://ftp.nl.debian.org/debian/ squeeze/main liberror-perl all 0.17-1 [23.6 kB]
                      Get:2 http://ftp.nl.debian.org/debian/ squeeze/main git i386 1:1.7.2.5-3 [4,860 kB]
                      Get:3 http://ftp.nl.debian.org/debian/ squeeze/main rsync i386 3.0.7-2 [338 kB]                                             
                      Fetched 5,222 kB in 6s (821 kB/s)                                                                                           
                      Selecting previously deselected package liberror-perl.
                      (Reading database ... 128883 files and directories currently installed.)
                      Unpacking liberror-perl (from .../liberror-perl_0.17-1_all.deb) ...
                      Selecting previously deselected package git.
                      Unpacking git (from .../git_1%3a1.7.2.5-3_i386.deb) ...
                      Selecting previously deselected package rsync.
                      Unpacking rsync (from .../rsync_3.0.7-2_i386.deb) ...
                      Processing triggers for man-db ...
                      Setting up liberror-perl (0.17-1) ...
                      Setting up git (1:1.7.2.5-3) ...
                      Setting up rsync (3.0.7-2) ...
                      update-rc.d: using dependency based boot sequencing

Open in new window


3. Downloading and configuring webconverger


I'd like to put the download in /tmp, so let's change to that directory with this command:
cd /tmp/

Now, let's get it:
git clone git://git.debian.org/git/debian-live/config-webc.git

The expected output should be:

tmp$ git clone git://git.debian.org/git/debian-live/config-webc.git
                      Cloning into config-webc...
                      remote: Counting objects: 2335, done.
                      remote: Compressing objects: 100% (1198/1198), done.
                      remote: Total 2335 (delta 963), reused 1931 (delta 836)
                      Receiving objects: 100% (2335/2335), 63.36 MiB | 3.54 MiB/s, done.
                      Resolving deltas: 100% (963/963), done.
                      /tmp$

Open in new window


Now we have everything we need in the directory config-webc:

/tmp$ cd config-webc/
/tmp/config-webc$ ls
LICENSE  webconverger


Go to the webconverger directory and have a look at the config file:
/tmp/config-webc$ cd webconverger
/tmp/config-webc/webconverger$ cat auto/config


#!/bin/sh
                      
                      #MIRROR_DEBIAN="ftp://mirror.hetzner.de/ftp.de.debian.org/debian/"
                      #MIRROR_DEBIAN="http://ftp.de.debian.org/debian"
                      
                      lb config noauto --clean \
                      	--bootappend-live "homepage=http://webconverger.com hostname=webconverger nonetworking nopersistent quickreboot nomodeset splash username=webc vga=current quiet noroot" \
                      	-k 486 \
                      	-a i386 \
                      	-b iso-hybrid \
                      	--username webc \
                      	--hostname webconverger \
                      	--parent-archive-areas "main contrib non-free" \
                      	--mode progress --distribution artax \
                      	--debian-installer false \
                      	--syslinux-theme webc \
                      	--apt-indices false \
                      	--iso-publisher "http://webconverger.com" \
                      	--iso-volume "Webconverger" \
                      	--iso-application "Webconverger" \
                      	--archive-areas "main contrib non-free" \
                      	--apt-recommends false \
                      	--memtest none \
                      	--source false \
                      	--archives live \
                      	${@}

Open in new window



Have a close look at:
--bootappend-live "homepage=http://webconverger.com hostname=webconverger nonetworking nopersistent quickreboot nomodeset splash username=webc vga=current quiet noroot" \

Here you can define some options for the kiosk browser. For now I want to change the homepage and make the browser full screen, we need to change two items for that:
--bootappend-live "homepage=http://www.myhomepage.com hostname=webconverger nonetworking nopersistent quickreboot nomodeset splash username=webc vga=current quiet noroot webcchrome=fullscreen" \

There are a number of other options you can put here:
-Multiple home pages (separated by %20)
homepage=http://portal.webconverger.com/%20http://webconverger.com
-Browser properties:
webcchrome=nosearch - disable search bar
webcchrome=noaddress - disable URL bar and search bar (webcnoaddressbar)
webcchrome=fullscreen - fullscreen!


I am keeping it basic here, but there’s more to be found at http://webconverger.org

Because my homepage uses Java, I want to add that. We need to create a new file in the preseed directory:
/tmp/config-webc/webconverger$ echo sun-java6-jre   shared/accepted-sun-dlj-v1-1    boolean true > config/preseed/sun-java6-jre.preseed

/tmp/config-webc/webconverger$ ls config/preseed/
firmware-nonfree.preseed  sun-java6-jre.preseed

/tmp/config-webc/webconverger$ cat config/preseed/sun-java6-jre.preseed
sun-java6-jre shared/accepted-sun-dlj-v1-1 boolean true


And add two lines to the config/package-lists/webc.list.chroot file:
/tmp/config-webc/webconverger$echo sun-java6-jre >> config/package-lists/webc.list.chroot

/tmp/config-webc/webconverger$echo sun-java6-plugin >> config/package-lists/webc.list.chroot


4. Building the ISO


Now we can get ready to build:
/tmp/config-webc/webconverger$ lh config
output:
P: Executing auto/config script.
                      P: Considering defaults defined in /etc/live/build.conf
                      P: Updating config tree

Open in new window


Before we can build we first need another package installed. I found that out after it was building for ten minutes already :(
/tmp/config-webc/webconverger$ apt-get install syslinux
output:
Reading package lists... Done
                      Building dependency tree       
                      Reading state information... Done
                      The following extra packages will be installed:
                        libcrypt-passwdmd5-perl libdigest-sha1-perl syslinux-common
                      The following NEW packages will be installed:
                        libcrypt-passwdmd5-perl libdigest-sha1-perl syslinux syslinux-common
                      0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
                      Need to get 1,399 kB of archives.
                      After this operation, 3,867 kB of additional disk space will be used.
                      Do you want to continue [Y/n]? Y
                      Get:1 http://ftp.nl.debian.org/debian/ squeeze/main libcrypt-passwdmd5-perl all 1.3-9 [10.3 kB]
                      Get:2 http://ftp.nl.debian.org/debian/ squeeze/main libdigest-sha1-perl i386 2.13-1 [26.1 kB]
                      Get:3 http://ftp.nl.debian.org/debian/ squeeze/main syslinux-common all 2:4.02+dfsg-7 [1,271 kB]
                      Get:4 http://ftp.nl.debian.org/debian/ squeeze/main syslinux i386 2:4.02+dfsg-7 [91.8 kB]
                      Fetched 1,399 kB in 0s (2,362 kB/s)
                      Selecting previously deselected package libcrypt-passwdmd5-perl.
                      (Reading database ... 129456 files and directories currently installed.)
                      Unpacking libcrypt-passwdmd5-perl (from .../libcrypt-passwdmd5-perl_1.3-9_all.deb) ...
                      Selecting previously deselected package libdigest-sha1-perl.
                      Unpacking libdigest-sha1-perl (from .../libdigest-sha1-perl_2.13-1_i386.deb) ...
                      Selecting previously deselected package syslinux-common.
                      Unpacking syslinux-common (from .../syslinux-common_2%3a4.02+dfsg-7_all.deb) ...
                      Selecting previously deselected package syslinux.
                      Unpacking syslinux (from .../syslinux_2%3a4.02+dfsg-7_i386.deb) ...
                      Processing triggers for man-db ...
                      Setting up libcrypt-passwdmd5-perl (1.3-9) ...
                      Setting up libdigest-sha1-perl (2.13-1) ...
                      Setting up syslinux-common (2:4.02+dfsg-7) ...
                      Setting up syslinux (2:4.02+dfsg-7) ...

Open in new window


And now we build:
/tmp/config-webc/webconverger$ lh build

This might take a while, especially the first time when additional packages are checked for (dependencies) and downloaded. After some time we then have the ISO for our kiosk PC:
/tmp/config-webc/webconverger$ ls
auto      binary-hybrid.iso  binary.log          cache   chroot.packages.install  config
binary      binary.list         binary.packages  chroot  chroot.packages.live


5. Using the ISO


So now we can put this on a USB/CD so we can use it to boot a machine with it. I’m using windows for this task because the Linux build machine I use is a VM, and it is easier to just do it via my Windows machine rather than setup hardware device pass-through in the VM.

For this you’ll need something like win32 disk imager:  
Download and install it. After that, run it, select the ISO as the source and the drive letter of a plugged in USB as the destination and click write.

win32diskimager
Under Linux you can us fdisk -l to find your USB device (let’s say /dev/sdx) and copy the image with this command:
 
dd if=binary-hybrid.iso of=/dev/sdx

Or you can burn it to CD.

And there you have it! You can now plug this USB stick into any device (that is able to boot from USB) to turn it in to a kiosk PC.

webconverger

6. Changes without rebuilding


If, at some time, it might be necessary to make some simple changes like changing the homepage or removing the full screen option, you can do that without having to build the whole ISO again.
Mount the image, rsync it and make the configuration file writeable:
mkdir /mnt/webc
                      mount -o loop binary-hybrid.iso /mnt/webc/
                      rsync -av /mnt/webc/ /mnt/custom/
                      chmod +w /mnt/custom/isolinux/live.cfg

Open in new window


Now we can edit the live.cfg file:
gedit /mnt/custom/isolinux/live.cfg
This similar to the auto/config file we edited before.

When the file is changed and saved you just recreate the ISO:
sudo genisoimage -J -l -cache-inodes -allow-multidot -no-emul-boot -boot-load-size 4 -boot-info-table -r -b isolinux/isolinux.bin -c isolinux/boot.cat -o custom.iso /mnt/custom/

And finish it:
isohybrid custom.iso

After that put it on a USB or CD again, and presto!

One last note:
It might occur that when building again you encounter an error:
E: There are problems and -y was used without --force-yes
In that case issue: lh clean, lh config and build again.
0
7,930 Views
Ernie BeekCyber Analyst
CERTIFIED EXPERT

Comments (0)

Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.