Install mir-kiosk and chromium-mir-kiosk under Ubuntu 18.04 Server

Hello everyone,

as a doc reference, the way i install and use Mir Kiosk and Chromium under 18.04 Server.

At first install mir-kiosk:
sudo snap install mir-kiosk

Then chromium-mir-kiosk, please note to add the “devmode” flas, otherwise the screen will remain black:
sudo snap install chromium-mir-kiosk --beta --devmode

At last, don’t forget to daemonize mir-kiosk to start after boot:
sudo snap set mir-kiosk daemon=true

To customize the startup url for chromium use:
sudo snap set chromium-mir-kiosk url="https://yoururl.com"

Greetings,
Alessio

2 Likes

@alessio does that work on a clean install of Ubuntu Server? I was under the impression some work would be needed to enable graphics.

Yes, bare 18.04 server.

The basic totem works just with Mir Kiosk and the basic 18.04 image.

2 Likes

@alan_g: just a quick update, the only added package is plymouth, to customize the splash screen, but it was added after completing the test on Mir.

1 Like

@alessio I have tested the kiosk following this post. I meet an error. My website can display in the screen but it is not click and any other operation.
First, my setup a ubuntu 18.04 server with vmware fusion. Then I ssh my machine and execute some commands which look like below:

After above commands, I can my website in the screen.


At here, everything is good. But when I try to click or scroll the page, the screen goes into black. I have collect the mir-kiosk and chromium-mir-kiosk log:

The core error rows of chromium-mir-kiosk are:

2019-12-12T09:47:25Z chromium-mir-kiosk.chromium-mir-kiosk[8133]: (EE)
2019-12-12T09:47:25Z chromium-mir-kiosk.chromium-mir-kiosk[8133]: Fatal server error:
2019-12-12T09:47:25Z chromium-mir-kiosk.chromium-mir-kiosk[8133]: (EE) wl_display@1: error 1: invalid arguments for wl_shm@8.create_pool
2019-12-12T09:47:25Z chromium-mir-kiosk.chromium-mir-kiosk[8133]: (EE)
2019-12-12T09:47:25Z chromium-mir-kiosk.chromium-mir-kiosk[8133]: [8343:8343:1212/094725.269117:ERROR:x11_util.cc(103)] X IO error received (X server probably went away)
2019-12-12T09:47:25Z chromium-mir-kiosk.chromium-mir-kiosk[8133]: i3: Cannot open display
2019-12-12T09:47:25Z chromium-mir-kiosk.chromium-mir-kiosk[8133]: [8317:8317:1212/094725.283921:ERROR:chrome_browser_main_extra_parts_x11.cc(62)] X IO error received (X server probably went away)

What is the problem and how can I fix it?

This looks like the problem addressed by https://github.com/snapcore/snapd/pull/7409 which is odd as you’re running chromium-mir-kiosk as a daemon, and that shouldn’t hit the same problem.

Can you check dmsg?

dmesg | grep mir-kiosk

You’re looking for an apparmor="DENIED" for a file associated with chromium-mir-kiosk. It might be something like /run/user/0/snap.chromium-mir-kiosk/xwayland-shared-*.

If that is what is happening, you can temporarily work around this by reinstalling mir-kiosk with --devmode but for a permanent fix we would need to update snapd.

Alternately, try using wpe-webkit-mir-kiosk as chromium-mir-kiosk is unsupported.

Check dmsg result:

