1095ea049SAnatol Belski# Windows Support 2095ea049SAnatol Belski 3095ea049SAnatol BelskiStarting with the release version [0.10.0](https://github.com/cloud-hypervisor/cloud-hypervisor/releases/tag/v0.10.0), Cloud Hypervisor supports Windows guests. 4095ea049SAnatol Belski 5095ea049SAnatol Belski__Requirements__ 6095ea049SAnatol Belski 7095ea049SAnatol Belski- Host with KVM enabled 8095ea049SAnatol Belski- [UEFI](uefi.md) capable Windows guest image with Virtio drivers integrated 9095ea049SAnatol Belski 10095ea049SAnatol BelskiAny modern Windows Server version is compatible. Cloud Hypervisor has been successfully tested with Windows Server 2019 and Windows Server Core 2004. 11095ea049SAnatol Belski 12095ea049SAnatol BelskiAt the current stage, only UEFI capable Windows images are supported. This implies the presence of the OVMF firmware during the Windows installation and in any subsequent usage. BIOS boot is not supported. 13095ea049SAnatol Belski 14095ea049SAnatol BelskiThe subsequent sections will tell, in detail, how to prepare an appropriate Windows image. 15095ea049SAnatol Belski 16095ea049SAnatol Belski## Image Preparation 17095ea049SAnatol Belski 18095ea049SAnatol Belski### Installation using the stock Windows ISO 19095ea049SAnatol Belski 20095ea049SAnatol Belski__Prerequisites__ 21095ea049SAnatol Belski 22b076602bSAnatol Belski- QEMU, version >=5.0.0 is recommended. 23095ea049SAnatol Belski- Windows installation ISO. Obtained through MSDN, Visual Studio subscription, evaluation center, etc. 24095ea049SAnatol Belski- [VirtIO driver ISO](https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/) 25bea10070SSebastien Boeuf- Suitable firmware for Cloud Hypervisor (`CLOUDHV.fd`) and for QEMU (`OVMF.fd`) 26095ea049SAnatol Belski- With the suggested image size of 30G, there should be enough free disk space to hold the installation ISO and any other necessary files 27095ea049SAnatol Belski 28095ea049SAnatol BelskiThis step currently requires QEMU to install Windows onto the guest. QEMU is only used at the preparation stage, the resulting image is then fully functional with Cloud Hypervisor. 29095ea049SAnatol Belski 30095ea049SAnatol BelskiPreparing several command parts as these will be used in the follow up sections as well. 31095ea049SAnatol Belski 32095ea049SAnatol Belski```shell 33b02df13aSAnatol BelskiIMG_FILE=windows-disk.raw 34095ea049SAnatol BelskiWIN_ISO_FILE=en_windows_server_version_2004_updated_may_2020_x64_dvd_1e7f1cfa.iso 35095ea049SAnatol BelskiVIRTIO_ISO_FILE=virtio-win-0.1.185.iso 36095ea049SAnatol BelskiOVMF_DIR=./FV 37095ea049SAnatol Belski``` 38095ea049SAnatol Belski 39b02df13aSAnatol BelskiCreate an empty image file, `raw` is supported. 40095ea049SAnatol Belski```shell 41b02df13aSAnatol Belskiqemu-img create -f raw $IMG_FILE 30G 42095ea049SAnatol Belski``` 43095ea049SAnatol Belski 44095ea049SAnatol BelskiBegin the Windows installation process under QEMU 45095ea049SAnatol Belski```shell 46b076602bSAnatol Belskiqemu-system-x86_64 \ 47b076602bSAnatol Belski -machine q35,accel=kvm \ 48095ea049SAnatol Belski -cpu host \ 49095ea049SAnatol Belski -m 4G \ 50095ea049SAnatol Belski -bios ./$OVMF_DIR/OVMF_CODE.fd \ 51095ea049SAnatol Belski -cdrom ./$WIN_ISO_FILE \ 52*cf8a3482SJinank Jain -drive file=./$VIRTIO_ISO_FILE,index=0,media=cdrom \ 53095ea049SAnatol Belski -drive if=none,id=root,file=./$IMG_FILE \ 54095ea049SAnatol Belski -device virtio-blk-pci,drive=root,disable-legacy=on \ 55095ea049SAnatol Belski -device virtio-net-pci,netdev=mynet0,disable-legacy=on \ 56095ea049SAnatol Belski -netdev user,id=mynet0 \ 57095ea049SAnatol Belski -vga std 58095ea049SAnatol Belski``` 59095ea049SAnatol Belski 60095ea049SAnatol BelskiBefore the installation can proceed, point the Windows installation program to the VirtIO disk and install the necessary storage controller drivers. After that, the attached hard drive will become visible and the actual installation can commence. 61095ea049SAnatol Belski 62095ea049SAnatol BelskiAfter the installation has completed, proceed further to the configuration section. QEMU will be needed at least once more to enable the Windows Special Administration Console (SAC) and to possibly install extra device drivers. 63095ea049SAnatol Belski 64095ea049SAnatol Belski## Image Usage 65095ea049SAnatol Belski 66095ea049SAnatol BelskiThe basic command to boot a Windows image. The configuration section should be checked before executing it for the first time. 67095ea049SAnatol Belski 68095ea049SAnatol Belski```shell 69095ea049SAnatol Belskicloud-hypervisor \ 70779bc1a5SSebastien Boeuf --kernel ./$OVMF_DIR/CLOUDHV.fd \ 71095ea049SAnatol Belski --disk path=./$IMG_FILE \ 72095ea049SAnatol Belski --cpus boot=1,kvm_hyperv=on \ 73095ea049SAnatol Belski --memory size=4G \ 74095ea049SAnatol Belski --serial tty \ 75095ea049SAnatol Belski --console off \ 76095ea049SAnatol Belski --net tap= 77095ea049SAnatol Belski``` 78095ea049SAnatol Belski 79095ea049SAnatol BelskiIt is necessary to always: 80095ea049SAnatol Belski 81095ea049SAnatol Belski- Carry the OVMF firmware in the `--kernel` option 82095ea049SAnatol Belski- Add `kvm_hyperv=on` to the `--cpus` option 83095ea049SAnatol Belski 84b076602bSAnatol BelskiIn cases where the host processor supports address space > 39 bits, it might be necessary to limit the address space. It can be done by appending the option `max_phys_bits=X` to the `--cpus` parameter, where `X` is the number of bits to be supported. Windows was tested to support at least 39-bit address space. 85b076602bSAnatol Belski 86095ea049SAnatol BelskiTo daemonize the Cloud Hypervisor process, `nohup` can be used. Some STDIO redirections might need to be done. In a simple case it is sufficient to just redirect all the output to `/dev/null`. 87095ea049SAnatol Belski 88095ea049SAnatol Belski## Image Configuration 89095ea049SAnatol Belski 90095ea049SAnatol Belski### Device Drivers 91095ea049SAnatol Belski 92095ea049SAnatol BelskiAfter the Windows installation has finished under QEMU, there might be still devices with no drivers installed. This might happen for example, when a device was not used during the installation. In particular it is important to ensure that the VirtIO network device is setup correctly because further steps for the configuration and the usage require network in most case. 93095ea049SAnatol Belski 94095ea049SAnatol BelskiBoot once more under QEMU and use the [Device Manager](https://support.microsoft.com/en-in/help/4028443/windows-10-update-drivers), to ensure all the device drivers, and especially the network card, are installed correctly. Also, as Cloud Hypervisor can introduce new devices, it is advisable to repeat the procedure while booted under Cloud Hypervisor, when the RDP access to the image is functional. 95095ea049SAnatol Belski 96095ea049SAnatol Belski### Windows Special Administration Console (SAC) enablement 97095ea049SAnatol Belski 98095ea049SAnatol BelskiSAC provides a text based console access to the Windows guest. As Cloud Hypervisor doesn't implement a VGA adaptor, SAC is an important instrument for the Windows guest management. 99095ea049SAnatol Belski 100095ea049SAnatol BelskiBoot the Windows image under QEMU and execute the below commands to permanently enable SAC 101095ea049SAnatol Belski 102095ea049SAnatol Belski```cmd 103095ea049SAnatol Belskibcdedit /emssettings emsport:1 emsbaudrate:115200 104095ea049SAnatol Belskibcdedit /ems on 105095ea049SAnatol Belskibcdedit /bootems on 106095ea049SAnatol Belski``` 107095ea049SAnatol Belski 108095ea049SAnatol BelskiOnce SAC is enabled, the image can be booted under Cloud Hypervisor. The SAC prompt will show up 109095ea049SAnatol Belski 110095ea049SAnatol Belski<pre> 111095ea049SAnatol BelskiComputer is booting, SAC started and initialized. 112095ea049SAnatol Belski 113095ea049SAnatol BelskiUse the "ch -?" command for information about using channels. 114095ea049SAnatol BelskiUse the "?" command for general help. 115095ea049SAnatol Belski 116095ea049SAnatol Belski 117095ea049SAnatol BelskiSAC> 118095ea049SAnatol Belski</pre> 119095ea049SAnatol Belski 120095ea049SAnatol BelskiTo open a console on the guest, the command sequence below can be used 121095ea049SAnatol Belski<pre> 122095ea049SAnatol BelskiSAC>cmd 123095ea049SAnatol BelskiThe Command Prompt session was successfully launched. 124095ea049SAnatol BelskiSAC> 125095ea049SAnatol BelskiEVENT: A new channel has been created. Use "ch -?" for channel help. 126095ea049SAnatol BelskiChannel: Cmd0001 127095ea049SAnatol BelskiSAC>ch -si 1 128095ea049SAnatol Belski</pre> 129095ea049SAnatol Belski 130095ea049SAnatol BelskiSee also the [links](#Links) section for a more extended SAC documentation. 131095ea049SAnatol Belski 132095ea049SAnatol Belski## Network 133095ea049SAnatol Belski 1346722c303SRob BradfordThis section illustrates the Windows specific aspects of the VM network configuration. 135095ea049SAnatol Belski 136095ea049SAnatol Belski### Basic Networking 137095ea049SAnatol Belski 1387bf0cc1eSPhilipp SchusterAs the simplest option, using `--net tap=` in the Cloud Hypervisor command line will create a `vmtapX` device on the host with the default IPv4 address `192.168.249.1`. After SAC becomes available, the guest configuration can be set with 139095ea049SAnatol Belski 140095ea049SAnatol Belski<pre> 141095ea049SAnatol BelskiSAC>i 10 192.168.249.2 255.255.255.0 192.168.249.1 142095ea049SAnatol Belski</pre> 143095ea049SAnatol Belski 144095ea049SAnatol BelskiWhere `10` is the device index as shown by the `i` command. 145095ea049SAnatol Belski 146095ea049SAnatol Belski### Guest Internet Connectivity 147095ea049SAnatol Belski 148095ea049SAnatol BelskiAdditional steps are necessary to provide the guest with internet access. 149095ea049SAnatol Belski 150095ea049SAnatol Belski- On the guest, add the DNS server either by using `netsh` or by opening `Network and Connectivity Center` and editing the adapter properties. 151095ea049SAnatol Belski- On the host, configure the traffic forwarding. Replace the `NET_DEV` with the name of your network device. 152095ea049SAnatol Belski```shell 153095ea049SAnatol BelskiNET_DEV=wlp3s0 154095ea049SAnatol Belskisysctl -w net.ipv4.ip_forward=1 155095ea049SAnatol Belskiiptables -t nat -A POSTROUTING -o $NET_DEV -j MASQUERADE 156095ea049SAnatol Belski``` 157095ea049SAnatol Belski 158095ea049SAnatol Belski### Remote Desktop Protocol (RDP) enablement 159095ea049SAnatol Belski 160095ea049SAnatol Belski#### Using QEMU 161095ea049SAnatol Belski - Execute `SystemPropertiesRemote` 162095ea049SAnatol Belski - In the properties window, choose "Allow remote connections to this computer" 163095ea049SAnatol Belski - Click "Select Users" and add some user to the allow list 164095ea049SAnatol Belski#### Using powershell 165095ea049SAnatol Belski```powershell 166095ea049SAnatol BelskiSet-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\" -Name "fDenyTSConnections" -Value 0 167095ea049SAnatol BelskiEnable-NetFirewallRule -DisplayGroup "Remote Desktop" 168095ea049SAnatol BelskiAdd-LocalGroupMember -Group "Remote Desktop Users" -Member someuser 169095ea049SAnatol Belski``` 170095ea049SAnatol Belski 171095ea049SAnatol BelskiAdministrators can always RDP, non administrator users have to be explicitly enabled. 172095ea049SAnatol Belski 173095ea049SAnatol BelskiOnce the configuration is set, RDP clients can connect to `192.168.249.2`. 174095ea049SAnatol Belski 175095ea049SAnatol Belski### SSH 176095ea049SAnatol Belski 177095ea049SAnatol Belski#### Enable using powershell 178095ea049SAnatol Belski 179095ea049SAnatol Belski```powershell 180095ea049SAnatol BelskiAdd-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 181095ea049SAnatol BelskiStart-Service sshd 182095ea049SAnatol BelskiSet-Service -Name sshd -StartupType ‘Automatic’ 183095ea049SAnatol Belski``` 184095ea049SAnatol Belski 185095ea049SAnatol BelskiThis allows for SSH login from a remote machine, for example through the `administrator` user: `ssh administrator@192.168.249.2`. For a more detailed OpenSSH guide, please follow the MSDN article from the [links](#links) section. 186095ea049SAnatol Belski 1871bb0e54eSAnatol Belski## Hotplug capability 1881bb0e54eSAnatol Belski 1893f5ecbd3SAnatol BelskiCPU hotplug is supported. The VM operating system needs to support hotplug and be appropriately licensed. SKU limitations like constraints on the number of cores are to be taken into consideration. Note, that Windows doesn't support CPU hot-remove. When `ch-remote` is invoked to reduce the number of CPUs, the result will be visible after the OS reboot within the same hypervisor instance. 1901bb0e54eSAnatol Belski 191e1cc7023SAnatol BelskiRAM hotplug is supported. Note, that while the `pnpmem.sys` driver in use supports RAM hot-remove, the RAM being unplugged has to be not in use and have no reserved pages. In most cases it means, hot-remove won't work. Same as with the CPU hot-remove, when `ch-remote` is invoked to reduce the RAM size, the result will be visible after the OS reboot. 192e1cc7023SAnatol Belski 1938614a0abSAnatol BelskiNetwork device hotplug and hot-remove are supported. 1948614a0abSAnatol Belski 19501e2826fSAnatol BelskiDisk hotplug and hot-remove are supported. After the device has been hotplugged, it will need to be onlined from within the guest. Among other tools, powershell applets `Get-Disk` and `Set-Disk` can be used for the disk configuration and activation. 19601e2826fSAnatol Belski 197b076602bSAnatol Belski## Debugging 198b076602bSAnatol Belski 199b076602bSAnatol BelskiThe Windows guest debugging process relies heavily on QEMU and [socat](http://www.dest-unreach.org/socat/). The procedure requires two Windows VMs: 200b076602bSAnatol Belski 201b076602bSAnatol Belski- A debugger VM running under QEMU. 202b076602bSAnatol Belski- A debuggee, a Windows VM that has been created in the previous steps, running under Cloud Hypervisor or QEMU. 203b076602bSAnatol Belski 204b076602bSAnatol BelskiThe connection between both guests happens over TCP, whereby on the guest side it is automatically translated to a COM port. Because the VMs are connected through TCP, the debugging infrastructure can be distributed over the network. The serial port, while slowly transferring data, is common enough to support a wide range of cases and tools. 205b076602bSAnatol Belski 2067bf0cc1eSPhilipp SchusterIn this exercise, [WinDbg](https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/) is used. Any other debugger of choice with the ability to use serial connection can be used instead. 207b076602bSAnatol Belski 208b076602bSAnatol Belski### Debugger and Debuggee 209b076602bSAnatol Belski 210b076602bSAnatol Belski#### WinDbg VM 211b076602bSAnatol Belski 2127bf0cc1eSPhilipp SchusterFor simplicity, the debugger VM is supposed to be only running under QEMU. It will require VGA and doesn't necessarily depend on UEFI. As an OS, it can carry any supported Windows OS where the debugger of choice can be installed. The simplest way is to follow the image preparation instructions from the previous chapter, but avoid using the OVMF firmware. It is also not required to use VirtIO drivers, whereby it might be useful in some case. Though, while creating the image file for the debugger VM, be sure to choose a sufficient disk size that counts in the need to save the corresponding debug symbols and sources. 213b076602bSAnatol Belski 214b076602bSAnatol BelskiTo create the debugger Windows VM, the following command can be used: 215b076602bSAnatol Belski 216b076602bSAnatol Belski```shell 217b076602bSAnatol Belskiqemu-system-x86_64 \ 218b076602bSAnatol Belski -machine q35,accel=kvm \ 219b076602bSAnatol Belski -cpu host \ 220b076602bSAnatol Belski -smp 1 \ 221b076602bSAnatol Belski -m 4G \ 222b076602bSAnatol Belski -cdrom ./$WIN_ISO_FILE \ 223b076602bSAnatol Belski -drive file=./$VIRTIO_ISO_FILE,index=0,media=cdrom 224b02df13aSAnatol Belski -drive if=none,id=root,file=./windbg-disk.raw \ 225b076602bSAnatol Belski -device virtio-blk-pci,drive=root,disable-legacy=on \ 226b076602bSAnatol Belski -device virtio-net-pci,netdev=mynet0,disable-legacy=on \ 227b076602bSAnatol Belski -netdev user,id=mynet0,net=192.168.178.0/24,host=192.168.178.1,dhcpstart=192.168.178.64,hostname=windbg-host \ 228b076602bSAnatol Belski -vga std 229b076602bSAnatol Belski``` 230b076602bSAnatol Belski 231b076602bSAnatol BelskiA non server Windows OS like Windows 10 can be used to carry the debugging tools in the debugger VM. 232b076602bSAnatol Belski 233b076602bSAnatol Belski#### Debuggee VM 234b076602bSAnatol Belski 235b076602bSAnatol BelskiThe debuggee VM is the one that we've learned to configure and run in the first section. There might be various reasons to debug. For example, there could be an issue in the Windows guest with an emulated device or an included driver. Or, we might want to develop a custom feature like a kernel driver to be available in the guest. 236b076602bSAnatol Belski 237b076602bSAnatol BelskiNote, that there are several ways to debug Windows, not all of them need to be enabled at the same time. For example, if developing a kernel module, the only useful options would be to configure for the serial debugging and enable the kernel debug. In that case, any crash or misbehavior in the boot loader or kernel would be ignored. The commands below must be run as administrator on the debuggee guest VM. 238b076602bSAnatol Belski 239b076602bSAnatol Belski##### Turn On Serial Debugging 240b076602bSAnatol Belski 241b076602bSAnatol BelskiThis will configure the debugging to be enabled and instruct to use the serial port for it. 242b076602bSAnatol Belski 243b076602bSAnatol Belski```cmd 244b076602bSAnatol Belskibcdedit /dbgsettings serial debugport:1 baudrate:115200 245b076602bSAnatol Belski``` 246b076602bSAnatol Belski 2477bf0cc1eSPhilipp Schuster##### Turn On Kernel Debugging 248b076602bSAnatol Belski 249b076602bSAnatol Belski```cmd 250b076602bSAnatol Belskibcdedit /debug on 251b076602bSAnatol Belski``` 252b076602bSAnatol Belski 253b076602bSAnatol Belski##### Turn On Boot Loader Debug 254b076602bSAnatol Belski 255b076602bSAnatol Belski```cmd 256b076602bSAnatol Belskibcdedit /bootdebug on 257b076602bSAnatol Belski``` 258b076602bSAnatol Belski 259b076602bSAnatol Belski##### Turn on boot manager debug 260b076602bSAnatol Belski 261b076602bSAnatol Belski```cmd 262b076602bSAnatol Belskibcdedit /set {bootmgr} bootdebug on 263b076602bSAnatol Belski``` 264b076602bSAnatol Belski 265b076602bSAnatol Belski##### Disable Recovery Screen On Boot Failure 266b076602bSAnatol Belski 267b076602bSAnatol BelskiThere could be a situation, where a crash is debugged. In such cases, the guest could be left in an inconsistent state. The default Windows behavior would be to boot into the recovery screen, however in some cases it might be not desired. To make Windows ignore failures and always proceed to booting the OS, use the command below: 268b076602bSAnatol Belski 269b076602bSAnatol Belski```cmd 270b076602bSAnatol Belskibcdedit /set {default} bootstatuspolicy ignoreallfailures 271b076602bSAnatol Belski``` 272b076602bSAnatol Belski 273b076602bSAnatol Belski### Debugging Process 274b076602bSAnatol Belski 275b076602bSAnatol Belski#### Invoke the WinDbg VM 276b076602bSAnatol Belski 277b076602bSAnatol Belski```shell 278b076602bSAnatol Belskiqemu-system-x86_64 \ 279b076602bSAnatol Belski -machine q35,accel=kvm \ 280b076602bSAnatol Belski -cpu host \ 281b076602bSAnatol Belski -smp 1 \ 282b076602bSAnatol Belski -m 4G \ 283b02df13aSAnatol Belski -drive if=none,id=root,file=./windbg-disk.raw \ 284b076602bSAnatol Belski -device virtio-blk-pci,drive=root,disable-legacy=on \ 285b076602bSAnatol Belski -serial tcp::4445,server,nowait \ 286b076602bSAnatol Belski -device virtio-net-pci,netdev=mynet0,disable-legacy=on \ 287b076602bSAnatol Belski -netdev user,id=mynet0,net=192.168.178.0/24,host=192.168.178.1,dhcpstart=192.168.178.64,hostname=windbg-host \ 288b076602bSAnatol Belski -vga std 289b076602bSAnatol Belski``` 290b076602bSAnatol Belski 291b076602bSAnatol BelskiNote, this VM has the networking enabled. It is needed, because symbols and sources might need to be fetched from a network location. 292b076602bSAnatol Belski 293b076602bSAnatol BelskiAlso, notice the `-serial` parameter - that's what does the magic on exposing the serial port to the guest while connecting the debugger VM with a client VM through the network. SAC/EMS needs to be disabled in the debugger VM, as otherwise the COM device might be blocked. 294b076602bSAnatol Belski 2956c0c47a5SAnatol BelskiHereafter, WinDbg can be started using a command below: 2966c0c47a5SAnatol Belski 2976c0c47a5SAnatol Belski```cmd 2986c0c47a5SAnatol Belskiset _NT_DEBUG_PORT=com1 2996c0c47a5SAnatol Belskiset _NT_DEBUG_BAUD_RATE=115200 3006c0c47a5SAnatol Belski 3016c0c47a5SAnatol Belskiwindbg -v -d -k 3026c0c47a5SAnatol Belski``` 3036c0c47a5SAnatol Belski 3046c0c47a5SAnatol BelskiOnce started, WinDbg will wait for an incoming connection which is going to be initialized by the debuggee VM started in the next section. 3056c0c47a5SAnatol Belski 306b076602bSAnatol Belski#### Invoke the Debuggee VM 307b076602bSAnatol Belski 308b076602bSAnatol Belski##### Under QEMU 309b076602bSAnatol Belski 310b076602bSAnatol BelskiEssentially it would be the command like depicted in the guest preparation sections, with a few modifications: 311b076602bSAnatol Belski```shell 312b076602bSAnatol Belskiqemu-system-x86_64 \ 313b076602bSAnatol Belski -machine q35,accel=kvm \ 314b076602bSAnatol Belski -cpu host \ 315b076602bSAnatol Belski -m 4G \ 316b076602bSAnatol Belski -bios ./$OVMF_DIR/OVMF_CODE.fd \ 317b076602bSAnatol Belski -cdrom ./$WIN_ISO_FILE \ 318b076602bSAnatol Belski -drive file=./$VIRTIO_ISO_FILE,index=0,media=cdrom 319b076602bSAnatol Belski -drive if=none,id=root,file=./$IMG_FILE \ 320b076602bSAnatol Belski -device virtio-blk-pci,drive=root,disable-legacy=on \ 321b076602bSAnatol Belski -device virtio-net-pci,netdev=mynet0,disable-legacy=on \ 322b076602bSAnatol Belski -netdev user,id=mynet0 \ 323b076602bSAnatol Belski -serial tcp:127.0.0.1:4445 \ 324b076602bSAnatol Belski -vga std 325b076602bSAnatol Belski``` 326b076602bSAnatol Belski 327b076602bSAnatol BelskiIt is to see, that `-serial` parameter is used here, to establish the connection with the debugger VM. 328b076602bSAnatol Belski 329b076602bSAnatol BelskiTo disable HPET, attach `--no-hpet`. To enable hypervisor reference timer, use `-cpu host,hv-time`. These and other options can be used to achieve better [Hyper-V compatibility](https://archive.fosdem.org/2019/schedule/event/vai_enlightening_kvm/attachments/slides/2860/export/events/attachments/vai_enlightening_kvm/slides/2860/vkuznets_fosdem2019_enlightening_kvm.pdf). 330b076602bSAnatol Belski 331b076602bSAnatol Belski##### Cloud Hypervisor 332b076602bSAnatol Belski 333b076602bSAnatol BelskiThe `socat` tool is used to establish the QEMU compatible behavior. Here as well, the Cloud Hypervisor command used to run the Windows guest is to be used. Put the command into a shell script: 334b076602bSAnatol Belski 335b076602bSAnatol Belski`socat SYSTEM:"./ch-script",openpty,raw,echo=0 TCP:localhost:4445` 336b076602bSAnatol Belski 337b076602bSAnatol BelskiThe reason to pack the command into the shell script is that the command might contain a comma. When using SYSTEM, the shell command can't contain `,` or `!!`. 338b076602bSAnatol Belski 339095ea049SAnatol Belski## Links 340095ea049SAnatol Belski 341095ea049SAnatol Belski- [Fedora VirtIO guide for Windows](https://docs.fedoraproject.org/en-US/quick-docs/creating-windows-virtual-machines-using-virtio-drivers/) 342095ea049SAnatol Belski- [VirtIO driver binaries](https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/) 343095ea049SAnatol Belski- [VirtIO driver sources](https://github.com/virtio-win/kvm-guest-drivers-windows) 344095ea049SAnatol Belski- [Emergency Management Services](https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2003/cc787940(v=ws.10)) 345095ea049SAnatol Belski- [OpenSSH server/client configuration](https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse) 346b076602bSAnatol Belski- [Windows guest debugging under KVM](https://www.linux-kvm.org/page/WindowsGuestDrivers/GuestDebugging) 347b076602bSAnatol Belski- ["ENLIGHTENING" KVM](https://archive.fosdem.org/2019/schedule/event/vai_enlightening_kvm/attachments/slides/2860/export/events/attachments/vai_enlightening_kvm/slides/2860/vkuznets_fosdem2019_enlightening_kvm.pdf) 348