crc
crc copied to clipboard
[BUG] Hard to understand failure when running in a VM without nested virtualization
General information
- OS: Windows 11
- Hypervisor: Hyper-V
- Did you run
crc setupbefore 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.
I do not believe it was easy to detect this from a regular user. Please, prove me wrong.
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.
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.
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)
using powershell cmdlet Get-ComputerInfo also doesn't provide the virtualization related information, (even when run with admin privileges)
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.