Snaps to develop a Web kiosk on Ubuntu Core (using Wayland)

Great!

Just a warning: I’ ve been told we should be using /var/snap/mir-kiosk/current/ not /var/snap/mir-kiosk/common/ for the config files. So beware that you may need to move the miral-kiosk.config file in the near future. (One of the perils of using edge!)

1 Like

Using fresh install of Ubuntu 18.04.1 Server and using mir-kiosk and chromium-mir-kiosk from --channel edge/wayland-interface. Mir-kiosk starts, I get the orange-to-black animation. However, chromium-mir-kiosk is still generating errors. See the output of journalctl -u snap.chromium-mir-kiosk*:

Sep 13 21:08:00 digisign systemd[1]: snap.chromium-mir-kiosk.chromium-mir-kiosk.service: Service hold-off time over, scheduling restart.
Sep 13 21:08:00 digisign systemd[1]: snap.chromium-mir-kiosk.chromium-mir-kiosk.service: Scheduled restart job, restart counter is at 5.
Sep 13 21:08:00 digisign systemd[1]: Stopped Service for snap application chromium-mir-kiosk.chromium-mir-kiosk.
Sep 13 21:08:00 digisign systemd[1]: Started Service for snap application chromium-mir-kiosk.chromium-mir-kiosk.
Sep 13 21:08:00 digisign chromium-mir-kiosk.chromium-mir-kiosk[18270]: mkdir: cannot create directory ‘/run/user/0’: Permission denied
Sep 13 21:08:00 digisign chromium-mir-kiosk.chromium-mir-kiosk[18270]: ln: failed to create symbolic link '/root/snap/chromium-mir-kiosk/19/snap/chromium-mir-kiosk/19/Documents': No such file or directory
Sep 13 21:08:00 digisign chromium-mir-kiosk.chromium-mir-kiosk[18270]: ln: failed to create symbolic link '/root/snap/chromium-mir-kiosk/19/snap/chromium-mir-kiosk/19/Desktop': No such file or directory
Sep 13 21:08:00 digisign chromium-mir-kiosk.chromium-mir-kiosk[18270]: ln: failed to create symbolic link '/root/snap/chromium-mir-kiosk/19/snap/chromium-mir-kiosk/19/Downloads': No such file or directory
Sep 13 21:08:00 digisign chromium-mir-kiosk.chromium-mir-kiosk[18270]: ln: failed to create symbolic link '/root/snap/chromium-mir-kiosk/19/snap/chromium-mir-kiosk/19/Music': No such file or directory
Sep 13 21:08:00 digisign chromium-mir-kiosk.chromium-mir-kiosk[18270]: ln: failed to create symbolic link '/root/snap/chromium-mir-kiosk/19/snap/chromium-mir-kiosk/19/Pictures': No such file or directory
Sep 13 21:08:00 digisign chromium-mir-kiosk.chromium-mir-kiosk[18270]: ln: failed to create symbolic link '/root/snap/chromium-mir-kiosk/19/snap/chromium-mir-kiosk/19/Videos': No such file or directory
Sep 13 21:08:00 digisign chromium-mir-kiosk.chromium-mir-kiosk[18270]: ln: failed to create symbolic link '/root/snap/chromium-mir-kiosk/19/snap/chromium-mir-kiosk/19/Templates': No such file or directory
Sep 13 21:08:00 digisign chromium-mir-kiosk.chromium-mir-kiosk[18270]: mkdir: cannot create directory ‘/run/user/0’: Permission denied
Sep 13 21:08:00 digisign systemd[1]: snap.chromium-mir-kiosk.chromium-mir-kiosk.service: Main process exited, code=exited, status=1/FAILURE
Sep 13 21:08:00 digisign systemd[1]: snap.chromium-mir-kiosk.chromium-mir-kiosk.service: Failed with result 'exit-code'.
Sep 13 21:08:01 digisign systemd[1]: snap.chromium-mir-kiosk.chromium-mir-kiosk.service: Service hold-off time over, scheduling restart.
Sep 13 21:08:01 digisign systemd[1]: snap.chromium-mir-kiosk.chromium-mir-kiosk.service: Scheduled restart job, restart counter is at 6.
Sep 13 21:08:01 digisign systemd[1]: Stopped Service for snap application chromium-mir-kiosk.chromium-mir-kiosk.
Sep 13 21:08:01 digisign systemd[1]: snap.chromium-mir-kiosk.chromium-mir-kiosk.service: Start request repeated too quickly.
Sep 13 21:08:01 digisign systemd[1]: snap.chromium-mir-kiosk.chromium-mir-kiosk.service: Failed with result 'exit-code'.
Sep 13 21:08:01 digisign systemd[1]: Failed to start Service for snap application chromium-mir-kiosk.chromium-mir-kiosk.

