Running a kiosk on Ubuntu Classic

Sorry, the fullscreen is end result what I want. I think that it is necessary to explain my whole story.
My goal is run an electron application in kiosk. The steps look like below:

  1. setup machine with ubuntu desktop 18.04.03
  2. build an electron snap application. I build the application from here
  3. SSHd my machine and test whether electron app is ok in kiosk.
sudo snap install mir-kiosk
sudo snap set mir-kiosk daemon=true # this comes from you suggestion at https://discourse.ubuntu.com/t/failed-to-find-platform-for-current-system-when-starting-mir-kiosk/10124/19?u=jimmywa
sudo snap restart mir-kiosk
# at here I can see a black fullscreen
sudo snap connect electron-hello-world-kiosk:wayland
sudo snap restart electron-hello-world-kiosk
# at here I expect that I can see a hello-world page, but I can not.
# in case of my app is a wrong app, I also test the `mir-kiosk-apps`
sudo snap install --edge mir-kiosk-apps
sudo snap connect mir-kiosk-apps:wayland
sudo snap restart mir-kiosk-apps
# at here I expect that I can see the content as same as the picture in this post but I can not.

so my question is how to run an electron application in kiosk with fullscreen! This is my whole story.
I learn kiosk at recently, so can you give me some suggestion for the goal?

You are digressing somewhat from the topic of this post: running mir-kiosk within your desktop environment.

What you are trying is closer to Install mir-kiosk and chromium-mir-kiosk under Ubuntu 18.04 Server (I know you’re not using chromium-mir-kiosk or Ubuntu Server, but this is about setup on a classic system.)

When you say “at here I can see a black fullscreen” are you seeing the Orange “splash” as mir-kiosk starts and the cursor? Or just a black screen? What do you see in sudo snap logs -n 50 mir-kiosk?

Just a black screen. About the snap log, I want to say sorry because I get a black screen when I restart my machine. But from your reply, I figured out that the desktop os is not a classic system. Right?
I will try the Ubuntu 18.04 Server. Thank you very much.

Then mir-kiosk is not running which would explain why client snaps fail to work.

That is probably because mir-kiosk tries to start and fails, the logs may tell us why. You should be able to VT switch (Ctrl-Alt-F1) to the greeter and log in normally. If that fails ssh in from another machine and disable the daemon:

sudo snap set mir-kiosk daemon=false

Both Ubuntu Desktop and Ubuntu Server are “classic” systems, as are Fedora, Arch etc. the distinction snapd makes is between “core” (i.e. Ubuntu Core) and “classic” systems.

I have reproduced the black scree and get the mir-kiosk log:

