LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   "Could not access KVM kernel module" with QEMU on Ubuntu Virtual Machine (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/could-not-access-kvm-kernel-module-with-qemu-on-ubuntu-virtual-machine-4175718659/)

fuzzman 11-10-2022 06:10 PM

"Could not access KVM kernel module" with QEMU on Ubuntu Virtual Machine
 
I am trying to run a program that uses QEMU on an Ubuntu VM in VirtualBox hosted on a Windows 10 computer with an AMD CPU. When I try to run the program it gives me this error:
Code:

Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize kvm: No such file or directory

I've tried a lot of solutions posted online. This one appeared the most promising. However, when I run
Code:

sudo modprobe kvm_amd
it gives me this error:
Code:

modprobe: ERROR: could not insert 'kvm_amd': Operation not supported
Tried to fix that but couldn't find a way to do so. I ran virt-host-validate and got:
Code:

QEMU: Checking for hardware virtualization                                : FAIL (Only emulated CPUs are available, performance will be significantly limited)

  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                    : WARN (Enable 'devices' in kernel Kconfig file or mount/enable cgroup controller in your system)

  QEMU: Checking for cgroup 'blkio' controller support                      : PASS

  QEMU: Checking for device assignment IOMMU support                        : WARN (Unknown if this platform has IOMMU support)

  QEMU: Checking for secure guest support                                    : WARN (Unknown if this platform has Secure Guest support)

Other solutions have suggested messing around with VirtualBox settings, this is what I got from trying those:
https://i.stack.imgur.com/dIkFr.png
https://i.stack.imgur.com/nouCt.png
This hasn't helped fix it. Other solutions mention going to the BIOS to fix it, but since this is a VM there doesn't seem to be a way to do that in VirtualBox.

michaelk 11-12-2022 08:24 AM

VirtualBox 6.1 supports nested virtualization. If you are not running version at least version 6.1 you will need to upgrade.

In vboxmanager settings for your guest select System->Processor and click on the nested VT-x checkbox. If it is greyed out try enabling from the command line as:

vboxmanage modifyvm "guest name" --nested-hw-virt on

fuzzman 11-13-2022 03:10 PM

In my post I have included two images which show my current VBox settings. I have already checked that setting and also manually enabled it via the command line like you said. I also recently updated it to the newest version. It still does not work.


All times are GMT -5. The time now is 11:11 PM.