This is going to be so cool when it works.

C

Classic (i.e. Server and Desktop) installs still require devmode for this. So just reinstall both mir-kiosk and chromium-mir-kiosk with --devmode and you should be good.

1 Like

I get random reboots on my Ubuntu Core. Not sure if this is due to chromium-mir-kiosk, mir-kiosk och core itself. But when checking the log of snap.chromium-mir-kiosk I get a bunch of permission errors. Check this out:

– Logs begin at Fri 2018-09-14 08:36:51 UTC, end at Fri 2018-09-14 08:44:46 UTC. –
Sep 14 08:37:11 localhost.localdomain systemd[1]: Started Service for snap application chromium-mir-kiosk.chromium.
Sep 14 08:37:14 localhost.localdomain chromium-mir-kiosk.chromium[1332]: mkdir: cannot create directory ‘/run/user/0’: Permission denied
Sep 14 08:37:14 localhost.localdomain chromium-mir-kiosk.chromium[1332]: ln: failed to create symbolic link ‘/root/snap/chromium-mir-kiosk/9/snap/chromium-mir-kiosk/9/Documents’: No such file or directory
Sep 14 08:37:14 localhost.localdomain chromium-mir-kiosk.chromium[1332]: ln: failed to create symbolic link ‘/root/snap/chromium-mir-kiosk/9/snap/chromium-mir-kiosk/9/Desktop’: No such file or directory
Sep 14 08:37:14 localhost.localdomain chromium-mir-kiosk.chromium[1332]: ln: failed to create symbolic link ‘/root/snap/chromium-mir-kiosk/9/snap/chromium-mir-kiosk/9/Downloads’: No such file or directory
Sep 14 08:37:14 localhost.localdomain chromium-mir-kiosk.chromium[1332]: ln: failed to create symbolic link ‘/root/snap/chromium-mir-kiosk/9/snap/chromium-mir-kiosk/9/Music’: No such file or directory
Sep 14 08:37:14 localhost.localdomain chromium-mir-kiosk.chromium[1332]: ln: failed to create symbolic link ‘/root/snap/chromium-mir-kiosk/9/snap/chromium-mir-kiosk/9/Pictures’: No such file or directory
Sep 14 08:37:14 localhost.localdomain chromium-mir-kiosk.chromium[1332]: ln: failed to create symbolic link ‘/root/snap/chromium-mir-kiosk/9/snap/chromium-mir-kiosk/9/Videos’: No such file or directory
Sep 14 08:37:14 localhost.localdomain chromium-mir-kiosk.chromium[1332]: ln: failed to create symbolic link ‘/root/snap/chromium-mir-kiosk/9/snap/chromium-mir-kiosk/9/Templates’: No such file or directory
Sep 14 08:37:14 localhost.localdomain chromium-mir-kiosk.chromium[1332]: mkdir: cannot create directory ‘/run/user/0’: Permission denied
Sep 14 08:37:15 localhost.localdomain chromium-mir-kiosk.chromium[1332]: could not connect to wayland server
Sep 14 08:37:15 localhost.localdomain chromium-mir-kiosk.chromium[1332]: (EE)
Sep 14 08:37:15 localhost.localdomain chromium-mir-kiosk.chromium[1332]: Fatal server error:
Sep 14 08:37:15 localhost.localdomain chromium-mir-kiosk.chromium[1332]: (EE) Couldn’t add screen
Sep 14 08:37:15 localhost.localdomain chromium-mir-kiosk.chromium[1332]: (EE)
Sep 14 08:37:16 localhost.localdomain chromium-mir-kiosk.chromium[1332]: i3: Could not mkdir(/run/user/0/snap.chromium-mir-kiosk/i3): No such file or directory
Sep 14 08:37:16 localhost.localdomain chromium-mir-kiosk.chromium[1332]: i3: Check permissions of $XDG_RUNTIME_DIR = ‘/run/user/0/snap.chromium-mir-kiosk’
Sep 14 08:37:24 localhost.localdomain chromium-mir-kiosk.chromium[1332]: [1752:1752:0914/083724.793798:WARNING:browser_main_loop.cc(271)] Gtk: cannot open display: :0
Sep 14 08:37:25 localhost.localdomain chromium-mir-kiosk.chromium[1332]: /snap/chromium-mir-kiosk/9/bin/chromium-browser.launcher: line 1: kill: (1688) - No such process
Sep 14 08:37:25 localhost.localdomain systemd[1]: snap.chromium-mir-kiosk.chromium.service: Main process exited, code=exited, status=1/FAILURE
Sep 14 08:37:25 localhost.localdomain systemd[1]: snap.chromium-mir-kiosk.chromium.service: Unit entered failed state.
Sep 14 08:37:25 localhost.localdomain systemd[1]: snap.chromium-mir-kiosk.chromium.service: Failed with result ‘exit-code’.
Sep 14 08:37:25 localhost.localdomain systemd[1]: snap.chromium-mir-kiosk.chromium.service: Service hold-off time over, scheduling restart.
Sep 14 08:37:25 localhost.localdomain systemd[1]: Stopped Service for snap application chromium-mir-kiosk.chromium.
Sep 14 08:37:25 localhost.localdomain systemd[1]: Started Service for snap application chromium-mir-kiosk.chromium.
Sep 14 08:37:25 localhost.localdomain chromium-mir-kiosk.chromium[1756]: mkdir: cannot create directory ‘/run/user/0’: Permission denied
Sep 14 08:37:25 localhost.localdomain chromium-mir-kiosk.chromium[1756]: ln: failed to create symbolic link ‘/root/snap/chromium-mir-kiosk/9/snap/chromium-mir-kiosk/9/Documents’: No such file or directory
Sep 14 08:37:25 localhost.localdomain chromium-mir-kiosk.chromium[1756]: ln: failed to create symbolic link ‘/root/snap/chromium-mir-kiosk/9/snap/chromium-mir-kiosk/9/Desktop’: No such file or directory
Sep 14 08:37:25 localhost.localdomain chromium-mir-kiosk.chromium[1756]: ln: failed to create symbolic link ‘/root/snap/chromium-mir-kiosk/9/snap/chromium-mir-kiosk/9/Downloads’: No such file or directory
Sep 14 08:37:25 localhost.localdomain chromium-mir-kiosk.chromium[1756]: ln: failed to create symbolic link ‘/root/snap/chromium-mir-kiosk/9/snap/chromium-mir-kiosk/9/Music’: No such file or directory
Sep 14 08:37:25 localhost.localdomain chromium-mir-kiosk.chromium[1756]: ln: failed to create symbolic link ‘/root/snap/chromium-mir-kiosk/9/snap/chromium-mir-kiosk/9/Pictures’: No such file or directory
Sep 14 08:37:25 localhost.localdomain chromium-mir-kiosk.chromium[1756]: ln: failed to create symbolic link ‘/root/snap/chromium-mir-kiosk/9/snap/chromium-mir-kiosk/9/Videos’: No such file or directory
Sep 14 08:37:25 localhost.localdomain chromium-mir-kiosk.chromium[1756]: ln: failed to create symbolic link ‘/root/snap/chromium-mir-kiosk/9/snap/chromium-mir-kiosk/9/Templates’: No such file or directory
Sep 14 08:37:25 localhost.localdomain chromium-mir-kiosk.chromium[1756]: mkdir: cannot create directory ‘/run/user/0’: Permission denied
Sep 14 08:37:26 localhost.localdomain chromium-mir-kiosk.chromium[1756]: glamor: EGL version 1.4 (DRI2):
Sep 14 08:37:27 localhost.localdomain chromium-mir-kiosk.chromium[1756]: i3: Could not mkdir(/run/user/0/snap.chromium-mir-kiosk/i3): No such file or directory
Sep 14 08:37:27 localhost.localdomain chromium-mir-kiosk.chromium[1756]: i3: Check permissions of $XDG_RUNTIME_DIR = ‘/run/user/0/snap.chromium-mir-kiosk’
Sep 14 08:37:38 localhost.localdomain chromium-mir-kiosk.chromium[1756]: ATTENTION: default value of option force_s3tc_enable overridden by environment.
Sep 14 08:37:38 localhost.localdomain chromium-mir-kiosk.chromium[1756]: shm_open() failed: Permission denied
Sep 14 08:37:38 localhost.localdomain chromium-mir-kiosk.chromium[1756]: Failed to create secure directory (/run/user/0/snap.chromium-mir-kiosk/pulse): No such file or directory
Sep 14 08:37:41 localhost.localdomain chromium-mir-kiosk.chromium[1756]: [1965:2041:0914/083741.282076:ERROR:bus.cc(394)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are “tcp” and on UNIX “unix”)
Sep 14 08:37:41 localhost.localdomain chromium-mir-kiosk.chromium[1756]: [1965:1965:0914/083741.775350:WARNING:password_store_factory.cc(240)] Using basic (unencrypted) store for password storage. See https://chromium.googlesource.com/chromium/src/+/master/docs/linux_password_storage.md for more information about password storage options.
Sep 14 08:37:42 localhost.localdomain chromium-mir-kiosk.chromium[1756]: LaunchProcess: failed to execvp:
Sep 14 08:37:42 localhost.localdomain chromium-mir-kiosk.chromium[1756]: xdg-desktop-menu
Sep 14 08:37:42 localhost.localdomain chromium-mir-kiosk.chromium[1756]: LaunchProcess: failed to execvp:
Sep 14 08:37:42 localhost.localdomain chromium-mir-kiosk.chromium[1756]: xdg-icon-resource
Sep 14 08:37:42 localhost.localdomain chromium-mir-kiosk.chromium[1756]: [1965:1983:0914/083742.312222:WARNING:shell_integration_linux.cc(324)] Could not install icon chrome-mebpkjlidhbhcijdfilbkcapobaejicc-Default.png at size 16.
Sep 14 08:37:42 localhost.localdomain chromium-mir-kiosk.chromium[1756]: LaunchProcess: failed to execvp:
Sep 14 08:37:42 localhost.localdomain chromium-mir-kiosk.chromium[1756]: xdg-icon-resource
Sep 14 08:37:42 localhost.localdomain chromium-mir-kiosk.chromium[1756]: [1965:1983:0914/083742.387006:WARNING:shell_integration_linux.cc(324)] Could not install icon chrome-mebpkjlidhbhcijdfilbkcapobaejicc-Default.png at size 128.
Sep 14 08:37:42 localhost.localdomain chromium-mir-kiosk.chromium[1756]: LaunchProcess: failed to execvp:
Sep 14 08:37:42 localhost.localdomain chromium-mir-kiosk.chromium[1756]: xdg-desktop-menu
Sep 14 08:37:44 localhost.localdomain chromium-mir-kiosk.chromium[1756]: [1965:1987:0914/083744.978583:ERROR:udev_watcher.cc(60)] Failed to begin udev enumeration.
Sep 14 08:37:47 localhost.localdomain chromium-mir-kiosk.chromium[1756]: [1965:1965:0914/083747.835349:ERROR:display_info_provider.cc(189)] Not implemented reached in virtual void extensions::DisplayInfoProvider::UpdateDisplayUnitInfoForPlatform(const display::Display &, extensions::api::system_display::DisplayUnitInfo *)