[ 3313.035085] audit: type=1400 audit(1576145291.890:285): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="snap.chromium-mir-kiosk.chromium-mir-kiosk" pid=13322 comm="apparmor_parser"
[ 3313.120125] audit: type=1400 audit(1576145291.974:286): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="snap.chromium-mir-kiosk.hook.configure" pid=13323 comm="apparmor_parser"
[ 3313.198903] audit: type=1400 audit(1576145292.054:287): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="snap.chromium-mir-kiosk.hook.install" pid=13324 comm="apparmor_parser"
[ 3313.657973] audit: type=1400 audit(1576145292.514:292): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="snap-update-ns.chromium-mir-kiosk" pid=13368 comm="apparmor_parser"
[ 3313.765128] audit: type=1400 audit(1576145292.622:293): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="snap.chromium-mir-kiosk.chromium-mir-kiosk" pid=13369 comm="apparmor_parser"
[ 3318.442032] audit: type=1400 audit(1576145297.298:332): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="snap.chromium-mir-kiosk.chromium-mir-kiosk" pid=13873 comm="apparmor_parser"
[ 3318.447717] audit: type=1400 audit(1576145297.302:333): apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="snap-update-ns.chromium-mir-kiosk" pid=13875 comm="apparmor_parser"
[ 3318.449664] audit: type=1400 audit(1576145297.306:334): apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="snap.chromium-mir-kiosk.hook.configure" pid=13876 comm="apparmor_parser"
[ 3318.453019] audit: type=1400 audit(1576145297.310:335): apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="snap.chromium-mir-kiosk.hook.install" pid=13877 comm="apparmor_parser"
[ 3329.037224] audit: type=1400 audit(1576145307.894:354): apparmor="ALLOWED" operation="capable" profile="snap.chromium-mir-kiosk.chromium-mir-kiosk" pid=14296 comm="Xwayland" capability=1  capname="dac_override"
[ 3329.037479] audit: type=1400 audit(1576145307.894:355): apparmor="ALLOWED" operation="bind" profile="snap.chromium-mir-kiosk.chromium-mir-kiosk" pid=14296 comm="Xwayland" family="unix" sock_type="stream" protocol=0 requested_mask="bind" denied_mask="bind" addr="@/tmp/.X11-unix/X15"
[ 3329.037721] audit: type=1400 audit(1576145307.894:356): apparmor="ALLOWED" operation="listen" profile="snap.chromium-mir-kiosk.chromium-mir-kiosk" pid=14296 comm="Xwayland" family="unix" sock_type="stream" protocol=0 requested_mask="listen" denied_mask="listen" addr="@/tmp/.X11-unix/X15"
[ 3329.039417] audit: type=1400 audit(1576145307.894:357): apparmor="ALLOWED" operation="connect" profile="snap.chromium-mir-kiosk.chromium-mir-kiosk" name="/run/user/0/wayland-0" pid=14296 comm="Xwayland" requested_mask="wr" denied_mask="wr" fsuid=0 ouid=0
[ 3332.134900] audit: type=1400 audit(1576145310.990:358): apparmor="ALLOWED" operation="capable" info="optional: no audit" error=-1 profile="snap.chromium-mir-kiosk.chromium-mir-kiosk" pid=14323 comm="chromium-browse" capability=24  capname="sys_resource"
[ 3333.914840] audit: type=1326 audit(1576145312.770:359): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=14323 comm="Chrome_IOThread" exe="/snap/chromium-mir-kiosk/35/usr/lib/chromium-browser/chromium-browser" sig=0 arch=c000003e syscall=41 compat=0 ip=0x7f31231625a7 code=0x7ffc0000
[ 3336.091890] audit: type=1400 audit(1576145314.946:360): apparmor="ALLOWED" operation="capable" info="optional: no audit" error=-1 profile="snap.chromium-mir-kiosk.hook.configure" pid=14457 comm="snapctl" capability=12  capname="net_admin"
[ 3336.583799] audit: type=1400 audit(1576145315.438:361): apparmor="ALLOWED" operation="capable" profile="snap.chromium-mir-kiosk.chromium-mir-kiosk" pid=14603 comm="Xwayland" capability=1  capname="dac_override"
[ 3336.584032] audit: type=1400 audit(1576145315.438:362): apparmor="ALLOWED" operation="bind" profile="snap.chromium-mir-kiosk.chromium-mir-kiosk" pid=14603 comm="Xwayland" family="unix" sock_type="stream" protocol=0 requested_mask="bind" denied_mask="bind" addr="@/tmp/.X11-unix/X57"
[ 3336.584129] audit: type=1400 audit(1576145315.438:363): apparmor="ALLOWED" operation="listen" profile="snap.chromium-mir-kiosk.chromium-mir-kiosk" pid=14603 comm="Xwayland" family="unix" sock_type="stream" protocol=0 requested_mask="listen" denied_mask="listen" addr="@/tmp/.X11-unix/X57"
[ 3336.585349] audit: type=1400 audit(1576145315.442:364): apparmor="ALLOWED" operation="connect" profile="snap.chromium-mir-kiosk.chromium-mir-kiosk" name="/run/user/0/wayland-0" pid=14603 comm="Xwayland" requested_mask="wr" denied_mask="wr" fsuid=0 ouid=0
[ 3337.842453] audit: type=1326 audit(1576145316.698:365): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=14635 comm="Chrome_IOThread" exe="/snap/chromium-mir-kiosk/35/usr/lib/chromium-browser/chromium-browser" sig=0 arch=c000003e syscall=41 compat=0 ip=0x7f38723295a7 code=0x7ffc0000
[ 3348.031148] audit: type=1326 audit(1576145326.891:366): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=14635 comm="TaskSchedulerFo" exe="/snap/chromium-mir-kiosk/35/usr/lib/chromium-browser/chromium-browser" sig=0 arch=c000003e syscall=41 compat=0 ip=0x7f38723295a7 code=0x7ffc0000
[ 3348.143641] audit: type=1400 audit(1576145327.003:367): apparmor="ALLOWED" operation="open" profile="snap.chromium-mir-kiosk.chromium-mir-kiosk" name="/run/udev/data/c14:9" pid=14635 comm="TaskSchedulerFo" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
[ 3348.145027] audit: type=1400 audit(1576145327.003:368): apparmor="ALLOWED" operation="open" profile="snap.chromium-mir-kiosk.chromium-mir-kiosk" name="/run/udev/data/c14:2" pid=14635 comm="TaskSchedulerFo" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
[ 3348.168362] audit: type=1400 audit(1576145327.027:369): apparmor="ALLOWED" operation="open" profile="snap.chromium-mir-kiosk.chromium-mir-kiosk" name="/run/udev/data/b2:0" pid=14635 comm="TaskSchedulerFo" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
[ 3353.496547] audit: type=1400 audit(1576145332.356:370): apparmor="DENIED" operation="file_receive" profile="snap.mir-kiosk.daemon" name="/run/user/0/snap.chromium-mir-kiosk/xwayland-shared-uBakJj" pid=11924 comm="Mir/Wayland" requested_mask="wr" denied_mask="wr" fsuid=0 ouid=0

