Supported Virtual Machine Types
The easiest way to debug a Linux kernel issue that does not involve specific hardware is to create a virtual machine and run the target system there. This way the debugger logic will be separated from the guest logic and will not not be affected by glitches (e.g. memory corruption) in the target kernel. VisualKernel supports debugging 3 virtual machine types using this method: VMWare, VirtualBox and QEMU.
VMWare
VMWare provides the best support for debugging guest kernels via a built-in GDB stub. VisualKernel will automatically configure it whenever you select a VMWare Virtual machine in the debug settings.
You can also enable it manually by adding the following lines the the .vmx file:
debugStub.listen.guest64 = "TRUE" debugStub.hideBreakpoints = "FALSE"
Warning! If your host machine has the Hyper-V platform enabled, the VMWare GDB stub will not work. Stopping at a breakpoint in the guest will immediately crash the VM with the following error:
In(05) vcpu-0 Vix: [vmxCommands.c:4557]: VMAutomation_Pause: pause = TRUE In(05) vcpu-0 Not informing DCL we are stopping. Cr(01) vcpu-0 PANIC: NOT_IMPLEMENTED D:\build\ob\bora-19376536\bora\vmcore\monitor\ulm\hv\windows\hv.c:11 Cr(01) vcpu-0 Panic loop
If this happens, consider disabling Hyper-V on the host or using QEMU instead.
VirtualBox
VirtualBox includes a gdb stub similar the one in VMWare, however it is only present in the test builds, is slower than the one in VMWare, and also does not work when Hyper-V is enabled. See this page for more details.
If you would like to use Hyper-V on the host, please try using QEMU instead.
QEMU
QEMU is the only virtual machine engine that supports guest debugging when using the Hyper-V platform (WHPX). However, its GUI is much simpler compared to VMWare and VirtualBox and it does not support USB virtualization on Windows hosts. We recommend using QEMU if you have to use Hyper-V platform on the host (required by WSL2), or if you do not depend on advanced USB and device-level virtualization.
See this page for a detailed overview of the VisualKernel integration with QEMU.
Summary
The table below summarizes the supported virtual machine types:
VM Type | Advantages | Disadvantages |
---|---|---|
VMWare | Best performance Best hardware virtualization Best reliability |
Requires a separate license Incompatible with Hyper-V Hosts |
VirtualBox | Open-source | Slower debugging than VMWare and QEMU Incompatible with Hyper-V Hosts |
QEMU | Compatible with Hyper-V Hosts Open-source No installation required |
GUI is very basic and has glitches No support for USB virtualization |