Can you shed any light over this? How do I give the snap permissions to do what it wants? On screen everything looks good but the reboots makes me suspicious and therefor I checked the log out with journalctl -u snap.chromium-mir-kiosk*

Thanks!

I reinstalled the snaps with --devmode and it is working! Thanks again. Your work is valuable and appreciated!! :smile:

CH

Hey @desquare,
nearly all of those “permission denied” errors are not fatal, they are a result of desktop app being confined in a snap.

This is a new error to me though. Can you share your “snap interfaces” output? It might be a failure culprit. But I don’t know how it would cause the device to reboot. What kind of device are you using?
-G

@greyback et al. Love the work going on here. I’m also getting the error:

error: snap “chromium-mir-kiosk” has no plug named “wayland-socket-dir”

I’m running on ARM, and in --devmode for the kiosk and chromium both on edge as well.

kiosk runs fine… thanks for any pointers! :slight_smile:

chromium-mir-kiosk  68.0.3440.106              21    edge/…    gerboland   devmode
core                16-2.35.1+git946.6aaefce   5478  edge      canonical✓  core
mir-kiosk           0.32.1+dev460-gddb262d9ec  509   edge      canonical✓  devmode
pi2-kernel          4.4.0-1097.105             71    edge      canonical✓  kernel
pi3                 16.04-0.5                  22    edge      canonical✓  gadget

