{"id":301,"date":"2018-11-09T23:11:29","date_gmt":"2018-11-09T23:11:29","guid":{"rendered":"https:\/\/projects-42.nl\/?p=301"},"modified":"2018-11-09T23:23:21","modified_gmt":"2018-11-09T23:23:21","slug":"ubuntu-18-04-lts-kiosk-for-web-or-rdp","status":"publish","type":"post","link":"https:\/\/projects-42.nl\/index.php\/2018\/ubuntu-18-04-lts-kiosk-for-web-or-rdp\/","title":{"rendered":"Ubuntu 18.04 LTS kiosk for web or RDP"},"content":{"rendered":"<p>In this article we will show how to setup a browser or RDP kiosk, based on Ubuntu server 18.04 LTS. Because we are using the server edition the kiosk system will have a very small footprint and way less packets installed when we compare it to a stripped down desktop kiosk.<\/p>\n<p>First we need to install a fresh Ubuntu 18.04 LTS system. After the installation is complete, make sure to install any available updates by executing the following commands:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">sudo apt-get update\r\nsudo apt-get upgrade -y\r\nsudo reboot<\/pre>\n<p><strong>Kiosk purpose<\/strong><\/p>\n<p>Before we start configuring the kiosk, we first need to think what we want to show on the kiosk unit. Different content types require different applications and configurations. in this article we will show how to install and use a chrome based kiosk and a Remmina (RDP) based kiosk. Other applications\/types of content are also possible but might require additional research.<\/p>\n<p>The kiosk can only serve one type of content at the time.<\/p>\n<p>To go with the web content kiosk, install chrome using the following command:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">sudo apt-get install --no-install-recommends chromium-browser<\/pre>\n<p>To go with the remote desktop kiosk, install Remmina using the following command:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">sudo apt-get install remmina -y<\/pre>\n<p><strong>Automatic logon<\/strong><\/p>\n<p>Our kiosk needs to log on automatically, to achieve this we will overwrite the getty service configuration to change the way TTY1 is started (TTY1 is the default console output on most Linux based servers). To overwrite a part of the getty configuration we need to execute the following command:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">sudo systemctl edit getty@tty1<\/pre>\n<p>The above command will create an overwrite file for the getty configuration. paste the following text in this file to enable automatic login (replace &lt;username&gt; with a local account on the Ubuntu server):<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">[Service]\r\nExecStart=\r\nExecStart=-\/sbin\/agetty -a &lt;username&gt; --noclear %I $TERM<\/pre>\n<p>Because the user configured in the above file will automatically logon to the system at boot, it is recommended to make sure the user can not access sensitive documents (which should not be stored on a kiosk system in any case). the selected user may be in the sudoers file, this will not present a security problem because sudo alway&#8217;s requires a password. For more information about auto logon: Muru, a user on <a href=\"https:\/\/askubuntu.com\">askubuntu.com<\/a> has written a <a href=\"https:\/\/askubuntu.com\/questions\/659267\/how-do-i-override-or-configure-systemd-services\">very interesting answer about auto logon<\/a>.<\/p>\n<p><strong>Graphical user interface<\/strong><\/p>\n<p>Ubuntu server has no X server and Window manager installed by default, its text only. Our kiosk needs a both a X server and a window manger to display any graphical applications.<\/p>\n<p>Use the following command to install the X server (X.org) and windows manager (Openbox):<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">sudo apt-get install --no-install-recommends xserver-xorg x11-xserver-utils xinit openbox -y<\/pre>\n<p>with the GUI installed, we need to configure it. X.org will work out of the box, but openbox requires some minor configuration changes to start our kiosk application.<\/p>\n<p>The Openbox configuration file is located at &#8220;\/etc\/xdg\/openbox\/autostart&#8221;. We can open it for editing with the following command:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">sudo nano \/etc\/xdg\/openbox\/autostart<\/pre>\n<p>Replace the contents of the Openbox configuration file with one of the below ones, depending on witch packet you installed earlier.<\/p>\n<p>Web content\/Chrome (replace &lt;http:\/\/your-url-here&gt; with your desired url:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\"># Disable any form of screen saver \/ screen blanking \/ power management\r\nxset s off\r\nxset s noblank\r\nxset -dpms\r\n\r\n# Allow quitting the X server with CTRL-ATL-Backspace\r\nsetxkbmap -option terminate:ctrl_alt_bksp\r\n\r\n# Start Chromium in kiosk mode\r\nsed -i 's\/\"exited_cleanly\":false\/\"exited_cleanly\":true\/' ~\/.config\/chromium\/'Local State'\r\nsed -i 's\/\"exited_cleanly\":false\/\"exited_cleanly\":true\/; s\/\"exit_type\":\"[^\"]\\+\"\/\"exit_type\":\"Normal\"\/' ~\/.config\/chromium\/Default\/Preferences\r\nchromium-browser --disable-infobars --kiosk '&lt;http:\/\/your-url-here&gt;'<\/pre>\n<p>Remote Desktop\/Remmina (change &lt;path to remmina file&gt; to the actual path to the desired remmina file):<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\"># Disable any form of screen saver \/ screen blanking \/ power management\r\nxset s off\r\nxset s noblank\r\nxset -dpms\r\n\r\n# Allow quitting the X server with CTRL-ATL-Backspace\r\nsetxkbmap -option terminate:ctrl_alt_bksp\r\n\r\n# Start Remmina in kiosk mode\r\nremmina -c &lt;path to remmina file&gt;\r\n\r\n#start remmina in normal mode (for configuration purposes)\r\n#remmina<\/pre>\n<p>If you don&#8217;t have a .remmina file, comment out row 10 and uncomment row 13, now when the xserver is started Remmina will start in normal mode.<\/p>\n<p>The main part of the configuration is done. To start the GUI simply type &#8220;startx&#8221; in the console, the GUI can be closed by pressing ctr+alt+backspace.<\/p>\n<p><strong>Autostart Graphical user interface<\/strong><\/p>\n<p>We can not call a system a kiosk if we need to manually type &#8220;startx&#8221; after every reboot. So lets make sure we wont have to.<\/p>\n<p>We can accomplish this by configuring the &#8220;.bash_profile&#8221; file for the auto login user. Assuming we are alredy logged on as the auto logon user, use the following commands to create or open the &#8220;.bash_profile&#8221; file for editing:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">cd\r\nsudo nano .bash_profile<\/pre>\n<p>now append the following line to the file:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">[[ -z $DISPLAY &amp;&amp; $XDG_VTNR -eq 1 ]] &amp;&amp; startx<\/pre>\n<p>&nbsp;<\/p>\n<p>Reboot and enjoy your kiosk \ud83d\ude42<\/p>\n<p>&nbsp;<\/p>\n<p>A large part of this article is based on <a href=\"https:\/\/die-antwort.eu\/techblog\/2017-12-setup-raspberry-pi-for-kiosk-mode\/\">THIS<\/a> blog-post about a similar setup on a raspberry pi.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article we will show how to setup a browser or RDP kiosk, based on Ubuntu server 18.04 LTS. Because we are using the server edition the kiosk system will have a very small footprint and way less packets installed when we compare it to a stripped down desktop kiosk. First we need to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":302,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,17],"tags":[],"class_list":["post-301","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-general-ict","category-projects"],"_links":{"self":[{"href":"https:\/\/projects-42.nl\/index.php\/wp-json\/wp\/v2\/posts\/301","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/projects-42.nl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/projects-42.nl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/projects-42.nl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/projects-42.nl\/index.php\/wp-json\/wp\/v2\/comments?post=301"}],"version-history":[{"count":11,"href":"https:\/\/projects-42.nl\/index.php\/wp-json\/wp\/v2\/posts\/301\/revisions"}],"predecessor-version":[{"id":314,"href":"https:\/\/projects-42.nl\/index.php\/wp-json\/wp\/v2\/posts\/301\/revisions\/314"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/projects-42.nl\/index.php\/wp-json\/wp\/v2\/media\/302"}],"wp:attachment":[{"href":"https:\/\/projects-42.nl\/index.php\/wp-json\/wp\/v2\/media?parent=301"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/projects-42.nl\/index.php\/wp-json\/wp\/v2\/categories?post=301"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/projects-42.nl\/index.php\/wp-json\/wp\/v2\/tags?post=301"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}