Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[SOLVED] Buster: virt-manager - KVM is not available.

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
boredazfcuk
Posts: 6
Joined: 2019-07-02 18:50

[SOLVED] Buster: virt-manager - KVM is not available.

#1 Post by boredazfcuk »

Hey everyone,

I've installed Buster on a machine I put together at the weekend after my main box's SSD was killed by hot weather.

Virtualisation is enabled in BIOS (CPU supports VT-x, VT-d & EPT) and installed qemu-kvm, libvirt-daemon, libvirt-clients and virt-manager, but when I try and create a new VM in virt-manger I get a message saying:

Code: Select all

Warning: KVM is not available. This may mean the KVM package is not installed, or the KVM kernel modules are not loaded. Your virtual machines may perform poorly.
If I run lsmod | grep kvm I get:
kvm_intel 245760 0
kvm 724992 1 kvm_intel
irqbypass 16384 1 kvm
so it looks like the modules are loaded ok.

After I create a VM, the Hypervisor shown in the VM's config as QEMU TCG instead of KVM.

If I run kvm from a terminal window it fires up and attempts to PXE boot.

I created a live CD of Ubuntu 19, installed everything and it worked straight away.

Does anyone have kvm and virt-manager working correctly under Buster?

Thanks,

bored
Last edited by boredazfcuk on 2019-07-07 13:00, edited 1 time in total.

User avatar
4D696B65
Site admin
Site admin
Posts: 2696
Joined: 2009-06-28 06:09
Been thanked: 85 times

Re: Buster: virt-manager - KVM is not available.

#2 Post by 4D696B65 »


boredazfcuk
Posts: 6
Joined: 2019-07-02 18:50

Re: Buster: virt-manager - KVM is not available.

#3 Post by boredazfcuk »

Hi,

Thanks for the link but it doesn't address my issue.

I have it working on my Stretch server and it took 20mins to configure and get a VM up and running on the same hardware using an Ubuntu Desktop 19 Live USB.

Code: Select all

