Unable to create KVM virtual machine: Host does not support domain type kvm for virtualization type hvm

Written by - 0 comments

Published on - Listed in Linux KVM Hardware Virtualization


On a Debian Stretch (9) test machine, the creation of a KVM virtual machine was throwing the following error:

root@stretch ~ # virt-install --connect qemu:///system --virt-type kvm --hvm -n kvmtest --memory 4096 --vcpus 2 --cdrom /tmp/ubuntu1804.iso --disk /dev/vglxc/kvmtest --network=bridge:virbr0 --graphics vnc,password=foobar,port=5910 --noautoconsole
ERROR    Host does not support domain type kvm for virtualization type 'hvm' arch 'x86_64'

A quick check, if the kvm Kernel module was loaded, showed:

root@stretch ~ # lsmod | grep kvm
kvm                   745472  0
irqbypass              16384  1 kvm

This should show an additional loaded module "kvm_intel" for Intel CPUs or "kvm_amd" for AMD CPUs.
However manual loading of module kvm_amd (this system runs with a AMD Ryzen 1700 processor) did not work:

root@stretch ~ # modprobe kvm_amd
modprobe: ERROR: could not insert 'kvm_amd': Operation not supported

A japanese blog article mentions that virtualization was not enabled in BIOS. dmesg seems to confirm this:

root@stretch ~ # dmesg|grep kvm | tail
[75819.537075] kvm: disabled by bios
[75819.633562] kvm: disabled by bios
[75819.715582] kvm: disabled by bios
[75819.799348] kvm: disabled by bios
[75819.899220] kvm: disabled by bios
[79422.810202] kvm: no hardware support
[79853.617887] kvm: disabled by bios
[80176.188187] kvm: disabled by bios
[80228.848450] kvm: disabled by bios
[80262.517445] kvm: disabled by bios

Verified in BIOS and "SVM Mode" was indeed disabled:

Enable AMD CPU Virtualization SMV in BIOS

After enabling it and booting into Debian again, lsmod finally showed the needed module:

root@stretch ~ # lsmod | grep kvm
kvm_amd               106496  0
kvm                   745472  1 kvm_amd
ccp                    98304  7 kvm_amd
irqbypass              16384  1 kvm

And the creation of the KVM virtual machine finally worked:

root@stretch ~ # virt-install --connect qemu:///system --virt-type kvm -n kvmtest --memory 4096 --vcpus 2 --cdrom /tmp/ubuntu1804.iso --disk /dev/vglxc/kvmtest --network=bridge:virbr0 --graphics vnc,password=foobar,port=5910 --noautoconsole
WARNING  No operating system detected, VM performance may suffer. Specify an OS with --os-variant for optimal results.

Starting install...



Add a comment

Show form to leave a comment

Comments (newest first)

No comments yet.

RSS feed

Blog Tags:

  AWS   Android   Ansible   Apache   Apple   Atlassian   BSD   Backup   Bash   Bluecoat   CMS   Chef   Cloud   Coding   Consul   Containers   CouchDB   DB   DNS   Database   Databases   Docker   ELK   Elasticsearch   Filebeat   FreeBSD   Galera   Git   GlusterFS   Grafana   Graphics   HAProxy   HTML   Hacks   Hardware   Icinga   Influx   Internet   Java   KVM   Kibana   Kodi   Kubernetes   LVM   LXC   Linux   Logstash   Mac   Macintosh   Mail   MariaDB   Minio   MongoDB   Monitoring   Multimedia   MySQL   NFS   Nagios   Network   Nginx   OSSEC   OTRS   Office   PGSQL   PHP   Perl   Personal   PostgreSQL   Postgres   PowerDNS   Proxmox   Proxy   Python   Rancher   Rant   Redis   Roundcube   SSL   Samba   Seafile   Security   Shell   SmartOS   Solaris   Surveillance   Systemd   TLS   Tomcat   Ubuntu   Unix   VMWare   VMware   Varnish   Virtualization   Windows   Wireless   Wordpress   Wyse   ZFS   Zoneminder   


Update cookies preferences