Is it even possible to have Chromium inside a MIR Kiosk?

Thanks for this insight. If it was too much for you guys, theres no chance I will be able to get it working. So I wil abandon Chromium completely. I looked at WPE Webkit, but I thought it was for making apps with HTML/CSS, I didnt realise its a full browser. Hopefully I can make it work. Thank you!

wpe-webkit-mir-kiosk is definitely the best supported kiosk browser in the store currently, but if you really need chromium you should consider simply using an electron kiosk app. this will use the chromium browser engine but with less overhead …

Thanks for that. I dont really need chromium, just a browser that can handle normal html/css/js, with html5 widgets (like date picker), most complicated it gets is css flexbox and css grid.

Its a pity snap get chromium does list a start url and kiosk mode option, that would make things very simple I imagine.

In this tutorial:

It says one can test wayland support with

miral-app -kiosk -terminal '/path/to/my_application'

I am not going to use chromium, but just for learning’s sake I tried:

miral-app -kiosk -terminal chromium

And it displays:
[18303:18303:0727/125243.402810:ERROR:browser_main_loop.cc(1412)] Unable to open X display.

Is it expected that it should start up and be inside the window?

AFAICT this is a problem with the chromium snap, not chromium:

So now going full steam ahead with wpe-webkit-mir-kiosk thank you, however documentation seems a bit thin as far as I can tell.

To verify my dev env:
miral-app -kiosk -terminal 'glmark2-wayland --fullscreen'
Works, however with and without the fullscreen flag, both cases render it as a window about 1/4 size of my screen.

I then tried:

snap set wpe-webkit-mir-kiosk url=https://snapcraft.io
miral-app -kiosk -terminal /snap/bin/wpe-webkit-mir-kiosk.cog

It brings up a window, but it shows a terminal instead of a browser. I feel like I am stabbing at the dark instead of folloing documentation, any insights or suggested reading material?

wpe-webkit-mir-kiosk runs as a daemon and starts automatically (simply installing mir-kioks (or the newer ubuntu-frame) and then installing wpe-webkit-mir-kiosk afterwards should get you all you need, there is no manual stuff necessary beyond setting the value for “url” to point where you want it … there are plenty of commercial Ubuntu Core based installs out there with exactly this setup) , don’t try to run it manually as miral-app …

I’m not clear on what you are trying to do here?

You seem to be following a tutorial about packaging an application for use as a “kiosk app”. And are at the step of testing that it works with Wayland.

But wpe-webkit-mir-kiosk is already packaged as a “kiosk app” so all of that is unnecessary.

Hi Guys, sorry I am talking utter twaddle, I tried orginally just running it and ran into problem then, tried to resolve it with some attempts from the tutorials, but didnt fix it, and then messed up the post. Sorry running on very little sleep, been trying to to make a web kiosk every night until about 4am this last wek.

On a dev enviroment I tried:

sudo snap install wpe-webkit-mir-kiosk

then later

sudo snap install wpe-webkit-mir-kiosk --devmode

This is how I tried to run it

snap set wpe-webkit-mir-kiosk url=https://snapcraft.io
wpe-webkit-mir-kiosk.cog

And I get

+ snapctl is-connected wayland
+ echo Wayland interface not connected!
Wayland interface not connected!
+ exit 1

Thats why I tried the miral-app stuff. Can it not run on dev PC, should I load it onto computer running core (I am working on that but its currently not booting)?
Cheers!

on an Ubuntu Core or Ubuntu Server install (it is important that there is no GUI already running) you do:

sudo snap install mir-kiosk 
sudo snap install wpe-webkit-mir-kiosk
sudo snap set wpe-webkit-mir-kiosk url=https://snapcraft.io

this is all …

after installing mir-kiosk you should see a short orange flash and afterwards a black screen with mouse pointer … (if you decide to use the more modern ubuntu-frame you will see a gray gradient instead of the orange flash)

after installing wpe-webkit-mir-kiosk and waiting a little (it takes a bit to set up its runtime environment on first install) you should see the webkit page …

after running the snap set ... command you should then see the snapcraft.io page (the browser will restart automatically and point to the new URL IIRC)

I still can’t get ubuntu core to boot on my machine, so I gave up and tried a VM for now. I am bit concerned when it comes to deployment.

