Unable to run Looking Glass on Linux host

I’m trying to run Looking Glass B2. The first hurdle was compiling it, as the instructions neglected to mention that gcc needed to be installed. After installing gcc, the instructions worked and I was able to build it. Now I’m having trouble running it.

If I run looking-glass-client directly on my Fedora Silverblue 33 host, I get the following output:

looking-glass-client: error while loading shared libraries: libSDL2_ttf-2.0.so.0: cannot open shared object file: No such file or directory

It’s like it wants SDL installed or something? On my distro, the normal way to install and run custom software that isn’t packaged as a Flatpak, is to run it within a Fedora Toolbox. I already used a Toolbox to compile it, so I went back in and attempted to run looking-glass-client from within the Toolbox this time:

18936212315 [I] main.c:1675 | main | Looking Glass (B2-0-g76710ef201)
18936212333 [I] main.c:1676 | main | Locking Method: Atomic
18936212775 [I] main.c:1222 | lg_run | Wayland detected
18936212781 [I] main.c:1231 | lg_run | SDL_VIDEODRIVER has been set to wayland
18936213631 [I] ivshmem.c:180 | ivshmemOpenDev | KVMFR Device : /dev/shm/looking-glass
18936213641 [E] ivshmem.c:227 | ivshmemOpenDev | Failed to open: /dev/shm/looking-glass
18936213644 [E] main.c:1249 | lg_run | Failed to map memory

Now I’m stuck and don’t know what to do. It says it failed to open /dev/shm/looking-glass and failed to map memory. I’ve verified that the filepath exists.

I then attempted to run looking-glass-client via sudo, in case it was a permissions issue. But this just returns an error saying “Do not run looking glass as root!” despite it not being a “real” root as it’s in a Toolbox.

Could anyone help me out here? Thanks.

1 Like

I don’t use Fedora nor Flatpak, but first thing I would check is permission of shm device:

[misiek@mykomp ~]$ ls -la /dev/shm/looking-glass
-rw-rw---- 1 misiek kvm 0 12-23 22:26 /dev/shm/looking-glass

Or just install SDL libraries with yum or something… Because there may be some isolation layer between flatpak and os.

BTW. I have no idea, how did you managed to successfully compile program without libraries that are needed to run it… Usually dev libraries automatically install runtimes.

I don’t know much about silverblue or looking glass, but I have heard you can also install packages directly into host image in silverblue.

I did a quick google and found this official doc link.

https://docs.fedoraproject.org/en-US/fedora-silverblue/getting-started/#package-layering

Hope this helps.

Looking Glass ram file you need to make sure is the correct user / group.

I had to make it myusername:libvirt-qemu for the group. With the command chown.

I made a quick storage device (qcow2) on my VM. To see what the user group actually was. And it returned libvirt-qemu.

You could give that a try and see the group with ls -l just to see what the group your VM runs in.

Edit: Re-reading your error it looks like the file was not created and the proper permission was not set.

The looking glass wiki says you need to create a file and set the permission on each startup of your machine. So to make a script that runs on each startup.

This is my startup script for LookingGlass:

My bash script to make the file and set the user / permission was:
touch /dev/shm/looking-glass
chown myusername:libvirt-qemu /dev/shm/looking-glass
chmod 660 /dev/shm/looking-glass