Return to Level1Techs.com

Looking Glass - Triage

helpdesk
lookingglass

#1584

Hi,

I’m using Ubuntu 18.04 and Virt manager and I am trying to get Looking Glass working.

Initially I was getting a permissions error about Virt manager not being able to access /dev/shm/looking-glass. I added /dev/shm/looking-glass rw, to /etc/apparmor.d/abstractions//libvirt-qemu and now I get a different error when trying to start my Windows VM

unable to set AppArmor profile ‘libvirt-b95cdaf7-974c-4ef4-ba65-4b6e5eaba10f’ for ‘/usr/bin/kvm-spice’: No such file or directory

Per https://www.reddit.com/r/VFIO/comments/8o13i4/cant_start_vm_with_lookingglass_shared_memory I deleted the following files in /etc/apparmor.d/libvirt/

libvirt-b95cdaf7-974c-4ef4-ba65-4b6e5eaba10f

libvirt-b95cdaf7-974c-4ef4-ba65-4b6e5eaba10f.files

but the issue persists. Any pointers on how to resolve this would be appreciated ;p


#1585

The error you have here is unrelated to looking glass and I am not familiar enough with AppArmor to comment on whats going on here, perhaps someone else will be able to help you.

That is indeed late enough. Have you tried adding the VirtIO keyboard?


#1586

In that reddit post someone mentioned to add this instead, try that and restart app armor?

/{dev,run}/shm/looking-glass rw,

#1587

Did you install qemu-kvm?

sudo apt install qemu-kvm


#1588

No, my mouse is type generic ps2 mouse, relative movement and my keyboard is generic ps2. Do I need to add a VirtIO mouse too and how do I do that?


#1589

May need to adjust addresses.

    <input type='mouse' bus='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0e' function='0x0'/>
    </input>
    <input type='keyboard' bus='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0f' function='0x0'/>
    </input>

#1590

Oh, do I add those then delete the PS2 ones?


#1591

You can’t delete the ps2 ones, libvirt will always add them back, so just add these and make sure the drivers install.


#1592

Wait, what drivers? Also do you know how to get sound out of the VM through pulse audio?


#1593

Alright, thanks both gnif and lessaj, got it. The keyboard and mouse are now working fine. Now the only issue that I have right now is how to get sound out of it. Followed option two of this guide but it isn’t working.


#1594

I am glad you got that sorted, however sound support is beyond the scope of this thread as it’s Qemu specific.


#1595

Well time to make a new thread then, thanks for all the help! :smiley:


#1596

I found out where I went wrong I added /dev/shm/looking-glass rw to /etc/apparmor.d/abstractions/libvirt-qemu instead of /dev/shm/looking-glass rw,

I have Looking Glass working now. Still playing around with it’s different options


#1597

Well, I have a bigger issue than sound now. So everything was fine, then I restarted. VM works fine (aside from sound) but now when I run looking glass, it ends up cutting the top bar of the console and part of the bottom. I can’t access anything on the task bar nor can I close anything. Ctrl+C on the open console window to close looking glass works but it still leaves the icon in the task bar and I can’t do anything, can’t even open looking glass again. Like all the windows partially locks up, the only way I can restart is doing sudo reboot -f…


#1598

Sounds like you’re having a GPU lockup/failure. What is the output of dmesg when this occurs?


#1599

Well then, I just tried again and it was fine. Do you have any ideas on what may have happened and how to fix it if it happens again? This kept happing earlier but I guess after some time leaving the computer on it’s fine now?


#1600

I gave my only suggestion, without debug information there is little I can do.


#1601

Ah thanks, didn’t think of checking dmesg when it happened. If it happens again I’ll be sure to add it, now off to fix the sound!


#1602

Oh yeah, there was one other thing that I was meaning to ask you. Is it possible to add more scan codes for keyboards with extra keys? For example, some keyboards have a little scroll bar/wheel that lets you adjust the volume. According to the output in looking glass, scan code 80 is volume up, scan code 81 is volume down, and scan code 7f is mute. Also some keyboards have media keys such as play/pause, stop, forward, and rewind. The scan codes for these are 105, 104, 102, and 103 respectively.


#1603

Perhaps, I have not looked at the spice keyboard code in over a year now. To be honest though you would be better off controlling the volume of your guest in the host under pavucontrol.