QEmu packaged fine. It’s libvirt and virt-manager that are causing all sorts of problems, because the build environment and execution environment differ with snap - paths change once you run a snap - ie from /root/parts/etc to $SNAP, a dir in /snap
“layout” isn’t always enough to work around that.
I kind of wish snapcraft would install stuff to normal prefix, /usr, /usr/local, etc, and that snap would just overlay the filesystem so the build and run environments don’t differ. For people packaging up their own software, this is a non issue…they wouldn’t ever hardcode compile-time path discovery information into code as macros…it seems insane…thats what config files are for…
I’m giving up
Here’s what I have, libvirtd, virsh, qemu, etc function. At the bottom I started pasting together a script to build a python venv since the python plugin won’t work for this. I’d have to probably use the dump plugin and manual build scripts. Even if I get it working, it’s going to be days of fighting with virt-manager, the same fight I had with libvirt, because it expects that the build and run environments are identical.
If anyone else wants to pick it up, feel free! It pains me to drop this, it would have been really cool to be able to easily install the latest versions of the libvirt + qemu + virtmanager suite across different distros.
Edit: I made one more push
It’s all building. The python plugin gets negatively impacted if parts prior pull in python dependencies. Complains about not being able to find pip, coreutils, etc. So I did it with dump and script overrides, set up a venv.
Ultimately, virt-manager fails to run
ylanetaft@dylanetaft-Z170X-UD5:~/virtpackage$ snap run virtpackage.virt-manager --debug
[Mon, 01 Jul 2019 00:42:15 virt-manager 21148] DEBUG (cli:205) Launched with command line: /opt/virtmanager/share/virt-manager/virt-manager --debug
[Mon, 01 Jul 2019 00:42:15 virt-manager 21148] DEBUG (virt-manager:223) virt-manager version: 2.2.0
[Mon, 01 Jul 2019 00:42:15 virt-manager 21148] DEBUG (virt-manager:224) virtManager import: <module ‘virtManager’ from ‘/opt/virtmanager/share/virt-manager/virtManager/init.py’>
(virt-manager:21148): Gtk-WARNING **: 00:42:15.104: Locale not supported by C library.
Using the fallback ‘C’ locale.
[Mon, 01 Jul 2019 00:42:15 virt-manager 21148] DEBUG (virt-manager:274) PyGObject version: 3.32.2
[Mon, 01 Jul 2019 00:42:15 virt-manager 21148] DEBUG (virt-manager:278) GTK version: 3.22.30
GLib-GIO-Message: 00:42:15.141: Using the ‘memory’ GSettings backend. Your settings will not be saved or shared with other applications.
(virt-manager:21148): GdkPixbuf-WARNING **: 00:42:15.141: Cannot open pixbuf loader module file ‘/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache’: No such file or directory
This likely means that your installation is broken.
Try running the command
gdk-pixbuf-query-loaders > /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache
to make things work again for the time being.
[Mon, 01 Jul 2019 00:42:15 virt-manager 21148] DEBUG (systray:213) Showing systray: False
[Mon, 01 Jul 2019 00:42:15 virt-manager 21148] DEBUG (inspection:41) python guestfs is not installed
[Mon, 01 Jul 2019 00:42:15 virt-manager 21148] DEBUG (engine:113) No stored URIs found.
[Mon, 01 Jul 2019 00:42:15 virt-manager 21148] DEBUG (engine:537) processing cli command uri= show_window=manager domain=
[Mon, 01 Jul 2019 00:42:15 virt-manager 21148] DEBUG (engine:539) No cli action requested, launching default window
Fontconfig warning: “/etc/fonts/fonts.conf”, line 5: unknown element “its:rules”
Fontconfig warning: “/etc/fonts/fonts.conf”, line 6: unknown element “its:translateRule”
Fontconfig error: “/etc/fonts/fonts.conf”, line 6: invalid attribute ‘translate’
…
(virt-manager:21148): GdkPixbuf-WARNING **: 00:42:15.209: Cannot open pixbuf loader module file ‘/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache’: No such file or directory
This likely means that your installation is broken.
Try running the command
gdk-pixbuf-query-loaders > /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache
to make things work again for the time being.
(virt-manager:21148): Gtk-WARNING **: 00:42:15.209: Could not load a pixbuf from icon theme.
This may indicate that pixbuf loaders or the mime database could not be found.
Surprise surprise…more compiled apps expecting things in /usr/lib and not $SNAP/usr/lib
You can’t really use layout to redirect /usr/lib without breaking snappy too.
Even if I get this working…it’s ugly.
MAYBE I could avoid using the autotools plugin for at least libvirt, feed the configure script a prefix of /opt and redirect the subdirectory there, to make the later things dependent on it less hacky…that mount -o bind…wow.
Fontconfig and GTK-related libs aren’t happy with me though.