I was very excited to try these steps, but all I get is a black screen:

michael@ubuntu:~$ sudo snap install mir-kiosk
mir-kiosk 2.4.1-snap124 from Canonical✓ installed
michael@ubuntu:~$ sudo snap install wpe-webkit-mir-kiosk
wpe-webkit-mir-kiosk 2.30.5 from GLANCR labs (glancr) installed
Name                  Version        Rev    Tracking       Publisher   Notes
core20                20210702       1081   latest/stable  canonical✓  base
mir-kiosk             2.4.1-snap124  7278   latest/stable  canonical✓  -
pc                    20-0.4         115    20/stable      canonical✓  gadget
pc-kernel             5.4.0-80.90.1  802    20/stable      canonical✓  kernel
snapd                 2.51.3         12704  latest/stable  canonical✓  snapd
wpe-webkit-mir-kiosk  2.30.5         54     latest/stable  glancr      -
michael@ubuntu:~$ sudo snap set wpe-webkit-mir-kiosk url=https://snapcraft.io
michael@ubuntu:~$ sudo snap set wpe-webkit-mir-kiosk url=https://www.google.co.za

Its been about 10mins now of black screen only. Did it work for you?

It’s like I this attempt is cursed. Nothing has worked for me at every step. I tried to fake kiosk:
(I added ignore this so its not too simliar to another post that I deleted):

