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

And the new tutorials are up: http://bit.ly/secure-kiosk.

1 Like

chromium-mir-kiosk resets the home page every resettime=n from the boot or from the first inactivity. Is that an expected behavior?

I think a better way would be to reset the homepage just once after every inactivity period that followed activity period of user interacting with the kiosk.

One other suggestion would be to include the parameters to hide the vertical and horizontal chromium scrollbars, it really damages the whole touch based UX.

Setting multiple homepages gives out this error:

$ snap set chromium-mir-kiosk url=["http://www.canonical.com","https://www.ubuntu.com"]
error: cannot perform the following tasks:
- Run configure hook of "chromium-mir-kiosk" snap (run hook "configure": Error: URL "[http://www.canonical.com,https://www.ubuntu.com]" needs to start with http:// or https://)

Hi @KristijanZic thanks for the feedback!

We’ve missed the single quotes in the tutorial, the array needs to be passed to the browser pristine:

$ snap set chromium-mir-kiosk url='["http://www.canonical.com","https://www.ubuntu.com"]'

As for your suggestions, think you could propose changes to the bazaar repo? Note this snap is a proof of concept, not a production-grade solution.

2 Likes

Hi,

I wonder how to rotate the chromium-mir-kiosk so that it follows the settings for mir-kiosk as described in this thread: https://discourse.ubuntu.com/t/display-configuration-for-mir-kiosk/7815/4?u=desquare
When setting the mir-kiosk to portrait the chromium-mir-kiosk canvas is rotated as well, however it just keeps it landscape format in 90 degrees. So it won’t get a proper portrait rendering.
Any thoughts on this?

Cheers!

Hi @desquare,
I’m aware of the bug at least. I suspect the problem is the i3 WM, which isn’t aware of the rotation happening, so fails to resize chromium. XWayland seems to be doing the right thing anyway. I’ve not yet found time to investigate further, but it’s on my list.
-G

1 Like

The bug tracker doesn’t seem to be set up or am I missing something?

If you mean for chromium-mir-kiosk, yes, that’s on purpose. Again, it’s not a project that we’re willing to support, not a production grade solution, rather just a demo of what could be achieved given some work.

@greyback After I’ve written a lengthy reply, the forum tells me that I cannot post more than 2 links and only mention 2 people. Since I don’t want to strip potentially useful links from my post, I put it on the snapcraft.io forum where I am no longer a new user :wink:

Hi, first of all: Thanks to you all for the great package! I am currently using it on a Intel NUC with a touch display.

As pointed out by Tobias and @alan_g the portrait mode requires the chromium to run in a non-kiosk mode and a little hack in the i3 configuration.

The only downside for me with this configuration is that Chromium creates a context menu on right click. I have disabled the right mouse button by adding

bindsym --whole-window button3 nop

to the i3.config, this works. But the touch display has a nifty feature: A two finger “click” results in a context menu, too. I have searched many post an I know now that mir uses the “mir:evdev-input (version: 1.1.2)” input driver and that the device is known as “Multi-touch Device”. Does anybody know how to disable the two finger event or the context menu itself?

Kind regards Markus

1 Like

Hi @mit
only reliable way I know to do that is with an extension. Perhaps you can try something like this:
https://stackoverflow.com/questions/28222548/how-to-disable-context-menu-on-right-click-long-touch-in-a-kiosk-mode-of-chrome

In disabling kiosk mode, you lose the other security/limitations it provides. Perhaps you can hack the kiosk extension code itself? My branch is here:
https://git.launchpad.net/~gerboland/+git/chromium-kiosk-app-snap/tree/js
-G

Hi @greyback,

many thanks for your time and your answer. It makes me realizing the whole stack chromium is running under. The extension will probably work, I’ll integrate it - thanks!

Hacking the Kiosk code itself you be another solution but I think I should better spend my time in fixing the real problem: Why does the portrait mode not work? As Alan states in the other thread in the snapcraft.io forum:

This problem lies somewhere between Xwayland, the Window Manager (i3) and the X client (chromium). At least one of them is doing the wrong thing.

It would be great if anyone has a good starting point for debugging, I’ll dive into it next week.

Kind regards Markus

I’ll just mention the alternative web kiosk: https://snapcraft.io/wpe-webkit-mir-kiosk which is mentioned on the snapcraft forum.

(I realize you’ve likely seen it and ruled it out for your needs, but it deserves a mention on this thread.)

1 Like

Could i remotely take screenshots for my chromium-mir-kiosk ( using flameshot) or other solution ( imagick ) ?
in order to remotely monitor my device using ubuntu core and mir-kiosk and chromium-mir-kiosk ?

The security model we implement ensures that applications can only “see” their own windows and not other parts of the display. This prevents screenshotting by “normal” applications.

There are Wayland extension protocols to support screenshotting applications but they are not implemented by Mir and, for security reasons, would not be enabled by default.

Being able to access the display remotely has been discussed (for example https://github.com/MirServer/mir/issues/467) but is not currently supported.

Hi - I am working on a kiosk app for an rpi3 and if I use the snappy core OS and install accordingly, I can get the chromium kiosk working.

I am however unable get this working on a vanilla 18.04 rpi image. What are the up to date steps for a Ubuntu 18.04 server to have this work? I loaded the mir components with dev mode and beta for the chromium.

Name Version Rev Tracking Publisher Notes
chromium-mir-kiosk 69.0.3497.100 33 beta gerboland devmode
core 16-2.39 6962 stable canonical✓ core
core18 20190508 975 stable canonical✓ base
mir-kiosk 1.2.0-snap83 1538 stable canonical✓ devmode

The logs are showing the common errors:

Jun 10 18:16:01 piggo systemd[1]: Started Service for snap application chromium-mir-kiosk.chromium-mir-kiosk.
Jun 10 18:16:02 piggo chromium-mir-kiosk.chromium-mir-kiosk[3605]: ln: failed to create symbolic link ‘/root/snap/chromium-mir-kiosk/33/snap/chromium-mir-kiosk/33/Documents’: No such file or directory
Jun 10 18:16:02 piggo chromium-mir-kiosk.chromium-mir-kiosk[3605]: ln: failed to create symbolic link ‘/root/snap/chromium-mir-kiosk/33/snap/chromium-mir-kiosk/33/Desktop’: No such file or directory
Jun 10 18:16:02 piggo chromium-mir-kiosk.chromium-mir-kiosk[3605]: ln: failed to create symbolic link ‘/root/snap/chromium-mir-kiosk/33/snap/chromium-mir-kiosk/33/Downloads’: No such file or directory
Jun 10 18:16:02 piggo chromium-mir-kiosk.chromium-mir-kiosk[3605]: ln: failed to create symbolic link ‘/root/snap/chromium-mir-kiosk/33/snap/chromium-mir-kiosk/33/Music’: No such file or directory
Jun 10 18:16:02 piggo chromium-mir-kiosk.chromium-mir-kiosk[3605]: ln: failed to create symbolic link ‘/root/snap/chromium-mir-kiosk/33/snap/chromium-mir-kiosk/33/Pictures’: No such file or directory
Jun 10 18:16:02 piggo chromium-mir-kiosk.chromium-mir-kiosk[3605]: ln: failed to create symbolic link ‘/root/snap/chromium-mir-kiosk/33/snap/chromium-mir-kiosk/33/Videos’: No such file or directory
Jun 10 18:16:02 piggo chromium-mir-kiosk.chromium-mir-kiosk[3605]: ln: failed to create symbolic link ‘/root/snap/chromium-mir-kiosk/33/snap/chromium-mir-kiosk/33/Public’: No such file or directory
Jun 10 18:16:02 piggo chromium-mir-kiosk.chromium-mir-kiosk[3605]: ln: failed to create symbolic link ‘/root/snap/chromium-mir-kiosk/33/snap/chromium-mir-kiosk/33/Templates’: No such file or directory
Jun 10 18:16:02 piggo chromium-mir-kiosk.chromium-mir-kiosk[3605]: Error: Unable to find a valid Wayland socket in /run/user/0
Jun 10 18:16:02 piggo chromium-mir-kiosk.chromium-mir-kiosk[3605]: Is a Wayland server running?
Jun 10 18:16:03 piggo systemd[1]: snap.chromium-mir-kiosk.chromium-mir-kiosk.service: Main process exited, code=exited, status=1/FAILURE
Jun 10 18:16:03 piggo systemd[1]: snap.chromium-mir-kiosk.chromium-mir-kiosk.service: Failed with result ‘exit-code’.
Jun 10 18:16:03 piggo systemd[1]: snap.chromium-mir-kiosk.chromium-mir-kiosk.service: Service hold-off time over, scheduling restart.

Do the core and core18 snaps need to be devmode also?

Regarding the soft links I noticed the /var/snap/chromium-mir-kiosk/current was pointing to the local ‘33’ folder which was empty.

The /root/snap/chromium-mir-kiosk/33 is where all the Documents Downloads … etc folders were in existence.

I tried to ln the current to the /root location where the files exit but the errors are the same.

What is the system trying to do ? How do we solve this?

thx!

Hi @fractalsynapse, any reason why you can’t stick with the Core image? It’s a much better design for a kiosk application.

The symlink errors should be benign, but it looks like mir-kiosk itself is not working. Can you show the output of systemctl status snap.mir-kiosk* snap.chromium-mir-kiosk* please?

Hey,
I’ve only tested chromium-mir-kiosk against Ubuntu Core, so this is uncharted territory for me.

That’s the problem at least, it’s unable to find the Wayland socket, which should be /run/user/0/wayland-0.

Some questions:

  1. You have mir-kiosk running? Has it created a Wayland socket in that location?
  2. Is mir-kiosk providing a wayland interface, and is chromium-mir-kiosk connected to this?
  3. Do you see any AppArmor complaints in dmesg ?

Thanks
-G