I am in the unenviable position of taking an existing Java Swing app and converting it into a kiosk application on an ubuntu 16 desktop. I reviewed the ubuntu kiosk docs: https://ubuntu.com/tutorials/secure-ubuntu-kiosk#2-basic-infrastructure
It looks like I need to convert the Java into a snap and use Case #2 (To enable these applications we will embed a tiny X11 server into your application package, which translates X11 calls to Wayland ones.)
I’ve spent some time on this and have gotten the snap to run using the mir-kios-snap-launch example. But I’m getting:
Java.io.IOException: Cannot run program “/usr/bin/xprop”: error=2, No such file or directory.
I assume it’s because I have not managed to get the X11 server configured correctly.
If there’s any examples or anything I would appreciate any help on this.
It isn’t down to the way you’ve configured X, but because something in Java is trying to run /usr/bin/xprop and that’s not something that should be done in a confined snap (because programs from the snap are elsewhere, e.g. $SNAP/usr/bin/xprop.
But I don’t know how to change what your Java application is doing.
that’s what I’m about to look at. It spends alot of time with egmde and I wasn’t sure if that was production level or I should stick with the mir-kiosk
I spent some time refactoring playing with the examples. Right now I’m getting the following error starting my Java program. I hope the error is maybe I’m on a VM? Weird drivers, etc and I hope it will disappear on the deployment HW(It’s also Ubuntu 16 )
[2021-05-25 14:18:13.835038] mirserver: Starting
[2021-05-25 14:18:13.838580] < - debug - > mirserver: Not trying logind: “DISPLAY” is set and X need not have claimed the VT
[2021-05-25 14:18:13.838807] < - debug - > mirserver: Not using Linux VT subsystem for session management: Failed to find the current VT
[2021-05-25 14:18:13.838836] < - debug - > mirserver: No session management supported
[2021-05-25 14:18:13.841468] VT switch key handler: No VT switching support available: MinimalConsoleServices does not support VT switching
[2021-05-25 14:18:13.841701] mircommon: Loading modules from: /snap/mpcad/x1/usr/lib/x86_64-linux-gnu/mir/server-platform
[2021-05-25 14:18:13.841761] mircommon: Loading module: /snap/mpcad/x1/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-wayland.so.19
[2021-05-25 14:18:13.841806] mirserver: Found graphics driver: mir:wayland (version 2.3.3) Support priority: 256
[2021-05-25 14:18:13.841823] mirserver: Selected driver: mir:wayland (version 2.3.3)
ERROR: /build/mir-ugCfbK/mir-2.3.3/src/server/graphics/default_configuration.cpp(136): Throw in function mir::DefaultServerConfiguration::the_graphics_platform()::<lambda()>
Dynamic exception type: boost::wrapexcept<std:: runtime_error>
std::exception::what: Exception while creating graphics platform
ERROR: /build/mir-ugCfbK/mir-2.3.3/src/platforms/wayland/platform.cpp(40): Throw in function mir::graphics::wayland::Platform::Platform(wl_display*, const std::shared_ptr<mir:: graphics::DisplayReport>&)
Dynamic exception type: boost::wrapexcept<std:: system_error>
std::exception::what: Failed to connect to wayland: EGL_SUCCESS (0x3000)