Hi, I’m trying to follow the tutorial to snap the hello world Electron app. It worked fine up to step 3 (got the Electron app running on Ubuntu Classic), but after step 4 (convert into a kiosk app) the snap won’t run on either Ubuntu Classic (on my desktop) or Ubuntu Core (an armhf build running on a
Raspberry Pi 3).
On Ubuntu Classic the issue seems to be that it can’t find a Wayland socket, but the suggested fix for this doesn’t seem to work. One thing that isn’t clear to me from the tutorial is whether on Ubuntu Classic miral-kiosk and the electron-hello-world-kiosk apps should be running as root or my user, but no combination seems to work.
If I run the electron app as my user I get:
/snap/electron-hello-world-kiosk/x2/bin/xwayland-kiosk-launch: line 117: /var/snap/electron-hello-world-kiosk/x2/i3.config: Permission denied
and if I run it with sudo I get:
Error: Unable to find a valid Wayland socket in /run/user/0
On Ubuntu Core if I run it as my user I get:
Error: Unable to find a valid Wayland socket in /run/user/1000
Is a Wayland server running?
You could try running as root
and if I run it with sudo I get:
[18706:0720/112140.582507:FATAL:atom_main_delegate.cc(194)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
/snap/electron-hello-world-kiosk/x1/bin/xwayland-kiosk-launch: line 151: 18706 Trace/breakpoint trap "$@"
/snap/electron-hello-world-kiosk/x1/bin/xwayland-kiosk-launch: line 1: kill: (-18140) - No such process
I’m wondering if there’s some mismatch of user id between the Wayland socket and the Electron snap, but I’m a bit lost to be honest.
Hmm, I don’t think I have the mir-kiosk snap installed on desktop. I followed the instructions in the Wayland kiosk tutorial which the X11 kiosk and Electron kiosk tutorials build upon. That includes installing these apt packages:
By the time you’ve made it through those three tutorials it’s all quite confusing so I wouldn’t be surprised if I’m doing something wrong. It would be easier to follow if the Electron kiosk tutorial just stood alone and only covered the steps needed for an Electron kiosk.
This isn’t a huge problem for me because I have two monitors plugged into my desktop PC.
Thanks very much for filing that @ogra. The updated tutorial doesn’t seem to have landed on tutorials.ubuntu.com yet, but following the updates that were made in the PR I was able to get this to work.
Side note: I do feel I need to dig a bit more into the security implications of Electron running as root with Chromium’s sandbox turned off as that seems like a problem for the real application I want to snap!
This should not be any problem given you are running under snap confinement. The kernel will take care of your security via apparmor, seccomp filtering, cgroups and namespaces. All you have done is to drop a duplicate sandbox running inside another one. If you run on core in some kind of appliance image you typically wont even have a user on the system anyway.
Looking for a bit more help. I have just included the layout and the parts involved.
Basically, I am trying to build pygame. It needs the sdl2-config file which it tries to find in /usr/bin/sdl2-config. So, what I tried to do is add a layout to bind the file. Nonetheless, it fails to find the file.
What I think might be possible issues:
The layout is applied after the all the part is built ?
Or stage-packages happens after python-packages ?
The config file from pygame cannot use the binding for some reason.
Do u think any of these are reasonable ? And any suggestion ? Thanks in advance!
@Saviq: I don’t suppose you have any advice on how this example might be made to work as the snap_daemon user rather than root, as I’m being asked to do in order to pass snap store review here? Are you aware of anyone getting xwayland-kiosk-launch to run as a non-root user?