Hardware virtualization doesn't work

Discussions related to using VirtualBox on Windows hosts.
Post Reply
chart41
Posts: 5
Joined: 18. Apr 2022, 11:19

Hardware virtualization doesn't work

Post 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?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Hardware virtualization doesn't work

Post 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.
chart41
Posts: 5
Joined: 18. Apr 2022, 11:19

Re: Hardware virtualization doesn't work

Post 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?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Hardware virtualization doesn't work

Post 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.
chart41
Posts: 5
Joined: 18. Apr 2022, 11:19

Re: Hardware virtualization doesn't work

Post 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.
chart41
Posts: 5
Joined: 18. Apr 2022, 11:19

Re: Hardware virtualization doesn't work

Post 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?
Last edited by chart41 on 18. Apr 2022, 12:53, edited 1 time in total.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Hardware virtualization doesn't work

Post 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.
fth0
Volunteer
Posts: 5690
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Hardware virtualization doesn't work

Post 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.
fth0
Volunteer
Posts: 5690
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Hardware virtualization doesn't work

Post 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. ;)
chart41
Posts: 5
Joined: 18. Apr 2022, 11:19

Re: Hardware virtualization doesn't work

Post 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.
Post Reply