2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.249519] <information> mirserver: . |_ Logical size 1280x800
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.249526] <information> mirserver: . |_ Logical position +0+0
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.249533] <information> mirserver: . |_ Scaling factor: 1.00
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.249541] <information> mirserver: * Output 2: Virtual disconnected
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.249548] <information> mirserver: * Output 3: Virtual disconnected
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.249555] <information> mirserver: * Output 4: Virtual disconnected
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.249562] <information> mirserver: * Output 5: Virtual disconnected
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.249569] <information> mirserver: * Output 6: Virtual disconnected
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.249576] <information> mirserver: * Output 7: Virtual disconnected
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.249582] <information> mirserver: * Output 8: Virtual disconnected
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.252691] <information> mirserver: New base display configuration:
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.252733] <information> mirserver: * Output 1: Virtual connected, used
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.252741] <information> mirserver: . |_ Physical size 0.0" 0x0mm
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.252746] <information> mirserver: . |_ Power is on
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.252752] <information> mirserver: . |_ Current mode 1280x800 60.00Hz
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.252757] <information> mirserver: . |_ Preferred mode 1280x800 60.00Hz
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.252761] <information> mirserver: . |_ Orientation normal
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.252766] <information> mirserver: . |_ Logical size 1280x800
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.252770] <information> mirserver: . |_ Logical position +0+0
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.252774] <information> mirserver: . |_ Scaling factor: 1.00
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.252779] <information> mirserver: * Output 2: Virtual disconnected
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.252783] <information> mirserver: * Output 3: Virtual disconnected
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.252787] <information> mirserver: * Output 4: Virtual disconnected
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.252791] <information> mirserver: * Output 5: Virtual disconnected
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.252795] <information> mirserver: * Output 6: Virtual disconnected
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.252800] <information> mirserver: * Output 7: Virtual disconnected
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.252804] <information> mirserver: * Output 8: Virtual disconnected
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293286] < -warning- > miral: Display config does not contain layout 'default'
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293370] <information> miral: Display config:
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: 8>< ---------------------------------------------------
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: layouts:
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: # keys here are layout labels (used for atomically switching between them)
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: # when enabling displays, surfaces should be matched in reverse recency order
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]:   default:                         # the default layout
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]:     cards:
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]:     # a list of cards (currently matched by card-id)
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]:     - card-id: 0
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]:       Virtual-1:
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]:         # This output supports the following modes: 1280x800@60.0, 2560x1600@60.0,
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]:         # 1920x1440@60.0, 1856x1392@60.0, 1792x1344@60.0, 1920x1200@59.9, 1600x1200@60.0,
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]:         # 1680x1050@60.0, 1400x1050@60.0, 1280x1024@60.0, 1440x900@59.9, 1280x960@60.0,
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]:         # 1360x768@60.0, 1280x800@59.8, 1152x864@75.0, 1280x768@59.9, 1024x768@60.0,
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]:         # 800x600@60.3, 640x480@59.9
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]:         #
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]:         # Uncomment the following to enforce the selected configuration.
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]:         # Or amend as desired.
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]:         #
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]:         # state: enabled	# {enabled, disabled}, defaults to enabled
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]:         # mode: 1280x800@60.0	# Defaults to preferred mode
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]:         # position: [0, 0]	# Defaults to [0, 0]
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]:         # orientation: normal	# {normal, left, right, inverted}, defaults to normal
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]:       Virtual-2:
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]:         # (disconnected)
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]:       Virtual-3:
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]:         # (disconnected)
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]:       Virtual-4:
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]:         # (disconnected)
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]:       Virtual-5:
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]:         # (disconnected)
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]:       Virtual-6:
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]:         # (disconnected)
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]:       Virtual-7:
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]:         # (disconnected)
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]:       Virtual-8:
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]:         # (disconnected)
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: 8>< ---------------------------------------------------
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293540] <information> mirserver: New display configuration:
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293558] <information> mirserver: * Output 1: Virtual connected, used
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293565] <information> mirserver: . |_ Physical size 0.0" 0x0mm
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293570] <information> mirserver: . |_ Power is on
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293575] <information> mirserver: . |_ Current mode 1280x800 60.00Hz
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293583] <information> mirserver: . |_ Preferred mode 1280x800 60.00Hz
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293590] <information> mirserver: . |_ Orientation normal
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293597] <information> mirserver: . |_ Logical size 1280x800
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293620] <information> mirserver: . |_ Logical position +0+0
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293628] <information> mirserver: . |_ Scaling factor: 1.00
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293633] <information> mirserver: * Output 2: Virtual disconnected
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293637] <information> mirserver: * Output 3: Virtual disconnected
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293641] <information> mirserver: * Output 4: Virtual disconnected
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293645] <information> mirserver: * Output 5: Virtual disconnected
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293649] <information> mirserver: * Output 6: Virtual disconnected
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293654] <information> mirserver: * Output 7: Virtual disconnected
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293659] <information> mirserver: * Output 8: Virtual disconnected
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293702] <information> mirserver: New base display configuration:
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293709] <information> mirserver: * Output 1: Virtual connected, used
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293714] <information> mirserver: . |_ Physical size 0.0" 0x0mm
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293718] <information> mirserver: . |_ Power is on
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293722] <information> mirserver: . |_ Current mode 1280x800 60.00Hz
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293727] <information> mirserver: . |_ Preferred mode 1280x800 60.00Hz
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293731] <information> mirserver: . |_ Orientation normal
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293735] <information> mirserver: . |_ Logical size 1280x800
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293740] <information> mirserver: . |_ Logical position +0+0
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293744] <information> mirserver: . |_ Scaling factor: 1.00
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293748] <information> mirserver: * Output 2: Virtual disconnected
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293752] <information> mirserver: * Output 3: Virtual disconnected
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293756] <information> mirserver: * Output 4: Virtual disconnected
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293760] <information> mirserver: * Output 5: Virtual disconnected
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293905] <information> mirserver: * Output 6: Virtual disconnected
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293913] <information> mirserver: * Output 7: Virtual disconnected
2019-12-12T02:32:24Z mir-kiosk.daemon[10196]: [2019-12-12 02:32:24.293917] <information> mirserver: * Output 8: Virtual disconnected

