Page 1 of 1

Hardware virtualization doesn't work

Posted: 18. Apr 2022, 11:26
by chart41
Hello. I have VMS with Ubuntu 18/20 on Virtualbox 6.1 installed on Windows 10.

In cmd systetminfo says:

Code: Select all

Hyper-V Requirements:

                  VM Monitor Mode Extensions: Yes

                  Virtualization Enabled in Firmware: Yes

                  Second Level Address Translation: Yes

                  Data Execution Prevention Available: Yes
In VM's settings/acceleration I tried "Default" and "KVM" options,

but "grep -E 'svm | vmx' /proc/cpuinfo" command (on VM) shows nothing,

and "kvm-ok" says: KVM acceleration can NOT be used

So, how to fix it?

Re: Hardware virtualization doesn't work

Posted: 18. Apr 2022, 11:41
by mpack
chart41 wrote: In VM's settings/acceleration I tried "Default" and "KVM" options,
If you are referring to the Paravirtualization Interface setting then that has nothing to do with hardware virtualization. It refers to what style of API VirtualBox should offer to a modern hypervisor-aware guest OS. Linux guests can use the KVM API, Windows guests (Win8 and later) understand the Hyper-v API. This setting has nothing to do with the presence or not of hardware virtualization, nothing to do with whether the host OS is itself talking to a Hyper-v or KVM or no API, and nothing to do with any CPU feature.

I think what you are after is the Enable Nested VT-x/AMD-v setting on the System|Processor tab, which causes this CPU feature to be reflected into the VM. But be aware: use of anything other that VirtualBox as a nested Hypervisor is not supported. That doesn't mean it won't work, it's just that making it work may not be a high priority.

Re: Hardware virtualization doesn't work

Posted: 18. Apr 2022, 11:58
by chart41
mpack wrote:
chart41 wrote: In VM's settings/acceleration I tried "Default" and "KVM" options,
If you are referring to the Paravirtualization Interface setting then that has nothing to do with hardware virtualization. It refers to what style of API VirtualBox should offer to a modern hypervisor-aware guest OS. Linux guests can use the KVM API, Windows guests (Win8 and later) understand the Hyper-v API. This setting has nothing to do with the presence or not of hardware virtualization, nothing to do with whether the host OS is itself talking to a Hyper-v or KVM or no API, and nothing to do with any CPU feature.

I think what you are after is the Enable Nested VT-x/AMD-v setting on the System|Processor tab, which causes this CPU feature to be reflected into the VM. But be aware: use of anything other than VirtualBox as a nested Hypervisor is not supported. That doesn't mean it won't work, it's just that making it work may not be a high priority.
So, is it impossible to use hardware kvm virtualization in Virtualbox? I should install ubuntu on hardware server instead of this?

Re: Hardware virtualization doesn't work

Posted: 18. Apr 2022, 12:22
by mpack
I believe my second paragraph already answered that.

Also there is no such thing as "hardware KVM". KVM is a piece of Linux software that manages use of VT-x or AMD-v in that OS.

Re: Hardware virtualization doesn't work

Posted: 18. Apr 2022, 12:42
by chart41
mpack wrote: I think what you are after is the Enable Nested VT-x/AMD-v setting on the System|Processor tab, which causes this CPU feature to be reflected into the VM. But be aware: use of anything other than VirtualBox as a nested Hypervisor is not supported. That doesn't mean it won't work, it's just that making it work may not be a high priority.
Fine. I just used 'VBoxManage.exe modifyvm "vm name" --nested-hw-virt on' command and I get vmx lines from linux command (above), and "KVM acceleration can be used" from "kvm-ok" command.

Thanks for answering mpack.

Re: Hardware virtualization doesn't work

Posted: 18. Apr 2022, 12:51
by chart41
But I still don't understand, will be it better with Enabled Nested VT-x/AMD-v setting or not? =)
I install openstack on this VM.
Will be better to use this option, or just use QEMU instead?

Re: Hardware virtualization doesn't work

Posted: 18. Apr 2022, 12:52
by mpack
It isn't a matter of "better". Nested VM is impossible without it, if the nested software relies on VT-x or AMD-v.

I don't understand the question about QEMU.

Re: Hardware virtualization doesn't work

Posted: 18. Apr 2022, 13:04
by fth0
mpack wrote:But be aware: use of anything other that VirtualBox as a nested Hypervisor is not supported.
According to VirtualBox User Manual, section 9.33. Nested Virtualization, KVM is supported.

Re: Hardware virtualization doesn't work

Posted: 18. Apr 2022, 13:09
by fth0
chart41 wrote:Will be better to use this option, or just use QEMU instead?
Your question doesn't make clear what "this option" means.

If you're asking if you should prefer QEMU/KVM over QEMU without KVM, then yes, you should do that for performance reasons.

If you're asking if you should prefer QEMU over OpenStack, than I cannot answer that. ;)

Re: Hardware virtualization doesn't work

Posted: 20. Apr 2022, 09:30
by chart41
Anyway when I tried to create simple VM in openstack, I get critical error with "pause" sign on openstack's VM logo.

I disabled this nested option, and set libvirt config in Openstack to use QEMU instead KVM.

But during VM creating was error in openstack. And ISCSI service in systemctl status shows "failed", and "ConditionDirectoryNotEmpty=|/etc/iscsi/nodes was not met", "ConditionDirectoryNotEmpty=|/sys/class/iscsi_session was not met".

So I just recreated openstack's VM in Virtualbox, and don't use nested option on it.
Creation of Cirros VM inside openstack was succeed.