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

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

Thanks for posting all that info! If I run I can finally see something other than a black screen for the first time :+1: :+1:, I see a white page (must be served by wpe-webkit-mir, so thats exciting) that says :

Page load error
https://snapcraft.io
Error resolving snapcraft.io: Temporary failure in name resolution

Im guessing thats linked to also me not being able to SSH into it:

Can’t SSH with port 10022:

ssh project@localhost -p 10022 -i ~/.ssh/ubuntu.com
kex_exchange_identification: read: Connection reset by peer

I also tried changing the qemu-virgil command to use port 8022, but it still times out.

hmm, perhaps connecting network-control might help:

$ sudo snap connect qemu-virgil:network-control

(i have not installed qemu-virgil from scratch in a long time but see that i manually connected that one)

Was worth a shot, but still same result. Get these errors (evn though started via qemu-virgil):

qemu-system-x86_64: Slirp: Failed to send packet, ret: -1
qemu-system-x86_64: Slirp: Failed to send packet, ret: -1
qemu-system-x86_64: Slirp: Failed to send packet, ret: -1
qemu-system-x86_64: Slirp: Failed to send packet, ret: -1

Try

1 Like

Great! I did not see that, thanks so much for thinking of me, will give it a go! :+1:

I am also only getting a black screen. Any suggestions?