{"id":2649,"date":"2026-09-24T15:46:11","date_gmt":"2026-09-24T21:46:11","guid":{"rendered":"https:\/\/www.itayemi.com\/blog\/?p=2649"},"modified":"2026-09-28T22:31:11","modified_gmt":"2026-09-29T04:31:11","slug":"compiling-qemu-from-source","status":"publish","type":"post","link":"https:\/\/www.itayemi.com\/blog\/2026\/09\/24\/compiling-qemu-from-source\/","title":{"rendered":"Compiling QEMU from source &#8211; for Linux and Windows"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">QEMU (Quick Emulator) is a free, open-source program that acts as a machine emulator and virtualizer to run different operating systems and programs. QEMU emulates computer hardware (such as hard drives, network cards, and graphics controllers) and runs the actual virtual machine process in user space). You may prefer to use a management layer such as libvirtd (Linux) instead of QEMU\/KVM directly. In this post, I will be compiling QEMU from source to get more control over its features that are enabled. While I am unsure what is exactly different between the version I compiled from source and the pre-built windows version from the QEMU website, the command I used for spinning up the VM doesn&#8217;t work with the pre-built QEMU binary. QEMu starts with the VM status as &#8220;paused&#8221;. My main goal is to create a VM where the O\/S running in it believes it is running on a physical computer and not in a VM. This is to by-pass some limitations in certain games and other applications where they refuse to run (or don&#8217;t run correctly) when they detect they are being launched in a VM. This is sometimes called <strong>&#8220;Anti-VM&#8221;<\/strong> detection.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Physical Environment<\/strong><br>Physical laptop is a DELL running Rocky 9.I decided to create a Ubuntu VM to use as my compiler machine for several reasons.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">COMPILING QEMU for Windows on Ubuntu VM<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">QEMU (Quick Emulator) is a free, open-source program that acts as a machine emulator and virtualizer to run different operating systems and programs. QEMU emulates computer hardware (such as hard drives, network cards, and graphics controllers) and runs the actual virtual machine process in user space). You may prefer to use a management layer such as libvirtd (Linux) instead of QEMU\/KVM directly. In this post, I will be compiling QEMU from source to get more control over its features that are enabled. While I am unsure what is exactly different between the version I compiled from source and the pre-built windows version from the QEMU website, the command I used for spinning up the VM doesn&#8217;t work with the pre-built QEMU binary. QEMu starts with the VM status as &#8220;paused&#8221;. My main goal is to create a VM where the O\/S running in it believes it is running on a physical computer and not in a VM. This is to by-pass some limitations in certain games and other applications where they refuse to run (or don&#8217;t run correctly) when they detect they are being launched in a VM. This is sometimes called &#8220;Anti-VM&#8221; detection.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Physical Environment:<\/strong> Physical laptop is a DELL running Rocky 9.I decided to create a Ubuntu VM to use as my compiler machine for several reasons.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Setup libvirtd on the physical host (CentOS Stream release 9) so we can create a Ubuntu VM<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Check Hardware Virtualization<br>$ grep -e &#8216;vmx&#8217; -e &#8216;svm&#8217; \/proc\/cpuinfo<\/li>\n\n\n\n<li>Install Virtualization Packages<br>$ sudo dnf install -y qemu-kvm libvirt virt-manager virt-install virt-viewer virt-top bridge-utils libguestfs-tools<\/li>\n\n\n\n<li>Start and Enable libvirtd<br>$ sudo systemctl enable &#8211;now libvirtd<br>$ sudo systemctl status libvirtd<\/li>\n\n\n\n<li>Configure User Permissions<br>$ sudo usermod -aG libvirt $USER<br>$ sudo usermod -aG kvm $USER<br>$ newgrp libvirt<\/li>\n\n\n\n<li>Start the Default Network<br>$ sudo virsh net-start default<br>$ sudo virsh net-autostart default<\/li>\n\n\n\n<li>Enable ordinary user to create a VM and have it have networking without using sudo<br>$ ip a #(find your bridge interface e.g., virbr0)<br>$ sudo mkdir -p \/etc\/qemu<br>$ echo &#8220;allow virbr0&#8221; | sudo tee \/etc\/qemu\/bridge.conf<br>$ sudo chmod 644 \/etc\/qemu\/bridge.conf<br>$ sudo chmod u+s \/usr\/libexec\/qemu-bridge-helper<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Cross-compile QEMU for Windows (on Ubuntu)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">&#8211; Download a disk image and create a VM from it:<br>$ mkdir \/VMs<br>$ cd \/VMs<br>$ wget https:\/\/cloud-images.ubuntu.com\/minimal\/releases\/noble\/release\/ubuntu-24.04-minimal-cloudimg-amd64.img -O compiler.qcow2<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">&#8211; increase the size of the disk as it is only 3.5G<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">$ qemu-img resize compiler.qcow2 30g<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">$ cat &gt;&gt; user-data &lt;&lt; EOF<br># cloud-config<br>user: ubuntu<br>password: xxxxx123!<br>chpasswd: { expire: False }<br>ssh_pwauth: True<br># Automatically updates the repositories and installs ping on first boot<br>packages:<br>  &#8211; iputils-ping<br>EOF<br>$<br>$ sudo usermod -aG libvirt $USER<br>$ newgrp libvirt<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">&#8211; create the VM<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">$ sudo virt-install &#8211;name compiler &#8211;memory 8192 &#8211;vcpus 4 &#8211;disk compiler.qcow2,format=qcow2 &#8211;os-variant ubuntu24.04 &#8211;import &#8211;graphics none &#8211;network default &#8211;cloud-init user-data=user-data<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">&#8211; login to the Ubuntu VM with the credentials from the user-data file<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">ubuntu@ubuntu:~\/qemu$ cat \/etc\/os-release | grep VERSION=<br>VERSION=&#8221;24.04.5 LTS (Noble Numbat)&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">$ echo &#8220;export TERM=vt220&#8221; &gt;&gt; ~\/.bashrc<br>$ echo &#8220;set enable-bracketed-paste off&#8221; &gt;&gt; ~\/.bashrc<br>$ echo &#8220;export PS1='[\\u@\\h \\W]\\$'&#8221; &gt;&gt; ~\/.bashrc<br>$ echo &#8220;PS2=&#8217;&gt;'&#8221; &gt;&gt; ~\/.bashrc<br>$ source ~\/.bashrc<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">$ sudo apt update -y<br>$ sudo apt upgrade -y<br>$ sudo apt install -y mingw-w64<br>$ sudo apt install -y software-properties-common<br>$ sudo add-apt-repository -c universe -y<br>$ sudo apt update -y<br>$ sudo apt upgrade -y<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">$ DEBIAN_FRONTEND=noninteractive sudo -E apt install -y autoconf automake autopoint bash bison bzip2 flex gettext git g++ gperf intltool libc6-dev-i386 libgdk-pixbuf2.0-dev libltdl-dev libgl-dev libpcre3-dev libssl-dev libtool-bin libxml-parser-perl lzip make openssl p7zip-full patch perl pkg-config python3 python3-mako python3-pkg-resources ruby sed unzip wget xz-utils g++-multilib python-is-python3 python3-venv vim meson libusb-1.0-0-dev libibverbs-dev librdmacm-dev libcacard-dev libusbredirparser-dev libusb-1.0-0-dev<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">&#8211; IF prompted for keyboard layout, enter 35 (English US) or 34 (English UK) for country of origin, then 1 (English US) for keyboard layout<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">$ cd<br>$ git clone https:\/\/github.com\/mxe\/mxe.git<br>$ cd mxe\/<br>$ make MXE_TARGETS=&#8217;x86_64-w64-mingw32.static&#8217; glib gtk3 pixman sdl2 openssl zlib jpeg opus orc libusb1 lz4<br>$ make MXE_TARGETS=&#8217;x86_64-w64-mingw32.static&#8217; lz4<br>$ echo &#8216;export PATH=&#8221;\/home\/ubuntu\/mxe\/usr\/bin:$PATH&#8221;&#8216; &gt;&gt; ~\/.bashrc<br>$ source ~\/.bashrc<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">$ cd<br>$ git clone https:\/\/gitlab.freedesktop.org\/slirp\/libslirp.git<br>$ cd libslirp<br>$ cat &gt; mxe-cross.txt &lt;&lt; &#8216;EOF&#8217;<br>[binaries]<br>c = &#8216;x86_64-w64-mingw32.static-gcc&#8217;<br>ar = &#8216;x86_64-w64-mingw32.static-ar&#8217;<br>strip = &#8216;x86_64-w64-mingw32.static-strip&#8217;<br>pkg-config = &#8216;x86_64-w64-mingw32.static-pkg-config&#8217;<br>windres = &#8216;x86_64-w64-mingw32.static-windres&#8217;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">[host_machine]<br>system = &#8216;windows&#8217;<br>cpu_family = &#8216;x86_64&#8217;<br>cpu = &#8216;x86_64&#8217;<br>endian = &#8216;little&#8217;<br>EOF<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">$ meson setup build &#8211;cross-file mxe-cross.txt &#8211;prefix=\/home\/ubuntu\/mxe\/usr\/x86_64-w64-mingw32.static &#8211;default-library=static<br>$ ninja -C build install<br>$ x86_64-w64-mingw32.static-pkg-config &#8211;modversion slirp<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">$ cd ~<br>$ git clone https:\/\/gitlab.freedesktop.org\/spice\/spice-protocol.git<br>$ cd spice-protocol<br>$ meson setup build &#8211;prefix=\/tmp\/spice-protocol-install<br>$ ninja -C build install<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">$ cp -r \/tmp\/spice-protocol-install\/include\/spice-1 ~\/mxe\/usr\/x86_64-w64-mingw32.static\/include\/<br>$ cp \/tmp\/spice-protocol-install\/share\/pkgconfig\/spice-protocol.pc ~\/mxe\/usr\/x86_64-w64-mingw32.static\/lib\/pkgconfig\/<br>$ sed -i &#8220;s|\/tmp\/spice-protocol-install|\/home\/ubuntu\/mxe\/usr\/x86_64-w64-mingw32.static|g&#8221; ~\/mxe\/usr\/x86_64-w64-mingw32.static\/lib\/pkgconfig\/spice-protocol.pc<br>$ x86_64-w64-mingw32.static-pkg-config &#8211;modversion spice-protocol<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">$ cd ~<br>$ git clone https:\/\/gitlab.freedesktop.org\/gstreamer\/orc.git<br>$ cd orc<br>$ meson setup build &#8211;cross-file ~\/libslirp\/mxe-cross.txt &#8211;prefix=\/home\/ubuntu\/mxe\/usr\/x86_64-w64-mingw32.static &#8211;default-library=static<br>$ ninja -C build install<br>$ x86_64-w64-mingw32.static-pkg-config &#8211;modversion orc-0.4<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">&#8211; Let&#8217;s verify the full set before moving to spice-server itself, since a missed one there would be a much more expensive failure to debug:<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">$ for pkg in openssl zlib libjpeg opus orc-0.4 glib-2.0 pixman-1 liblz4; do echo -n &#8220;$pkg: &#8220;; x86_64-w64-mingw32.static-pkg-config &#8211;modversion $pkg 2&gt;&amp;1; done<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">$ cd ~<br>$ cat &gt;&gt; ~\/libslirp\/mxe-cross.txt &lt;&lt; &#8216;EOF&#8217;<br>$ EOF<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">$ sed -i &#8220;\/^c = \/a cpp = &#8216;x86_64-w64-mingw32.static-g++'&#8221; ~\/libslirp\/mxe-cross.txt<br>$ cat ~\/libslirp\/mxe-cross.txt<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">&#8211; the build might fail but keep going<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">$ wget https:\/\/www.spice-space.org\/download\/releases\/spice-server\/spice-0.15.2.tar.bz2<br>$ tar xjf spice-0.15.2.tar.bz2<br>$ cd ~\/spice-0.15.2<br>$ rm -rf build<br>$ meson setup build &#8211;cross-file ~\/libslirp\/mxe-cross.txt &#8211;prefix=\/home\/ubuntu\/mxe\/usr\/x86_64-w64-mingw32.static &#8211;default-library=static -Dgstreamer=no -Dlz4=true -Dsasl=false -Dsmartcard=disabled -Dmanual=false -Dstatistics=false -Dopus=enabled -Dspice-common:tests=false -Dtests=false -Dc_link_args=-Wl,&#8211;allow-multiple-definition<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">$ ninja -C build install<br>$ x86_64-w64-mingw32.static-pkg-config &#8211;modversion spice-server<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">$ cd<br>$ git clone https:\/\/git.qemu.org\/git\/qemu.git &#8211;depth 1<br>$ cd qemu<br>$ git submodule init<br>$ git submodule update &#8211;recursive<br>$ rm -rf build-win64<br>$ mkdir build-win64 &amp;&amp; cd ~\/qemu\/build-win64<br>$ ..\/configure &#8211;cross-prefix=x86_64-w64-mingw32.static- &#8211;target-list=x86_64-softmmu &#8211;extra-cflags=&#8221;-D__USE_MINGW_ANSI_STDIO=1 -Wno-error=format -Wno-error=suggest-attribute=format -Wno-error=format-extra-args -DLIBSLIRP_STATIC&#8221; &#8211;extra-ldflags=&#8221;-lstdc++&#8221; &#8211;enable-slirp &#8211;enable-spice &#8211;enable-gtk &#8211;enable-vnc &#8211;enable-whpx &#8211;audio-drv-list=dsound,sdl &#8211;enable-libusb &#8211;enable-sdl &#8211;prefix=~\/qemu-win<br>$ make -j$(nproc)<br>$ make install<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">$ cd ~\/qemu-win<br>$ find .\/ -iname &#8216;<em>.exe&#8217; -exec cp {} ~\/qemu-win\/ \\; mkdir ~\/qemu-win\/share cp ..\/pc-bios\/<\/em>.bin ..\/pc-bios\/<em>.rom .\/pc-bios\/<\/em>x86_64*.fd ~\/qemu-win\/share\/<br>$ cd ~<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">&#8211; if you are not intending to support VMs of the following archi when running QEMU on Windows, remove the support files<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">$ cd ~\/qemu-win\/<br>$ find .\/ -iname &#8216;<em>aarch64<\/em>&#8216; -exec rm -f {} \\;<br>$ find .\/ -iname &#8216;<em>riscv<\/em>&#8216; -exec rm -f {} \\;<br>$ find .\/ -iname &#8216;<em>loongarch64<\/em>&#8216; -exec rm -f {} \\;<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">&#8211; create a zip file of the QEMU files and you can copy it to a Windows host.<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">$ cd<br>$ tar czf ~\/qemu-win.tgz .\/qemu-win<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8211; You can transfer the zip file to your windows host, extract it into a folder such as C:\\qemu-win\\ and run qemu-system-x86_64.exe from there to create a VM<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">Sample command to create a Windows 10 VM on QEMU running on a Windows physical host &#8211; this command includes sound in the VM but not Camera.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">cd C:\\qemu\\<br>qemu-img create -f mypc.qcow2 35g<br>C:\\qemu\\qemu-system-x86_64.exe -accel whpx -cpu host,hv_relaxed,hv_vapic,hv_time -machine q35 -L C:\\qemu\\share -smbios type=0,vendor=&#8221;American Megatrends International,, LLC.&#8221;,version=&#8221;F10&#8243; -smbios type=1,manufacturer=&#8221;ASUSTeK COMPUTER INC.&#8221;,product=&#8221;PRIME Z790-A WIFI&#8221;,version=&#8221;Rev 1.xx&#8221;,serial=&#8221;1234567890&#8243; -smbios type=2,manufacturer=&#8221;ASUSTeK COMPUTER INC.&#8221;,product=&#8221;PRIME Z790-A WIFI&#8221;,version=&#8221;Rev 1.xx&#8221;,serial=&#8221;1234567890&#8243; -smbios type=3,manufacturer=&#8221;ASUSTeK COMPUTER INC.&#8221;,version=&#8221;Rev 1.xx&#8221;,serial=&#8221;1234567890&#8243; -netdev user,id=net0 -device e1000e,netdev=net0,mac=00:1A:2B:3C:4D:5E -drive file=C:\\qemu\\mypc.qcow2,if=none,id=drive-sata0,cache=writeback -device ide-hd,drive=drive-sata0,bus=ide.0,serial=&#8221;WDC-WD10EZEX-00BN7A0&#8243;,model=&#8221;Western Digital&#8221; -drive file=C:\\qemu\\Windows1022H2.iso,if=none,id=drive-cd0,media=cdrom -device ide-cd,drive=drive-cd0,bus=ide.1 -boot order=c,once=d,menu=on -m 16G -smp 4 -vga qxl -audiodev dsound,id=snd0 -device ich9-intel-hda -device hda-duplex,audiodev=snd0<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Compile QEMU for Linux (Red Hat variants) on Rocky 9.8 VM<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">&#8211; Download a disk image and create a VM from it:<br>$ mkdir \/VMs<br>$ cd \/VMs<br>$ wget https:\/\/dl.rockylinux.org\/pub\/rocky\/9\/images\/x86_64\/Rocky-9-GenericCloud-Base.latest.x86_64.qcow2 -O compiler.qcow2<br>$ qemu-img resize compiler.qcow2 30G<br>$ cat user-data<br># cloud-config<br>user: vmuser<br>password: xxxxx123!<br>chpasswd: { expire: False }<br>ssh_pwauth: True<br># Automatically updates the repositories and installs ping on first boot<br>packages:<br>  &#8211; python3.14<br>$<br>$ id<br>uid=1000(aitayemi) gid=1000(aitayemi) groups=1000(aitayemi),10(wheel),36(kvm),980(docker)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">$ sudo virt-install &#8211;name compiler &#8211;memory 8192 &#8211;vcpus 4 &#8211;disk compiler.qcow2,format=qcow2 &#8211;os-variant rhel9.8 &#8211;import &#8211;graphics none &#8211;network default &#8211;cloud-init user-data=user-data<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">&#8211; login to the VM with the credentials from the user-data file<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">$ cat \/etc\/os-release | grep VERSION=<br>VERSION=&#8221;9.8 (Blue Onyx)&#8221;<br>$ df -h \/<br>Filesystem Size Used Avail Use% Mounted on<br>\/dev\/vda4 29G 1.3G 28G 5% \/<br>$ sudo dnf update -yq<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8211; install the full common set of QEMU build dependencies. On Rocky 9, this covers most of what QEMU needs. Also, python3.12 or higher is required:<br>$ sudo dnf install -y epel-release<br>$ sudo dnf config-manager &#8211;set-enabled crb<br>$ sudo dnf install -y &#8216;dnf-command(copr)&#8217;<br>$ sudo dnf copr enable -y ligenix\/enterprise-qemu-spice<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">$ sudo dnf groupinstall -y &#8220;Development Tools&#8221;<br>$ sudo dnf install -y glib2-devel pixman-devel zlib-devel ninja-build meson python3-devel python3-pip SDL2-devel libusb1-devel libusbx-devel usbredir-devel rdma-core-devel libibverbs-devel libslirp-devel gnutls-devel nettle-devel libcap-ng-devel libattr-devel pciutils-devel bzip2-devel snappy-devel libcurl-devel numactl-devel libaio-devel python3.14 spice-server-devel gtk3-devel alsa-lib-devel pulseaudio-libs-devel spice-server-devel wget<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8211; Switch the system from the default 3.9 to 3.14 as some of the utilities require version 3.12 or higher<br>$ sudo alternatives &#8211;install \/usr\/bin\/python3 python3 \/usr\/bin\/python3.14 1<br>$ sudo alternatives &#8211;set python3 \/usr\/bin\/python3.14<br>$ python -V<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">$ git clone https:\/\/git.qemu.org\/git\/qemu.git &#8211;depth 1<br>$ cd qemu<br>$ git submodule init<br>$ git submodule update &#8211;recursive<br>$ rm -rf build<br>$ mkdir build &amp;&amp; cd build<br>$ ..\/configure &#8211;target-list=x86_64-softmmu &#8211;extra-cflags=&#8221;-D__USE_MINGW_ANSI_STDIO=1 -Wno-error=format -Wno-error=suggest-attribute=format -Wno-error=format-extra-args -DLIBSLIRP_STATIC&#8221; &#8211;extra-ldflags=&#8221;-lstdc++&#8221; &#8211;enable-slirp &#8211;enable-spice &#8211;enable-gtk &#8211;enable-vnc &#8211;enable-alsa &#8211;enable-pa &#8211;prefix=\/opt\/qemu<br>$ make -j$(nproc)<br>$ sudo make install<br>$ cd \/<br>$ tar czf ~\/qemu-linux.tgz .\/opt\/qemu<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8211; You can copy the qemu-linux.zip to another physical Linux system\/host for use to create VMs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Running Windows 10 VM on CentOS Stream 9 host (with audio and camera access in the VM)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">&#8211; Get the Vendor and device ID of the Camera on the physical host<br>$ lsusb | grep -i cam<br>Bus 003 Device 002: ID 1bcf:2ba9 Sunplus Innovation Technology Inc. Integrated_Webcam_FHD<br>$<br>$ lsusb -d 1bcf:2ba9<br>Bus 003 Device 002: ID 1bcf:2ba9 Sunplus Innovation Technology Inc. Integrated_Webcam_FHD<br>$<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8211; create the UDEV rule to enable access to the camera using its vendor and device ID<br>$ sudo tee \/etc\/udev\/rules.d\/99-qemu-usb.rules &lt;&lt;&#8216;EOF&#8217;<br>SUBSYSTEM==&#8221;usb&#8221;, ATTR{idVendor}==&#8221;1bcf&#8221;, ATTR{idProduct}==&#8221;2ba9&#8243;, MODE=&#8221;0666&#8243;, GROUP=&#8221;kvm&#8221;<br>EOF<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">$ sudo udevadm control &#8211;reload-rules<br>$ sudo udevadm trigger<br>$ ls -l \/dev\/video*<br>crw-rw&#8212;-+ 1 root kvm 81, 0 Sep 25 21:54 \/dev\/video0<br>crw-rw&#8212;-+ 1 root kvm 81, 1 Sep 25 21:54 \/dev\/video1<br>crw-rw&#8212;-+ 1 root kvm 81, 2 Sep 25 21:54 \/dev\/video2<br>crw-rw&#8212;-+ 1 root kvm 81, 3 Sep 25 21:54 \/dev\/video3<br>$<br>$ ls -l \/dev\/bus\/usb\/003\/002<br>crw-rw&#8212;- 1 root kvm 189, 257 Sep 25 21:18 \/dev\/bus\/usb\/003\/002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">$ cd \/opt\/qemu\/bin<br>$ .\/qemu-system-x86_64 -accel kvm \\<br>-cpu host,hv_relaxed,hv_vapic,hv_time \\<br>-machine q35 \\<br>-L \/opt\/qemu\/share\/qemu \\<br>-smbios type=0,vendor=&#8221;American Megatrends International,, LLC.&#8221;,version=&#8221;F10&#8243; \\<br>-smbios type=1,manufacturer=&#8221;ASUSTeK COMPUTER INC.&#8221;,product=&#8221;PRIME Z790-A WIFI&#8221;,version=&#8221;Rev 1.xx&#8221;,serial=&#8221;1234567890&#8243; \\<br>-smbios type=2,manufacturer=&#8221;ASUSTeK COMPUTER INC.&#8221;,product=&#8221;PRIME Z790-A WIFI&#8221;,version=&#8221;Rev 1.xx&#8221;,serial=&#8221;1234567890&#8243; \\<br>-smbios type=3,manufacturer=&#8221;ASUSTeK COMPUTER INC.&#8221;,version=&#8221;Rev 1.xx&#8221;,serial=&#8221;1234567890&#8243; \\<br>-netdev user,id=net0 \\<br>-device e1000e,netdev=net0,mac=00:1A:2B:3C:4D:5E \\<br>-drive file=~\/mypc.qcow2,if=none,id=drive-sata0,cache=writeback,format=raw \\<br>-device ide-hd,drive=drive-sata0,bus=ide.0,serial=&#8221;WDC-WD10EZEX-00BN7A0&#8243;,model=&#8221;Western Digital&#8221; \\<br>-drive file=\/VMs\/Windows1022H2.iso,if=none,id=drive-cd0,media=cdrom -device ide-cd,drive=drive-cd0,bus=ide.1 \\<br>-boot order=c,once=d,menu=on \\<br>-m 16G -smp 4 -vga qxl \\<br>-audiodev sdl,id=snd0 -device ich9-intel-hda -device hda-micro,audiodev=snd0 -device nec-usb-xhci,id=usbctrl \\<br>-device usb-host,bus=usbctrl.0,vendorid=0x1BCF,productid=0x2BA9,suppress-remote-wake=on,pipeline=off<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">NOTE:<br>During the Windows 10 installation in the VM, Activation may fail with &#8220;Something went wrong: But you can try again&#8221;. OOBELOCAL &#8211; likely due to Windows not recognizing the NIC<br>Solution:<br>&#8211; On the error screen, Use the New Local Account Command: Press Shift + F10 (or Fn + Shift + F10) on the Microsoft account screen to open the Command Prompt.&nbsp;<br>&#8211; Click on the black Command Prompt window to make sure it is active.&nbsp;<br>&#8211; Type start ms-cxh:localonly and press Enter.&nbsp;<br>&#8211; This opens the local account setup prompt so you can create a offline username.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8211; The above launches the QEMU GUI on my X-Server since I am connected to the Linux server remotely using SSH from Mobaxterm on a Windows client<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Running QEMU on Windows &#8211; (remove &#8220;once=d,&#8221; and the &#8220;-drrve&#8221; parameter for CDROM if not using an ISO image or you already set up the O\/S on the VM)<\/li>\n\n\n\n<li>alternative virtual machine definition:<br>-smbios type=1,manufacturer=&#8221;Dell Inc.&#8221;,product=&#8221;OptiPlex 7090&#8243;,version=&#8221;1.0&#8243;,serial=&#8221;ABC123XYZ&#8221; -smbios type=2,manufacturer=&#8221;Dell Inc.&#8221;,product=&#8221;0XYZ12&#8243;,version=&#8221;A01&#8243; -smbios type=3,manufacturer=&#8221;Dell Inc.&#8221;<\/li>\n\n\n\n<li>Even the respondus lockdown browser was unable to detect it was in a VM<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Compile QEMU for Ubuntu<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">&#8211; Download a disk image and create a VM from it:<br>$ mkdir \/VMs<br>$ cd \/VMs<br>$ wget https:\/\/cloud-images.ubuntu.com\/minimal\/releases\/noble\/release\/ubuntu-24.04-minimal-cloudimg-amd64.img -O compiler.qcow2<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">&#8211; increase the size of the disk as it is only 3.5G<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">$ qemu-img resize compiler.qcow2 30g<br>$ cat >> user-data &lt;&lt; EOF<br>cloud-config<br>user: ubuntu<br>password: xxxxx123!<br>chpasswd: { expire: False }<br>ssh_pwauth: True<br># Automatically updates the repositories and installs ping on first boot<br>packages:<br>  &#8211; iputils-ping<br>EOF<br>$<br>$ sudo usermod -aG libvirt $USER<br>$ newgrp libvirt<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">&#8211; create the VM<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">$ sudo virt-install &#8211;name compiler &#8211;memory 8192 &#8211;vcpus 4 &#8211;disk compiler.qcow2,format=qcow2 &#8211;os-variant ubuntu24.04 &#8211;import &#8211;graphics none &#8211;network default &#8211;cloud-init user-data=user-data<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">&#8211; login to the Ubuntu VM with the credentials from the user-data file<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">ubuntu@ubuntu:~\/qemu$ cat \/etc\/os-release | grep VERSION=<br>VERSION=&#8221;24.04.5 LTS (Noble Numbat)&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">$ echo &#8220;export TERM=vt220&#8221; &gt;&gt; ~\/.bashrc<br>$ echo &#8220;set enable-bracketed-paste off&#8221; &gt;&gt; ~\/.bashrc<br>$ echo &#8220;export PS1='[\\u@\\h \\W]\\$'&#8221; &gt;&gt; ~\/.bashrc<br>$ echo &#8220;PS2=&#8217;&gt;'&#8221; &gt;&gt; ~\/.bashrc<br>$ source ~\/.bashrc<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">$ sudo apt update -y<br>$ sudo apt upgrade -y<br>$ sudo apt install -y mingw-w64<br>$ sudo apt install -y software-properties-common<br>$ sudo add-apt-repository -c universe -y<br>$ sudo apt update -y<br>$ sudo apt upgrade -y<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">$ DEBIAN_FRONTEND=noninteractive sudo -E apt install -y autoconf automake autopoint bash bison bzip2 flex gettext git g++ gperf intltool libc6-dev-i386 libgdk-pixbuf2.0-dev libltdl-dev libgl-dev libpcre3-dev libssl-dev libtool-bin libxml-parser-perl lzip make openssl p7zip-full patch perl pkg-config python3 python3-mako python3-pkg-resources ruby sed unzip wget xz-utils g++-multilib python-is-python3 python3-venv vim meson libusb-1.0-0-dev libibverbs-dev librdmacm-dev libcacard-dev libusbredirparser-dev libusb-1.0-0-dev<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">&#8211; IF prompted for keyboard layout, enter 35 (English US) or 34 (English UK) for country of origin, then 1 (English US) for keyboard layout<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">$ cd<br>$ sudo apt install -y build-essential ninja-build meson pkg-config libglib2.0-dev libpixman-1-dev libgtk-3-dev libvncserver-dev libslirp-dev libspice-server-dev libspice-protocol-dev libsdl2-dev libssl-dev zlib1g-dev<br>$ rm -rf qemu<br>$ git clone https:\/\/git.qemu.org\/git\/qemu.git &#8211;depth 1<br>$ cd qemu<br>$ git submodule init<br>$ git submodule update &#8211;recursive<br>$ rm -rf build<br>$ mkdir build &amp;&amp; cd build<br>$ ..\/configure &#8211;target-list=x86_64-softmmu &#8211;extra-cflags=&#8221;-D__USE_MINGW_ANSI_STDIO=1 -Wno-error=format -Wno-error=suggest-attribute=format -Wno-error=format-extra-args -DLIBSLIRP_STATIC&#8221; &#8211;extra-ldflags=&#8221;-lstdc++&#8221; &#8211;enable-slirp &#8211;enable-spice &#8211;enable-gtk &#8211;enable-vnc &#8211;prefix=\/opt\/qemu<br>$ make -j$(nproc)<br>$ sudo make install<br>$ cd \/<br>$ tar czf ~\/qemu-linux.tgz .\/opt\/qemu<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You can copy the qemu-linux.zip to another Linux physical host for use if necessary.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Running Windows 10 VM on Ubuntu host (with audio and camera access in the VM)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">&#8211; Get the Vendor and device ID of the Camera on the physical host<br>$ lsusb | grep -i cam<br>Bus 003 Device 002: ID 1bcf:2ba9 Sunplus Innovation Technology Inc. Integrated_Webcam_FHD<br>$<br>$ lsusb -d 1bcf:2ba9<br>Bus 003 Device 002: ID 1bcf:2ba9 Sunplus Innovation Technology Inc. Integrated_Webcam_FHD<br>$<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8211; create the UDEV rule to enable access to the camera using its vendor and device ID<br>$ sudo tee \/etc\/udev\/rules.d\/99-qemu-usb.rules &lt;&lt;&#8216;EOF&#8217;<br>SUBSYSTEM==&#8221;usb&#8221;, ATTR{idVendor}==&#8221;1bcf&#8221;, ATTR{idProduct}==&#8221;2ba9&#8243;, MODE=&#8221;0666&#8243;, GROUP=&#8221;kvm&#8221;<br>EOF<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">$ sudo udevadm control &#8211;reload-rules<br>$ sudo udevadm trigger<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">$ ls -l \/dev\/video*<br>crw-rw&#8212;-+ 1 root kvm 81, 0 Sep 25 21:54 \/dev\/video0<br>crw-rw&#8212;-+ 1 root kvm 81, 1 Sep 25 21:54 \/dev\/video1<br>crw-rw&#8212;-+ 1 root kvm 81, 2 Sep 25 21:54 \/dev\/video2<br>crw-rw&#8212;-+ 1 root kvm 81, 3 Sep 25 21:54 \/dev\/video3<br>$<br>$ ls -l \/dev\/bus\/usb\/003\/002<br>crw-rw&#8212;- 1 root kvm 189, 257 Sep 25 21:18 \/dev\/bus\/usb\/003\/002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">$ cd \/opt\/qemu\/bin<br>$ .\/qemu-system-x86_64 -accel kvm \\<br>-cpu host,hv_relaxed,hv_vapic,hv_time \\<br>-machine q35 \\<br>-L \/opt\/qemu\/share\/qemu \\<br>-smbios type=0,vendor=&#8221;American Megatrends International,, LLC.&#8221;,version=&#8221;F10&#8243; \\<br>-smbios type=1,manufacturer=&#8221;ASUSTeK COMPUTER INC.&#8221;,product=&#8221;PRIME Z790-A WIFI&#8221;,version=&#8221;Rev 1.xx&#8221;,serial=&#8221;1234567890&#8243; \\<br>-smbios type=2,manufacturer=&#8221;ASUSTeK COMPUTER INC.&#8221;,product=&#8221;PRIME Z790-A WIFI&#8221;,version=&#8221;Rev 1.xx&#8221;,serial=&#8221;1234567890&#8243; \\<br>-smbios type=3,manufacturer=&#8221;ASUSTeK COMPUTER INC.&#8221;,version=&#8221;Rev 1.xx&#8221;,serial=&#8221;1234567890&#8243; \\<br>-netdev user,id=net0 \\<br>-device e1000e,netdev=net0,mac=00:1A:2B:3C:4D:5E \\<br>-drive file=~\/mypc.qcow2,if=none,id=drive-sata0,cache=writeback,format=raw \\<br>-device ide-hd,drive=drive-sata0,bus=ide.0,serial=&#8221;WDC-WD10EZEX-00BN7A0&#8243;,model=&#8221;Western Digital&#8221; \\<br>-drive file=\/VMs\/Windows1022H2.iso,if=none,id=drive-cd0,media=cdrom -device ide-cd,drive=drive-cd0,bus=ide.1 \\<br>-boot order=c,once=d,menu=on \\<br>-m 16G -smp 4 -vga qxl \\<br>-audiodev sdl,id=snd0 -device ich9-intel-hda -device hda-micro,audiodev=snd0 -device nec-usb-xhci,id=usbctrl \\<br>-device usb-host,bus=usbctrl.0,vendorid=0x1BCF,productid=0x2BA9,suppress-remote-wake=on,pipeline=off<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">NOTE:<br>During the Windows 10 installation in the VM, Activation may fail with &#8220;Something went wrong: But you can try again&#8221;. OOBELOCAL &#8211; likely due to Windows not recognizing the NIC<br>Solution:<br>&#8211; On the error screen, Use the New Local Account Command: Press Shift + F10 (or Fn + Shift + F10) on the Microsoft account screen to open the Command Prompt.&nbsp;<br>&#8211; Click on the black Command Prompt window to make sure it is active.&nbsp;<br>&#8211; Type start ms-cxh:localonly and press Enter.&nbsp;<br>&#8211; This opens the local account setup prompt so you can create a offline username.&nbsp;<br>&#8211; The above launches the QEMU GUI on my X-Server since I am connected to the Linux server remotely using SSH from Mobaxterm on a Windows client<br>&#8211; Running QEMU on Windows &#8211; (remove &#8220;once=d,&#8221; and the &#8220;-drrve&#8221; parameter for CDROM if not using an ISO image or you already set up the O\/S on the VM)<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Alternative virtual machine definition:<br>-smbios type=1,manufacturer=&#8221;Dell Inc.&#8221;,product=&#8221;OptiPlex 7090&#8243;,version=&#8221;1.0&#8243;,serial=&#8221;ABC123XYZ&#8221; -smbios type=2,manufacturer=&#8221;Dell Inc.&#8221;,product=&#8221;0XYZ12&#8243;,version=&#8221;A01&#8243; -smbios type=3,manufacturer=&#8221;Dell Inc.&#8221;<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Running QEMU on Linux (CentOS Stream 9) &#8211; Windows 10 VM (with audio and camera access in the VM)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">$ cd \/opt\/qemu\/bin<br>$ qemu-img create -f \/opt\/qemu\/mypc.qcow2 35g<br>$ .\/qemu-system-x86_64 -accel kvm \\<br>-cpu host,kvm=off,-hypervisor,hv_vendor_id=null,hv_relaxed,hv_vapic,hv_time \\<br>-machine q35 \\<br>-L \/opt\/qemu \\<br>-smbios type=0,vendor=&#8221;American Megatrends International,, LLC.&#8221;,version=&#8221;F10&#8243; \\<br>-smbios type=1,manufacturer=&#8221;ASUSTeK COMPUTER INC.&#8221;,product=&#8221;PRIME Z790-A WIFI&#8221;,version=&#8221;Rev 1.xx&#8221;,serial=&#8221;1234567890&#8243; \\<br>-smbios type=2,manufacturer=&#8221;ASUSTeK COMPUTER INC.&#8221;,product=&#8221;PRIME Z790-A WIFI&#8221;,version=&#8221;Rev 1.xx&#8221;,serial=&#8221;1234567890&#8243; \\<br>-smbios type=3,manufacturer=&#8221;ASUSTeK COMPUTER INC.&#8221;,version=&#8221;Rev 1.xx&#8221;,serial=&#8221;1234567890&#8243; \\<br>-netdev user,id=net0 \\<br>-device e1000e,netdev=net0,mac=00:1A:2B:3C:4D:5E \\<br>-drive file=\/opt\/mypc.qcow2,if=none,id=drive-sata0,cache=writeback \\<br>-device ide-hd,drive=drive-sata0,bus=ide.0,serial=&#8221;WDC-WD10EZEX-00BN7A0&#8243;,model=&#8221;Western Digital&#8221; \\<br>-drive file=\/VMs\/Windows1022H2.iso,if=none,id=drive-cd0,media=cdrom -device ide-cd,drive=drive-cd0,bus=ide.1 \\<br>-drive file=\/VMs\/Windows1022H2.iso,if=none,id=drive-cd0,media=cdrom \\<br>-boot order=c,once=d,menu=on \\<br>-m 16G \\<br>-smp 4 \\<br>-vga qxl<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">NOTE: As you go through the installation wizard, Windows (10) Activation may fail with &#8220;Something went wrong: But you can try again&#8221;. OOBELOCAL &#8211; likely due to Windows not recognizing the NIC<br>On the error screen, Use the &#8220;New Local Account Command&#8221;: Press Shift + F10 (or Fn + Shift + F10) on the Microsoft account screen to open the Command Prompt.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Click on the black Command Prompt window to make sure it is active.&nbsp;<br>Type start ms-cxh:localonly and press Enter.&nbsp;<br>This opens the local account setup prompt so you can create a offline username.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is also possible that every time the installation needs to restart, it just hangs on a black screen after initiating the shutdown. Just terminate the QEMU process (or close the window) and launch it again, the installation will continue from where it previously left off.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The above VM creation command launches the QEMU GUI on my Mobaterm X-Server since I am connected to the physical Linux server remotely using SSH from Mobaxterm on a Windows system.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Alternative machine definition:<br>-smbios type=1,manufacturer=&#8221;Dell Inc.&#8221;,product=&#8221;OptiPlex 7090&#8243;,version=&#8221;1.0&#8243;,serial=&#8221;ABC123XYZ&#8221; -smbios type=2,manufacturer=&#8221;Dell Inc.&#8221;,product=&#8221;0XYZ12&#8243;,version=&#8221;A01&#8243; -smbios type=3,manufacturer=&#8221;Dell Inc.&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Running QEMU on Windows 11 &#8211; Windows 10 VM<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">cd C:\\qemu-win<br>qemu-img.exe create -f mypc.qcow2 35g<br>qemu-system-x86_64.exe -accel whpx -cpu host,hv_relaxed,hv_vapic,hv_time -machine q35 -L C:\\qemu-win\\share -smbios type=0,vendor=&#8221;American Megatrends International,, LLC.&#8221;,version=&#8221;F10&#8243; -smbios type=1,manufacturer=&#8221;ASUSTeK COMPUTER INC.&#8221;,product=&#8221;PRIME Z790-A WIFI&#8221;,version=&#8221;Rev 1.xx&#8221;,serial=&#8221;1234567890&#8243; -smbios type=2,manufacturer=&#8221;ASUSTeK COMPUTER INC.&#8221;,product=&#8221;PRIME Z790-A WIFI&#8221;,version=&#8221;Rev 1.xx&#8221;,serial=&#8221;1234567890&#8243; -smbios type=3,manufacturer=&#8221;ASUSTeK COMPUTER INC.&#8221;,version=&#8221;Rev 1.xx&#8221;,serial=&#8221;1234567890&#8243; -netdev user,id=net0 -device e1000e,netdev=net0,mac=00:1A:2B:3C:4D:5E -drive file=C:\\qemu-win\\mypc.qcow2,if=none,id=drive-sata0,cache=writeback -device ide-hd,drive=drive-sata0,bus=ide.0,serial=&#8221;WDC-WD10EZEX-00BN7A0&#8243;,model=&#8221;Western Digital&#8221; -boot order=c,once=d,menu=on -m 16G -smp 4 -vga qxl -audiodev dsound,id=snd0 -device ich9-intel-hda -device hda-micro,audiodev=snd0 -device nec-usb-xhci,id=usbctrl -device usb-host,bus=usbctrl.0,vendorid=0x1BCF,productid=0x2BA9<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">NOTE: the QEMU command must be executed from an elevated permission (run as adminstrator) command prompt if you want networking in the VM<br>NOTE: restart intiated from Windows may not always work. it just hangs instead (QEMU throws the error &#8211; qemu: WHPX: Unexpected VP exit code 4). if this happens, just close QEMU, and relaunch ir again.<br>NOTE: Sound (speaker and microphone works) but camera is not detected.<br>NOTE: you may remove &#8220;once=d,&#8221; and the &#8220;-drive&#8221; parameter for CDROM if not using an ISO image or you already set up the O\/S on the VM)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>QEMU (Quick Emulator) is a free, open-source program that acts as a machine emulator and virtualizer to run different operating systems and programs. QEMU emulates computer hardware (such as hard drives, network cards, and graphics controllers) and runs the actual &hellip; <a href=\"https:\/\/www.itayemi.com\/blog\/2026\/09\/24\/compiling-qemu-from-source\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":336,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[1517,1515,1422,1441,1142,1518,1376,1314,1516],"class_list":["post-2649","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-anti-vm","tag-cross-compiling","tag-kvm","tag-libvirtd","tag-linux","tag-meson","tag-qemu","tag-ubuntu","tag-virtualization"],"_links":{"self":[{"href":"https:\/\/www.itayemi.com\/blog\/wp-json\/wp\/v2\/posts\/2649","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itayemi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itayemi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itayemi.com\/blog\/wp-json\/wp\/v2\/users\/336"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itayemi.com\/blog\/wp-json\/wp\/v2\/comments?post=2649"}],"version-history":[{"count":17,"href":"https:\/\/www.itayemi.com\/blog\/wp-json\/wp\/v2\/posts\/2649\/revisions"}],"predecessor-version":[{"id":2676,"href":"https:\/\/www.itayemi.com\/blog\/wp-json\/wp\/v2\/posts\/2649\/revisions\/2676"}],"wp:attachment":[{"href":"https:\/\/www.itayemi.com\/blog\/wp-json\/wp\/v2\/media?parent=2649"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itayemi.com\/blog\/wp-json\/wp\/v2\/categories?post=2649"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itayemi.com\/blog\/wp-json\/wp\/v2\/tags?post=2649"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}