Tuesday, November 26, 2024

Building a Firefox Kiosk

 In my home lab I have been experimenting with various types of virtual machines. Mostly this has been complete operating systems. However one of the things Broker servers can do for you is give access to single applications, without the need for complete operating systems. Broker software like VMWare Horizon is expensive, but honestly, something like Remmina, which is a multi protocol desktop connection client, serves the same purpose.

In this example, I am setting up Firefox as a app, when the VM is launched Firefox is all the user has access to. If you wanted to, you could install this setup on a PC and just use it as a kiosk, no virtualization is really needed.

The first step is installing Debian 12, you can use Ubuntu server as well. We want a minimal install, no extra software outside of ssh server, not even a desktop environment. The resource requirements are very low; 1 core, 2 GB of RAM and 8 GB of storage will be more than enough. Once you are done, log in as root and install the needed software

apt update && apt upgrade

apt install sudo firefox-esr xorg openbox lightdm tigervnc-standalone-server tigervnc-common

Once that is done you will need to add the kiosk user, which is the account which the system will automatically log into when anyone accesses the virtual machine.

useradd kiosk

Next, enter the kiosk user account;

su - kiosk

Now we are going to make 2 confiuration files, one for VNC so the account can be accessed remotely and one for Openbox, which is the window manager we will use.

mkdir .vnc

nano .vnc/config

Enter the following text into the file, then press ctrl-x, save the file and exit.

session=openbox
geometry=1200x720
localhost
alwaysshared

Then move on to Openbox;

mkdir -p .config/openbox

nano .config/openbox/autostart

Enter the following text into the file, then press ctrl-x, save the file and exit.

env DISPLAY=:1 firefox-esr -kiosk 'http://url' &

If you want to setup a different application, this is the place to do it. Firefox can be replaced with Chrome or LibreCalc, just make sure the appropriate software is installed. Go a head and exit the kiosk user account by typing exit and you will be back in the root account.

We now want to give over display :1 to the kiosk user so when when someone logs in via RDP, Firefox will display on the VNC connection instead of the local display.

nano /etc/tigervnc/vncserver.users

Enter the following text into the file, then press ctrl-x, save the file and exit.

 :1=kiosk

The next step is to make it so the system booting directly into the kiosk user account and starts the VNC server.

 nano /etc/lightdm/lightdm.conf

Go to the bottom of the files and add these lines, then press ctrl-x, save the file and exit;

[SeatDefaults]
autologin-user=kisok
user-session=openbox
[VNCServer]
enabled=true
command=/usr/bin/Xvnc -rfbauth /etc/vncpasswd
port=5901
width=1200
height=720
depth=32

Finally, we want to setup the VNC password, that will be required when the user initiates a VNC connection.

vncpasswd /etc/vncpasswd

Now, reboot the system. On the local display, you will get a blank screen, if you right click on the background, you should get a menu. When you access it with VNC, Firefox should automatically start up in kiosk mode.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Mastodon