Virtual Machine Manager wants to inhibit shortcuts

When I launch virt-manager (the same is with virt-viewer) in Ubuntu 24.04 (with Wayland), it opens a dialogue:

Virtual Machine Manager wants to inhibit shortcuts. You can restore shortcuts by pressing Super+Escape.

Deny? Allow?

I click Allow, however, I would like to be this automatic (always granted).

Some people suggested I should grant gnome shortcuts-inhibitor permission with flatpak command, HOWEVER, my virt-manager is installed as a DEB package.

I also tried to use export GTK_USE_PORTAL=0 (in bash), but is still the same.

Does anyone knows a solution for this? I opened a bug/raised a question at various bug trackers (virt-manager’s gnome’s,…) but could get no help. It seems a Gnome/Wayland issue…

1 Like

I did this (for virt-viewer), and it is still the same. Actually, I made a mistake, I want to use virt-viewer, I launch it as startup app to automatically run the virtual machine.

So, I did this:

busctl --user call \
   org.freedesktop.impl.portal.PermissionStore \
   /org/freedesktop/impl/portal/PermissionStore \
   org.freedesktop.impl.portal.PermissionStore \
   SetPermission sbssas gnome 0 shortcuts-inhibitor \
   virt-viewer.desktop 1 GRANTED

…and I still get this notification…

Hmm, did this (for APP in… command) , but it is the same (still asking the same question)…

However, if I run remote-viewer - f spice:/localhost:5900, it works.

Weird.

Could be. However, it seems that virt-viewer and remote-viewer are two different apps.

So granting right for remote-viewer wont grant right to virt-viewer too…

It looks like you need to create a launcher to start the app:

mkdir -p ~/.local/share/applications
tee ~/.local/share/applications/virt-viewer.desktop << EOF > /dev/null
[Desktop Entry]
Type=Application
Name=Virtual Machine Viewer
Categories=RemoteAccess;
Icon=virt-viewer
Exec=virt-viewer
EOF

for APP in virt-manager.desktop \
    virt-viewer.desktop remote-viewer.desktop
do busctl --user call \
    org.freedesktop.impl.portal.PermissionStore \
    /org/freedesktop/impl/portal/PermissionStore \
    org.freedesktop.impl.portal.PermissionStore \
    SetPermission sbssas gnome 0 shortcuts-inhibitor \
    ${APP} 1 GRANTED
done