We’re in the process of eliminating use of the wayland-socket-dir interface. I didn’t think that work was yet published on edge (it should be on “edge/wayland-interface”). We’ll be updating the snaps and documentation at some point in the next few days. I’ll check what’s happening here tomorrow.

Thanks @alan_g! I misspoke, I’m already on the edge/wayland-interface channel for chromium-mir-kiosk.

With that in mind, is there a path to success on a different channel for chromium-mir-kiosk? or does mir-kiosk also have an edge/wayland-interface channel?

Using chromium-mir-kiosk “edge”? (The only reason for using the “edge/wayland-interface” branches of these snaps is to test the upcoming changes.)

@alan_g darn… that’s where I started, and I believe as someone mentioned above “edge” the only option for ARM right now (nothings on beta). Your original point stands. Edge must already have these changes because that plug isn’t available in either channel.

@alan_g @greyback all clear here on the wayland-interface channel :smiley:

thanks for the amazing work, super excited to see where this goes with my pi.

1 Like

Hi @greyback,

Thanks for helping me!
Here is the output:

 Slot                          Plug
chromium-mir-kiosk:x11        chromium-mir-kiosk:x11-plug
:account-control              -
:alsa                         -
:autopilot-introspection      -
:bluetooth-control            -
:broadcom-asic-control        -
:browser-support              chromium-mir-kiosk:browser-sandbox
:camera                       -
:can-bus                      -
:classic-support              -
:core-support                 -
:cpu-control                  -
:daemon-notify                -
:dcdbas-control               -
:docker-support               -
:dvb                          -
:firewall-control             -
:framebuffer                  -
:fuse-support                 -
:gpg-keys                     -
:gpg-public-keys              -
:gpio-memory-control          -
:greengrass-support           -
:hardware-observe             -
:hardware-random-control      -
:hardware-random-observe      -
:home                         -
:hostname-control             -
:io-ports-control             -
:joystick                     -
:kernel-module-control        -
:kubernetes-support           -
:kvm                          -
:log-observe                  -
:lxd-support                  -
:mount-observe                -
:netlink-audit                -
:netlink-connector            -
:network                      chromium-mir-kiosk
:network-bind                 -
:network-control              -
:network-observe              -
:network-setup-control        -
:network-setup-observe        -
:opengl                       chromium-mir-kiosk,mir-kiosk
:openvswitch-support          -
:physical-memory-control      -
:physical-memory-observe      -
:ppp                          -
:process-control              -
:raw-usb                      -
:removable-media              -
:shutdown                     -
:snapd-control                -
:ssh-keys                     -
:ssh-public-keys              -
:system-observe               -
:system-trace                 -
:time-control                 -
:timeserver-control           -
:timezone-control             -
:tpm                          -
:uhid                         -
mir-kiosk:mir                 -
mir-kiosk:mir-libs-1604       -
mir-kiosk:wayland             chromium-mir-kiosk
mir-kiosk:wayland-socket-dir  chromium-mir-kiosk
-                             chromium-mir-kiosk:camera
-                             chromium-mir-kiosk:cups-control
-                             chromium-mir-kiosk:desktop
-                             chromium-mir-kiosk:gsettings
-                             chromium-mir-kiosk:hardware-observe
-                             chromium-mir-kiosk:home
-                             chromium-mir-kiosk:mount-observe
-                             chromium-mir-kiosk:network-manager
-                             chromium-mir-kiosk:password-manager-service
-                             chromium-mir-kiosk:pulseaudio
-                             chromium-mir-kiosk:removable-media
-                             chromium-mir-kiosk:screen-inhibit-control

