tandasat / Hypervisor-101-in-Rust

The materials of "Hypervisor 101 in Rust", a one-day long course, to quickly learn hardware-assisted virtualization technology and its application for high-performance fuzzing on Intel/AMD processors.
https://tandasat.github.io/Hypervisor-101-in-Rust/
MIT License
982 stars 66 forks source link

On Windows, the provided VMware VM cannot be started when Hyper-V is enabled #7

Open tandasat opened 1 year ago

tandasat commented 1 year ago

On Windows, the provided VMware VM cannot be started when Hyper-V is enabled, which is almost always the case. This issue describes workaround for it.

The issue exists because the provided VMware VM requires nested virtualization to be enabled, which is not possible when Hyper-V is enabled on the host.

Here are two workaround:

  1. Disable Hyper-V when running VMware, and re-enable it when building the project.
  2. Disable Hyper-V indefinitely and work on WSL version 1 Ubuntu.

About (1)

It is good for trial.

Run this command in the administrator command prompt when you need to run the VM.

bcdedit /set hypervisorlaunchtype off
shutdown /r

This disables WSL if it is version 2, which is default, and prevents you from successfully running cargo xtask vmware. Whenever you need to rebuild the project, re-enable Hyper-V.

bcdedit /set hypervisorlaunchtype auto
shutdown /r

About (2)

This provides better workflow. After disabling Hyper-V in the same way as above, change the WSL version on the Administrator command prompt.

wsl --set-default-version 1

Then, create a Ubuntu WSL instance. This allows the VMware VM to start while all other instructions and workflow remain to work. If you need to test with VMware frequently, this setup is recommended. This is my Windows setup as well.