(ignore this) ./fake-kiosk mir-kiosk
(ignore this) + kiosk=mir-kiosk
(ignore this) + sudo mir-kiosk --help
(ignore this) [sudo] password for michael: 
(ignore this) + true
(ignore this) + sudo cp /run/user/1000/gdm/Xauthority /root/snap/mir-kiosk/current/.Xauthority
(ignore this) + XAUTHORITY=/root/snap/mir-kiosk/current/.Xauthority exec sudo mir-kiosk
(ignore this) 2021/07/27 16:26:36.092295 cmd_run.go:576: WARNING: XAUTHORITY environment value is not a clean path: "/root/snap/mir-kiosk/7278/.Xauthority"
(ignore this) + mkdir -p /root/snap/mir-kiosk/7278/.config/
(ignore this) + grep -vE (^vt=|^console-provider=vt|^display-layout=) /var/snap/mir-kiosk/7278/miral-kiosk.config
(ignore this) + exec /snap/mir-kiosk/7278/bin/run-miral
(ignore this) [2021-07-27 14:26:36.149915] <information> mirserver: Starting
(ignore this) [2021-07-27 14:26:36.153133] < - debug - > mirserver: Not trying logind: "DISPLAY" is set and X need not have claimed the VT
(ignore this) [2021-07-27 14:26:36.153324] < - debug - > mirserver: Not using Linux VT subsystem for session management: Failed to open current VT
(ignore this) [2021-07-27 14:26:36.153355] < - debug - > mirserver: No session management supported
(ignore this) [2021-07-27 14:26:36.153374] <information> VT switch key handler: No VT switching support available: MinimalConsoleServices does not support VT switching
(ignore this) [2021-07-27 14:26:36.153506] <information> mircommon: Loading modules from: /snap/mir-kiosk/7278/usr/lib/x86_64-linux-gnu/mir/server-platform
(ignore this) [2021-07-27 14:26:36.153564] <information> mircommon: Loading module: /snap/mir-kiosk/7278/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-gbm-kms.so.19
(ignore this) [2021-07-27 14:26:36.153613] <information> mircommon: Loading module: /snap/mir-kiosk/7278/usr/lib/x86_64-linux-gnu/mir/server-platform/server-x11.so.19
(ignore this) [2021-07-27 14:26:36.153621] <information> mircommon: Loading module: /snap/mir-kiosk/7278/usr/lib/x86_64-linux-gnu/mir/server-platform/input-evdev.so.8
(ignore this) [2021-07-27 14:26:36.542702] < - debug - > gbm-kms: Quirks: checking device with devnode: /dev/dri/card1, driver radeon
(ignore this) [2021-07-27 14:26:37.227231] <information> gbm-kms: Failed to probe DRM device: /build/mir-VQizFV/mir-2.4.1/src/server/console/minimal_console_services.cpp(137): Throw in function virtual std::future<std::unique_ptr<mir::Device> > mir::MinimalConsoleServices::acquire_device(int, int, std::unique_ptr<mir::Device::Observer>)
(ignore this) Dynamic exception type: boost::wrapexcept<std::system_error>
(ignore this) std::exception::what: Failed to acquire DRM master: Operation not permitted
(ignore this) 
(ignore this) [2021-07-27 14:26:37.227396] < - debug - > gbm-kms: Quirks: checking device with devnode: (null), driver 
(ignore this) [2021-07-27 14:26:37.227532] < - debug - > gbm-kms: Quirks: checking device with devnode: /dev/dri/card0, driver i915
(ignore this) [2021-07-27 14:26:37.227627] <information> gbm-kms: Failed to probe DRM device: /build/mir-VQizFV/mir-2.4.1/src/server/console/minimal_console_services.cpp(137): Throw in function virtual std::future<std::unique_ptr<mir::Device> > mir::MinimalConsoleServices::acquire_device(int, int, std::unique_ptr<mir::Device::Observer>)
(ignore this) Dynamic exception type: boost::wrapexcept<std::system_error>
(ignore this) std::exception::what: Failed to acquire DRM master: Operation not permitted
(ignore this) 
(ignore this) [2021-07-27 14:26:37.227729] < - debug - > gbm-kms: Quirks: checking device with devnode: (null), driver 
(ignore this) [2021-07-27 14:26:37.227826] < - debug - > gbm-kms: Quirks: checking device with devnode: (null), driver 
(ignore this) [2021-07-27 14:26:37.227921] < - debug - > gbm-kms: Quirks: checking device with devnode: (null), driver 
(ignore this) [2021-07-27 14:26:37.227997] < - debug - > gbm-kms: Quirks: checking device with devnode: (null), driver 
(ignore this) [2021-07-27 14:26:37.228062] < - debug - > gbm-kms: Quirks: checking device with devnode: (null), driver 
(ignore this) [2021-07-27 14:26:37.228141] < - debug - > gbm-kms: Quirks: checking device with devnode: (null), driver 
(ignore this) [2021-07-27 14:26:37.228210] < - debug - > gbm-kms: Quirks: checking device with devnode: (null), driver 
(ignore this) [2021-07-27 14:26:37.228260] <information> mirserver: Found graphics driver: mir:gbm-kms (version 2.4.1) Support priority: 0
(ignore this) [2021-07-27 14:26:38.045010] <information> mirserver: Found graphics driver: mir:x11 (version 2.4.1) Support priority: 192
(ignore this) [2021-07-27 14:26:38.045080] <information> mirserver: Selected driver: mir:x11 (version 2.4.1)
(ignore this) [2021-07-27 14:26:38.045469] <information> mircommon: Loading modules from: /snap/mir-kiosk/7278/usr/lib/x86_64-linux-gnu/mir/server-platform
(ignore this) [2021-07-27 14:26:38.045506] <information> mircommon: Loading module: /snap/mir-kiosk/7278/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-gbm-kms.so.19
(ignore this) [2021-07-27 14:26:38.045517] <information> mircommon: Loading module: /snap/mir-kiosk/7278/usr/lib/x86_64-linux-gnu/mir/server-platform/server-x11.so.19
(ignore this) [2021-07-27 14:26:38.045528] <information> mircommon: Loading module: /snap/mir-kiosk/7278/usr/lib/x86_64-linux-gnu/mir/server-platform/input-evdev.so.8
(ignore this) [2021-07-27 14:26:38.047352] < - debug - > gbm-kms: Quirks: checking device with devnode: /dev/dri/card1, driver radeon
(ignore this) Failed to create /root/.cache/mesa_shader_cache for shader cache (Permission denied)---disabling.
(ignore this) radeon: Failed to allocate virtual address for buffer:
(ignore this) radeon:    size      : 65536 bytes
(ignore this) radeon:    alignment : 4096 bytes
(ignore this) radeon:    domains   : 4
(ignore this) radeon:    va        : 0x0000000100000000
(ignore this) radeon: Failed to deallocate virtual address for buffer:
(ignore this) radeon:    size      : 65536 bytes
(ignore this) radeon:    va        : 0x100000000
(ignore this) radeon: Failed to allocate virtual address for buffer:
(ignore this) radeon:    size      : 65536 bytes
(ignore this) radeon:    alignment : 4096 bytes
(ignore this) radeon:    domains   : 4
(ignore this) radeon:    va        : 0x0000000100000000
(ignore this) radeon: Failed to deallocate virtual address for buffer:
(ignore this) radeon:    size      : 65536 bytes
(ignore this) radeon:    va        : 0x100000000
(ignore this) radeonsi: Failed to create a context.
(ignore this) radeon: Failed to allocate virtual address for buffer:
(ignore this) radeon:    size      : 65536 bytes
(ignore this) radeon:    alignment : 4096 bytes
(ignore this) radeon:    domains   : 4
(ignore this) radeon:    va        : 0x0000000100000000
(ignore this) radeon: Failed to deallocate virtual address for buffer:
(ignore this) radeon:    size      : 65536 bytes
(ignore this) radeon:    va        : 0x100000000
(ignore this) radeon: Failed to allocate virtual address for buffer:
(ignore this) radeon:    size      : 65536 bytes
(ignore this) radeon:    alignment : 4096 bytes
(ignore this) radeon:    domains   : 4
(ignore this) radeon:    va        : 0x0000000100000000
(ignore this) radeon: Failed to deallocate virtual address for buffer:
(ignore this) radeon:    size      : 65536 bytes
(ignore this) radeon:    va        : 0x100000000
(ignore this) radeonsi: Failed to create a context.
(ignore this) Segmentation fault