My system is a Aaeon APL3 running on a Apollo Lake CPU. Check it out here: https://www.aaeon.com/en/p/pico-itx-boards-pico-apl3

I use the Ubuntu Core image for Intel NUC 64-bit.

Thanks!

Hey @desquare ,
the basic interfaces are in place for chromium to function. Tell me, does Chromium start up at all? Or are you finding that it runs ok, and then randomly crashes? Or runs and the device randomly reboots? Maybe device reboots itself for another reason? (snap core updates maybe).

If Chromium crashes, it should just be restarted automatically. It should never cause the device to reboot. I have seen more exotic hardware with dodgy GPU drivers, where a crash/bad client would cause a GPU hang, which a watchdog would notice and force a reboot. But you’re using Intel hardware which has good drivers.
-G

Actually, it ran stable when I set it up using your guide. The reboots, which occurs very random, first appear after refreshing the mir-kiosk snap to --edge from --stable. What I wanted to achieve was to change the startup URL, hide the cursor and prevent reload of the URL as I looking into using this for a digital signage solution.
But the hidecursor config in chromium-mir-kiosk had no effect and @alan_g instructed med to use mir-kiosk from --edge which has a configuration file where I can hide the cursor successfully.

With those settings I get the occasionally reboots. At first I thought that it may have to do with the snap and system updates but it is not in time with the timers that handle the update checks.

