Build QEMU ready for ESXi 7 and Windows 10 on Ubuntu 20

We need to compile QEMU 5.2.0. We need this version since it is the latest version of the 5.x.x release which supports the Network interface e1000e since others are not detected by ESXi version 7. Unfortunately Ubuntu does not have version 5.2.0 in their repos, so we need it to build. Additionally, spice and usb redirection should be included as compilation flags which are preferred for windows installations.

First ensure all dependencies are available:

sudo apt install build-essential libspice-protocol-dev libspice-server-dev libusb-dev libusbredirhost-dev

The download QEMU 5.2.0, compile and install it:

wget https://download.qemu.org/qemu-5.2.0.tar.xz
tar xvJf qemu-5.2.0.tar.xz
cd qemu-5.2.0
./configure --enable-spice --enable-usb-redir
make
sudo make install

Afterwards you can install ESXi 7 or Windows 10 according to following guides:

https://itsjustbytes.com/2020/12/14/kvm-esxi-7-as-a-nested-cluster/

https://linuxhint.com/install_virtio_drivers_kvm_qemu_windows_vm/#:~:text=To install the virtio storage,driver directory%2C click on OK.