Return to Level1Techs.com

Looking Glass SHM permissions

I’m trying to figure out howto configure my Linux box so I could run looking glass without elevating user privileges.
Currently when VM starts it creates a file in /dev/shm with following ones:

-rw-r–r-- 1 qemu qemu 33554432 07-21 14:40 looking-glass

Which is a problem - as it means that even if a user is in a member of qemu it won’t help as the write permissions for group are missing. How do I change it?
Manually changing the permissions to the file each time seem a bit wrong :wink: . What is correct way to handle this?

I’m going to tag @gnif

When he has some time, he can probably help you out with this specific question.

RTFM. The Installation Guide clearly states:

It is suggested that you create the shared memory file before starting the VM with the appropriate permissions for your system, this only needs to be done once at boot time

Depending on your Linux distro, there are facilities to do that at boot time. If you run a distro with systemd, the tmpfiles facility can take care of this for you. I have a file “/etc/tmpfiles.d/10-looking-glass.conf” that contains:

#Type Path Mode UID GID Age Argument
f /dev/shm/looking-glass 0660 qemu kvm -

This creates the SHM file with the proper ownership and permissions during boot. Adjust to your needs…

2 Likes