Creating VM's using kvm. Error: Unit libvirtd.service could not be found?

10,877

sudo apt install libvirt-daemon-system resolved the libvirtd.service issue as pointed by @ajgringo619

Share:
10,877
samshers
Author by

samshers

Updated on September 18, 2022

Comments

  • samshers
    samshers over 1 year

    TLDR;
    On Ubuntu 20.04.1, I am trying to run VM's using KVM. After installing the required packages, I still get below error:

    sudo systemctl status libvirtd
    Unit libvirtd.service could not be found.  
    

    The below is what I have done -
    a) check kvm support

    $ sudo kvm-ok
    INFO: /dev/kvm exists
    KVM acceleration can be used
    

    b) install required packages

    $ sudo apt install -y qemu qemu-kvm libvirt-daemon libvirt-clients bridge-utils virt-manager
    

    Now, the above should be everything and I must be able to open the virt-manager gui and get going and the libvertd service should have been started already. But, there is no libvirtd service running on my machine still and there is no libvirtd.service unit installed.

    And obviously, The virt-manager is not able to connect to the demon so the below errors - After doing $ sudo virt-manager --> the virt-manager GUI starts with root permissions.
    enter image description here
    Clearly the window says -

    The libvirtd service does not appear to be installed. Install and run the libvirtd service to manage virtualization on this host.

    And obviously, no VM creation is feasible and below is the error on attempting for same.
    enter image description here

    Reference - How to Install KVM on Ubuntu 20.04
    Note: This issue is not duplicate with - KVM Virt-Manager Error: No active connection to Install on
    (one answer here ask to install - libvirt-bin , but this packages does not exist in the repo.

    $ apt list  libvirt-bin    
    Listing... Done
    

    Hardware: This attempt is on Quad-Core, Intel CPU Laptop.

    Edit - Following the comment from ajgringo619, i could solve the libvirtd.service issue. But other issues still persist.
    Below is also posted as seperate Q @ Warning: KVM kernal modules are not loaded. Your VM may perform poorly?
    enter image description here
    This is the lsmod output -

    $ sudo lsmod | grep kvm
    kvm_intel             282624  0
    kvm                   663552  1 kvm_intel
    

    Should I ignore the warning, is the performance really gonna be poor??

    • ajgringo619
      ajgringo619 over 3 years
      Did the libvirt-daemon-system package get installed?
    • samshers
      samshers over 3 years
      no, it is not. I installed it and got past the libvirtd.service issue. But new issues are rising. Editing the Q with new issues.
    • Stephen Kitt
      Stephen Kitt over 3 years
      Instead of editing your question to add your follow-up, which you’ve also asked as a separate question, would you mind posting the resolution as an answer?
    • ajgringo619
      ajgringo619 over 3 years
      Your "kvm not loaded" link is broken.
    • samshers
      samshers over 3 years
      @ajgringo619, thx for pointing. Fixed the broken link.
    • ajgringo619
      ajgringo619 over 3 years
      What groups is your user a member of? Did you reboot after the install?
    • samshers
      samshers over 3 years
      @ajgringo619, adm cdrom sudo dip plugdev lpadmin lxd sambashare vboxusers libvirt is there still anything to worry about.
    • samshers
      samshers over 3 years
      @ajgringo619, yeah, I rebooted. and the issue of KVM not available is solved. But I don't get USB devices or Web Cam in the VM.
    • ajgringo619
      ajgringo619 over 3 years
      That should be asked as a new question; you'll get better and more focused responses.