cockpit-project / cockpit

Cockpit is a web-based graphical interface for servers.
http://www.cockpit-project.org/
GNU Lesser General Public License v2.1
11.07k stars 1.1k forks source link

[Bug] Failed to get emulator capabilities #20387

Closed cookiengineer closed 2 months ago

cookiengineer commented 5 months ago

Explain what happens

  1. Install cockpit on Arch Linux (extra/cockpit and extra/cockpit-machines)
  2. Start libvirtd service and cockpit service
  3. Get error error: failed to connect to the hypervisor error: authentication unavailable: no polkit agent available to authenticate action 'org.libvirt.unix.manage'
  4. Fix the polkit error and create /etc/polkit-1/50-libvirt.rules file with the content below.
  5. Restart host machine, restart services, go to http://127.0.0.1:9090/machines#/vms
  6. Select administrative mode (cause you think it might be the problem), authenticate without any error
  7. Create new virtual machine with following parameters:
  8. Name: "debian", Connection: "System", Installation Type: "Download an OS", Operating System: "Debian 12 (bookworm)" and Storage, Storage Limit and Memory are default (qcow2, 10GiB, 1GiB)
  9. "Create and Run" and "Create and edit" both lead to the following error:
error: failed to get emulator capabilities error: unsupported configuration: unable to find any emulator to serve '(null)' architecture

How do I fix the described error?

I'm not sure what to do next, because it seems that some command is missing the amd64 or similar parameter in the exec call.

Attachments (changed files):

/etc/polkit-1/50-libvirt.rules:

polkit.addRule(function(action, subject) {
    if (action.id == "org.libvirt.unix.manage" && subject.isInGroup("wheel") {
        return polkit.Result.YES;
    }
});

Version of Cockpit

315-2

Where is the problem in Cockpit?

Unknown or not applicable

Server operating system

None

Server operating system version

Arch Linux (updated 2024-04-27)

What browsers are you using?

Firefox, Chrome

System log

(journalctl contains no PAM errors, and no authentication errors)
cookiengineer commented 5 months ago

After the installation of qemu-base as an emulator, there's also the following error for local ISO installations, which I cannot fix.

So far only the Debian image installation (auto-download) worked, but I haven't figured out how to correctly configure it into bridging mode.

The error I keep getting, no matter where the ISO file is located, and no matter which kind of chmod group/all access is set, is the following. Even when setting 0666 to the file and for testing putting it into /tmp or /opt, it doesn't make a difference for whatever reason.

How can I debug this further to find out what's causing this fd / file open error?

ERROR internal error: process exited while connecting to monitor: 2024-04-28T06:25:42.582723Z qemu-system-x86_64: -blockdev {"driver":"file","filename":"/home/cookiengineer/Downloads/OS Images/trisquel-netinst_11.0_amd64.iso","node-name":"libvirt-1-storage","read-only":true}: Could not open '/home/cookiengineer/Downloads/OS Images/trisquel-netinst_11.0_amd64.iso': Permission denied Domain installation does not appear to have been successful. If it was, you can restart your domain by running: virsh --connect qemu:///system start trisquel otherwise, please restart your installation.
jelly commented 5 months ago

Get error error: failed to connect to the hypervisor error: authentication unavailable: no polkit agent available to authenticate action 'org.libvirt.unix.manage' Fix the polkit error and create /etc/polkit-1/50-libvirt.rules file with the content below.

This is provided by the libvirt package:

[jelle@t14s][~/projects/cockpit-bots]%pacman -F 50-libvirt.rules
extra/libvirt 1:10.2.0-1 [installed]
    usr/share/polkit-1/rules.d/50-libvirt.rules

And then I would recommend installing extra/qemu-desktop

jelly commented 2 months ago

Closing this issue as there was no response.