And my reproducing step look like:
image

Another thing I want to say: I setup the machine with vmware fusion. I do not know if this is related to black screen.

1.

I test the another snap application: chromium-mir-kiosk. When I install / connect / restart it, I see the screen which looks like below:

All looks very good, but when I click the menu in the kiosk screen the screen goes into black. I get the kiosk and app log:

From the log I find the error in chromium-mir-kiosk when I click the page. The details logs like below:

2019-12-12T03:58:02Z chromium-mir-kiosk.chromium-mir-kiosk[18670]: context mismatch in svga_sampler_view_destroy
2019-12-12T03:58:02Z chromium-mir-kiosk.chromium-mir-kiosk[18670]: context mismatch in svga_sampler_view_destroy
2019-12-12T03:58:02Z chromium-mir-kiosk.chromium-mir-kiosk[18670]: context mismatch in svga_sampler_view_destroy
2019-12-12T03:58:02Z chromium-mir-kiosk.chromium-mir-kiosk[18670]: ALSA lib conf.c:3750:(snd_config_update_r) Cannot access file /usr/share/alsa/alsa.conf
2019-12-12T03:58:02Z chromium-mir-kiosk.chromium-mir-kiosk[18670]: ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM default
2019-12-12T03:58:02Z chromium-mir-kiosk.chromium-mir-kiosk[18670]: [18831:18854:1211/195802.812794:WARNING:alsa_util.cc(24)] PcmOpen: default,No such file or directory
2019-12-12T03:58:02Z chromium-mir-kiosk.chromium-mir-kiosk[18670]: ALSA lib conf.c:3750:(snd_config_update_r) Cannot access file /usr/share/alsa/alsa.conf
2019-12-12T03:58:02Z chromium-mir-kiosk.chromium-mir-kiosk[18670]: ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM plug:default
2019-12-12T03:58:02Z chromium-mir-kiosk.chromium-mir-kiosk[18670]: [18831:18854:1211/195802.813451:WARNING:alsa_util.cc(24)] PcmOpen: plug:default,No such file or directory
2019-12-12T03:58:03Z chromium-mir-kiosk.chromium-mir-kiosk[18670]: [18831:18842:1211/195803.520069:ERROR:udev_watcher.cc(28)] Failed to initialize a udev monitor.
2019-12-12T03:58:13Z chromium-mir-kiosk.chromium-mir-kiosk[18670]: (EE)
2019-12-12T03:58:13Z chromium-mir-kiosk.chromium-mir-kiosk[18670]: Fatal server error:
2019-12-12T03:58:13Z chromium-mir-kiosk.chromium-mir-kiosk[18670]: (EE) wl_display@1: error 1: invalid arguments for wl_shm@8.create_pool
2019-12-12T03:58:13Z chromium-mir-kiosk.chromium-mir-kiosk[18670]: (EE)
2019-12-12T03:58:13Z chromium-mir-kiosk.chromium-mir-kiosk[18670]: [18856:18856:1211/195813.860478:ERROR:x11_util.cc(103)] X IO error received (X server probably went away)
2019-12-12T03:58:13Z chromium-mir-kiosk.chromium-mir-kiosk[18670]: [18831:18831:1211/195813.867577:ERROR:chrome_browser_main_extra_parts_x11.cc(62)] X IO error received (X server probably went away)
2019-12-12T03:58:13Z chromium-mir-kiosk.chromium-mir-kiosk[18670]: i3: Cannot open display

So What is the problem? What is I should do if want to make successful kiosk?

I’ve tested your website using wpe-webkit-mir-kiosk and mir-kiosk on a “classic” Ubuntu 19.10 Desktop system. It works for me (and ought to work for any “classic” system):

sudo snap install mir-kiosk
sudo snap set mir-kiosk daemon=true
sudo snap restart mir-kiosk
# Orange "splash" & black screen with cursor
sudo snap install --beta wpe-webkit-mir-kiosk
sudo snap connect wpe-webkit-mir-kiosk:wayland
sudo snap set wpe-webkit-mir-kiosk url=https://www.neuralgalaxy.com
# Your site displays and works