This is my config for chromium-mir-kiosk:

 snap get chromium-mir-kiosk 
 Key           Value
 disablekiosk  false
 hidecursor    false
 resettime     0
 shownav       false
 url           http://ad.neuranet.com/v2/KNfbrRshBSt/ 

And this is my config file for mir-kiosk:

cat /var/snap/mir-kiosk/common/miral-kiosk.config
cursor=null

Feel free to try the URL and settings out. It is a simple HTML Menu.

Cheers!

@desquare
if you switch back to stable mir-kiosk, do these random reboots go away? I’m very intrigued how Mir/Chromium could possibly cause the whole device to reboot!

Note: chromium-mir-kiosk is lacking a little polish to be a full production-ready digital signage solution. It has minimal testing, security updates are not guaranteed, and I know the hide cursor thing didn’t quite work either. There’s no OSK solution for touch-screen devices either.

Please contact us if you’d like to work with us to improve it.
-G

@greyback

I’ll try that out and see if that changes things. I also have a Dragonboard 410 that I can deploy the snap on to see if the problems occur on that ARM platform as well.

I’ve 14 years of experience in the digital signage business and I think that now the web technology is somewhat mature enough to be used for 24/7 applications. That in combination with IoT focused operating sysmtems such as Ubuntu Core (and also Windows IoT Core that I have created some customised images for) is very exiting and secure to work with. However I’m an entrepreneur and designer with a good feeling for user experience and not a developer. I’m fairly good at tweaking systems on an OS level, as long as I have good documentation, but not when it comes to programming.

I would love to work with you to improve this snap if you are interested in what I can provide as an expert of the market and user needs from a business point a view.

Cheers!

@desquare I only meant the snap is not production quality, not web technologies themselves :slight_smile:

@greyback Gotcha! :wink:

Hey all, note the transition time is drawing to a close, mir-kiosk with the wayland interface is available in the candidate channel now (as well as edge).

The compatible “chromium-mir-kiosk” is in the edge channel and will move to beta when we release mir-kiosk to stable later today.

The tutorials are being updated with this PR.

1 Like