Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Hard to understand failure when running in a VM without nested virtualization #4080

Open
cfergeau opened this issue Mar 20, 2024 · 5 comments
Labels
kind/bug Something isn't working os/windows size/M

Comments

@cfergeau
Copy link
Contributor

General information

  • OS: Windows 11
  • Hypervisor: Hyper-V
  • Did you run crc setup before starting it ? yes
  • Running CRC on: VM

CRC version

2.33

I installed crc with the MSI installer, then ran crc setup, and crc start fails with Failed to start the virtual machine 'crc' because one of the Hyper-V components is not running.
I'm running this Windows in a VM on a linux host (libvirt/qemu/rhel9), and after investigating, I realized I forgot to enable nested virt for this VM. While nested virtualization is unsupported, I'd still expect that some preflight check would catch that this host is not virtualization-capable, and that hyper-v is not fully running.

@gbraad
Copy link
Contributor

gbraad commented Mar 25, 2024

I do not believe it was easy to detect this from a regular user. Please, prove me wrong.

@cfergeau
Copy link
Contributor Author

Not planning to dig a lot here, as running crc in VMs is not something we support. However, this particular bug would be similar to running crc on physical hardware without virtualization support (ie lack of the vmx flag in /proc/cpuinfo in a linux VM). I think this specific situation should be possible to detect.

@gbraad
Copy link
Contributor

gbraad commented Mar 25, 2024

this specific situation should be possible to detect.

Right, but this needs (needed?) Administrator privileges. That is not something we want to be asked for during a pre-flight. Note: this might have changed, and would like this to be investigated. Though that was the reason this was not done before.

@anjannath
Copy link
Member

looked at this a bit today, seems there's no way to find detailed processor capabilities like on linux.

and the generic cpu info provided by win32_processor class doesn't provide correct information, in the below screenshot the values of virtualizationFirmwareEnabled and VMMonitorModeExtensions are always reported False when running in a VM irrespective of if nested virtualization is enabled or not (i only tested this in a VM no win baremetal)

Screenshot_win11_2024-03-26_15:21:47

using powershell cmdlet Get-ComputerInfo also doesn't provide the virtualization related information, (even when run with admin privileges)

Screenshot_win11_2024-03-26_15:20:26

@cfergeau
Copy link
Contributor Author

This does not have to be a processor flag check, this could also be available at a higher level, for example hyper-v saying if hardware virtualization is supported or not.
Processor flags may be different between amd and intel, they'll be different on arm, so it's not a perfect solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working os/windows size/M
Projects
None yet
Development

No branches or pull requests

3 participants