The last row is what you described.

I try to reinstall mir-kiosk with --devmode. It is ok and looks very well.
I have tested kiosk for two whole days. Thank you very much.

But I find the screen is not a fullscreen. How to make a fullscreen?

About the fullscreen, I have resolved by your another post. I should edit the /var/snap/mir-kiosk/2808/miral-kiosk.display. Thank you again.

Run the VM fullscreen?

Yes, run in VM. This has been resolved by edit /var/snap/mir-kiosk/2808/miral-kiosk.display. Thank you.

Hello @alan_g
I am new to Mir-Kiosk and find it very appealing for my kind of project. I am also taking this route of installing it on Ubuntu Server 18.04. Please, is it possible to run my custom portable Qt5 WebEngine app packaged with AppImage on Mir-Kiosk?

That depends on your app: does it have a Wayland backend? The first few steps of this tutorial show how to test this: Make a Wayland-native Kiosk snap.

In theory, mir-kiosk can run any Wayland app. In practice though, the specific approach described in this thread runs the mir-kiosk and app “daemons” as root. That isn’t a concern when they are confined snaps, but you may not consider this to be a good idea with AppImage.

(You don’t have to follow this specific approach to use mir-kiosk, and the first thing to determine is whether your app works with Mir.)

3 posts were merged into an existing topic: Mir-kiosk on Raspberry Pi 4

I followed your post. The chrome kiosk is work on Ubuntu core. I have one issue. The screen restarts by it self once a while. Its like some kind of schedule. I checked the pid, chrome-browser ids did not change. Do you have any idea why this happens?