root@Server:/root> apt install qemu-kvm libvirt-clients libvirt-daemon-system
Reading package lists... Done
Building dependency tree
Reading state information... Done
libvirt-clients is already the newest version (5.0.0-4).
libvirt-daemon-system is already the newest version (5.0.0-4).
qemu-kvm is already the newest version (1:3.1+dfsg-8~deb10u1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Code: Select all

root@Server:/root> virt-install --connect qemu:///system --name TestBox --virt-type kvm --ram 2048 --vcpus 2 \
--disk path=./TestBox.qcow2,format=qcow2,bus=IDE,cache=none \
--vnc --os-type=windows --os-variant=win2k12 \
--noautoconsole --accelerate --noapic --keymap=en-gb

ERROR    Host does not support domain type kvm for virtualisation type 'hvm' arch 'x86_64'

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Buster: virt-manager - KVM is not available.

#4 Post by Head_on_a_Stick »

boredazfcuk wrote:Does anyone have kvm and virt-manager working correctly under Buster?
I don't use virt-manager but QEMU/KVM works just fine in my buster system, I use it all the time.

Just to be sure:

Code: Select all

E485:~$ cat $(which kvm)          
#! /bin/sh
exec qemu-system-x86_64 -enable-kvm "$@"
E485:~$
The qemu-kvm package is just a wrapper script.

Have you installed the microcode package for your CPU? I don't know if that will make a difference but it's the only thing I can think of.
deadbang

boredazfcuk
Posts: 6
Joined: 2019-07-02 18:50

Re: Buster: virt-manager - KVM is not available.

#5 Post by boredazfcuk »

Code: Select all

root@Server:~> dpkg -l *microcode*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name            Version      Architecture Description
+++-===============-============-============-===========================================
ii  amd64-microcode 3.20181128.1 amd64        Processor microcode firmware for AMD CPUs
ii  intel-microcode 3.20190618.1 amd64        Processor microcode firmware for Intel CPUs
un  microcode.ctl   <none>       <none>       (no description available)
Looks like the microcode is installed OK.

Code: Select all

root@Server:~> virt-host-validate
  QEMU: Checking for hardware virtualization                                 : PASS
  QEMU: Checking if device /dev/kvm exists                                   : PASS
  QEMU: Checking if device /dev/kvm is accessible                            : PASS
  QEMU: Checking if device /dev/vhost-net exists                             : PASS
  QEMU: Checking if device /dev/net/tun exists                               : PASS
  QEMU: Checking for cgroup 'cpu' controller support                         : PASS
  QEMU: Checking for cgroup 'cpuacct' controller support                     : PASS
  QEMU: Checking for cgroup 'cpuset' controller support                      : PASS
  QEMU: Checking for cgroup 'memory' controller support                      : PASS
  QEMU: Checking for cgroup 'devices' controller support                     : PASS
  QEMU: Checking for cgroup 'blkio' controller support                       : PASS
  QEMU: Checking for device assignment IOMMU support                         : PASS
  QEMU: Checking if IOMMU is enabled by kernel                               : PASS
Everything looks good from a host perspective.
(Edit: Previous list from wrong server, new server does have IOMMU)

Code: Select all

root@Server:~> cat $(which kvm)
#! /bin/sh
exec qemu-system-x86_64 -enable-kvm "$@"
When I run that in a gui terminal, it loads up and attempts to PXE boot.

Everything seems to be pointing to virt-manager failing its check.

boredazfcuk
Posts: 6
Joined: 2019-07-02 18:50

Re: Buster: virt-manager - KVM is not available.

#6 Post by boredazfcuk »

Code: Select all

#!/bin/bash
APP="virt-manager"
REPO="${APP}/${APP}"
COMMIT=$(curl -sSL "https://api.github.com/repos/${REPO}/commits/master")
HASH=$(echo ${COMMIT} | awk '/sha/{print $4;exit}' FS='[""]')
TEMP=$(mktemp -d)

mkdir -p "${TEMP}/${APP}"

curl -sS -o "${TEMP}/source.tar.gz" -L "https://github.com/${REPO}/archive/${HASH}.tar.gz"
tar xf "${TEMP}/source.tar.gz" -C "${TEMP}/${APP}" --strip-components=1

pushd "${TEMP}/${APP}"
./virt-manager --debug
popd

rm -r "${TEMP}"
I wrote the above script which pulls the latest version of virt-manager from github (2.2.1) and runs it...

Does exactly the same as the version in the Buster repo (2.0.0-3):

Code: Select all

KVM acceleration not available. Using 'QEMU'
:(

CwF
Global Moderator
Global Moderator
Posts: 2638
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 192 times

Re: Buster: virt-manager - KVM is not available.

#7 Post by CwF »

I don't understand your issue so far. I did take a stretch (originally Jessie) hypervisor to buster last May or so and everything checked out. It fired up a vfio assisted vm on one platform and it went in a drawer. I put it in another platform for an all amdgpu test session, updated to current buster (~2 wks ago), did test network control of its vm's now on qxl video (no hardware assist, the multi-amdgpu test failed)..., and those vm's fired up and networked fine...did a bunch other stuff and imaged that disk to a file, and back in drawer went the disk.

So yes, I do, in a drawer! My daily is still stretch, mainly because buster's thunar is broke as far as I'm concerned. My experience shows a working upgrade works, yet does not confirm a fresh install. So, it's in your config somewhere...

boredazfcuk
Posts: 6
Joined: 2019-07-02 18:50

Re: Buster: virt-manager - KVM is not available.

#8 Post by boredazfcuk »

This is a clean Buster install and the libvirt config is vanilla.

The only things I've installed on the host so far is dhcp/dns/nfs/samba and docker. All my other services are in about 12 docker containers.

Code: Select all

root@Server:~> kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used
So kvm is pretty sure it works OK too.

I'll purge libvirt and re-install to see if I can replicate.

boredazfcuk
Posts: 6
Joined: 2019-07-02 18:50

Re: Buster: virt-manager - KVM is not available.

#9 Post by boredazfcuk »

Fixed it.

Basically:

Code: Select all

find /var -name *libvirt*
find /var -name *kvm*
find /var -name *qemu*
find /etc -name *libvirt*
find /etc -name *kvm*
find /etc -name *qemu*
grep -r libvirt /var/*
grep -r kvm /var/*
grep -r qemu /var/*
grep -r libvirt /etc/*
grep -r kvm /etc/*
grep -r qemu /etc/*
rm /dev/kvm
and removed any file, directory or configuration file line that got picked up.

Re-installed and it's now working.

Thanks for your help :)

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Buster: virt-manager - KVM is not available.

#10 Post by Head_on_a_Stick »

Great news, please add [SOLVED] to the thread title to help others who may have this problem.
deadbang

goversr
Posts: 1
Joined: 2021-04-05 09:48

Re: [SOLVED] Buster: virt-manager - KVM is not available.

#11 Post by goversr »

Same problem here. Solved it by executing some apt-get purge actions. Could be easier than find and rm actions

apt-get remove --purge libvirt0 libvirt-daemon-system libvirt-daemon-driver-qemu libvirt-daemon qemu qemu-kvm qemu-system qemu-system-x86 qemu-system-common qemu-user qemu-utils
apt autoremove
apt install qemu-kvm libvirt-clients libvirt-daemon-system

Cause of problem at my system could be that I started from a debian 9 and upgraded to 10 later on.

Post Reply