Looking glass iommu / Adding the IVSHMEM Virtual Device / Configuring QEMU

I already have a Windows 10 VM setup using QEMU, and it works just fine, but I am in the process of setuping up looking glass for it and am following the guide here:

https://looking-glass.hostfission.com/quickstart/linux/qemu

however, after adding the following the lines

-device ivshmem-plain,memdev=ivshmem,bus=pcie.0
-object memory-backend-file,id=ivshmem,share=on,mem-path=/dev/shm/looking-glass,size=32

to the .sh file I use to launch QEMU, I am getting the error:

qemu-system-x86_64: -device ivshmem-plain,memdev=ivshmem,bus=pcie.0: Bus ‘pcie.0’ not found

I know the guide says I need to “[adjust] the bus to suit [my] particular configuration”, but I’m not sure exactly how to do that. I’m very new to virtualisation so I’m kind of a noob, and can’t seem to find information on what I need to presumably change “pcie.0” to on the QEMU wiki or on Google.


I 'm not sure how to alter these lines either. I’m guessing I just change “user” to my username?

touch /dev/shm/looking-glass
chown user:kvm /dev/shm/looking-glass
chmod 660 /dev/shm/looking-glass

The rest of the guide seems pretty straightforward, I’m just stuck at this one part.

I had to use pci.0 instead of pcie.0 and it worked fine after that in Fedora 29. You could give that a try

Which distro?

Hey thanks, it works, though I get the following error when launching looking-glass-client on the Linux host (I’m guessing because I still have not created the shared memory file with appropriate permissions.)

[I] main.c:757 | run | Looking Glass ()
[I] main.c:758 | run | Locking Method: Atomic
[I] main.c:751 | try_renderer | Using Renderer: EGL
[I] main.c:824 | run | Using: EGL
[E] main.c:708 | map_memory | Failed to open the shared memory file: /dev/shm/looking-glass
[E] main.c:920 | run | Failed to map memory


I am using Linux Mint 19 Cinnamon, I don’t mind switching to something else if it’s going to be a problem though.

Yes it looks like a permission error from what I can tell.
For me starting the client via sudo worked or (probably better) setting the right permissions.

touch /dev/shm/looking-glass
chown user:kvm /dev/shm/looking-glass
chmod 660 /dev/shm/looking-glass

I had to replace user with my username and had to use group qemu instead of kvm. Looks like this then:

touch /dev/shm/looking-glass
chown username:qemu /dev/shm/looking-glass
chmod 660 /dev/shm/looking-glass