what kind of VM did you try ?
does it support GL and video acceleration ?

The one very subtly linked in the post: https://ubuntu.com/download/kvm

I took special note of this part vga qxl - sets the paravirtual graphics driver qxl

card0 is intel?
card1 is radeon?

Is this a hybrid intel/radeon machine? There are some unexpected interactions between mesa, snap interfaces and hardware drivers that can cause problems.

Which card has output(s) attached?

Well spotted. Its a laptop, with a built in graphics card. I have taken it apart before and the graphics card is like incorporated on the motherboard as far as I could tell. If I am in windows I can switch between them, and my monitor remains attached to the laptops HDMI outut. In ubuntu I tried to find a way to switch between them but couldnt.

let me list the steps i just did (luckily i’m just testing a UC20 image here so i have a working setup):

i tend to use the qemu-virgil snap for VM testing:

$ sudo snap install qemu-virgil
$ sudo snap connect qemu-virgil:kvm

then i download the UC20 image from cdimage:

$ wget https://cdimage.ubuntu.com/ubuntu-core/20/dangerous-stable/20210118.5/ubuntu-core-20-amd64.img.xz
$ unxz ubuntu-core-20-amd64.img.xz

now i run that image in qemu-virgil (just copy/paste this line)

$ qemu-virgil -enable-kvm -m 4096 -device virtio-vga,virgl=on -display sdl,gl=on -netdev user,id=ethernet.0,hostfwd=tcp::10022-:22 -device rtl8139,netdev=ethernet.0 -soundhw ac97 -drive file=/snap/qemu-virgil/current/usr/share/qemu/edk2-x86_64-code.fd,if=pflash,format=raw,unit=0,readonly=on -serial mon:stdio ubuntu-core-20-amd64.img >/dev/null

the VM takes a bit until you get the “please press enter to configure” message (it reboots once before getting to this point) … just hit enter at the network setup page and then enter your Ubuntu SSO mail address to get a user created and the ssh key you uploaded to SSO put into the VM …

now i ssh into the VM:

$ ssh -p 10022 localhost

INSIDE the VM i run the following:

ogra@ubuntu:~$ snap install ubuntu-frame
ubuntu-frame 35-mir2.4.1 from Canonical✓ installed
ogra@ubuntu:~$ snap install wpe-webkit-mir-kiosk
wpe-webkit-mir-kiosk 2.30.5 from GLANCR labs (glancr) installed
ogra@ubuntu:~$

at this time i see the WPE front page …

That’s why posting the logs is helpful.

If you don’t know which card drives the output I’ll guess and suggest running:

MIR_SERVER_DRIVER_QUIRKS=skip:driver:radeon ./fake-kiosk mir-kiosk