Compiling QEMU 10.2.2 for Ubuntu 24.04 LTS
https://askubuntu.com/questions/1565777/compiling-qemu-10-2-2-for-ubuntu-24-04-lts
Since Ubuntu 24.04LTS offers a very old version of QEMU I decided to compile the latest stable source from:
https://download.qemu.org/qemu-10.2.2.tar.xz
To compile his code I used:
mkdir build && cd build
../configure --enable-kvm --enable-sdl --enable-spice --enable-slirp --enable-usb-redir --enable-libusb \
--target-list=x86_64-softmmu
Of course I had to install several packages as:
sudo apt install python3-sphinx
sudo apt install python3-sphinx_rtd_theme
sudo apt install ninja-build -y
sudo apt-get install libglib2.0-dev
sudo apt-get install libglib2.0-dev
sudo apt install flex -y
sudo apt install bison -y
sudo apt-get install libpixman-1-dev libspice-protocol-dev libspice-server-dev
sudo apt-get install libsdl2-dev
sudo apt-get install libusb-1.0-0-dev libusbredirparser-dev libusbredirhost-dev
I also modified: /etc/libvirt/qemu.conf
to have at the end of this file:
emulatorpath = "/usr/local/bin/qemu-system-x86_64"
I also did:
sudo usermod -aG kvm,libvirt $USER
and finally to compile and install:
make -j$(nproc)
sudo make install
I edited my path to have:
export PATH=$PATH:/usr/local/bin
since the installtion places qemu executables at /usr/local/bin
$ ls -l /usr/local/bin
total 2308228
lrwxrwxrwx 1 root root 22 Mar 1 2025 nsys -> /etc/alternatives/nsys
lrwxrwxrwx 1 root root 25 Mar 1 2025 nsys-ui -> /etc/alternatives/nsys-ui
-rwxr-xr-x 1 root root 39461328 Apr 17 01:34 qemu-aarch64
-rwxr-xr-x 1 root root 39557224 Apr 17 01:35 qemu-aarch64_be
-rwxr-xr-x 1 root root 12175176 Apr 17 01:35 qemu-alpha
-rwxr-xr-x 1 root root 21312432 Apr 17 01:36 qemu-arm
-rwxr-xr-x 1 root root 21434288 Apr 17 01:36 qemu-armeb
-rwxr-xr-x 1 root root 2529984 Apr 17 02:52 qemu-edid
-rwxr-xr-x 1 root root 3836904 Apr 17 02:52 qemu-ga
-rwxr-xr-x 1 root root 22368288 Apr 17 01:37 qemu-hexagon
-rwxr-xr-x 1 root root 12876552 Apr 17 01:37 qemu-hppa
-rwxr-xr-x 1 root root 15575016 Apr 17 01:37 qemu-i386
-rwxr-xr-x 1 root root 10717352 Apr 17 02:52 qemu-img
-rwxr-xr-x 1 root root 10483576 Apr 17 02:52 qemu-io
-rwxr-xr-x 1 root root 2995888 Apr 17 02:52 qemu-keymap
-rwxr-xr-x 1 root root 17543800 Apr 17 01:37 qemu-loongarch64
-rwxr-xr-x 1 root root 13221784 Apr 17 01:37 qemu-m68k
-rwxr-xr-x 1 root root 12358184 Apr 17 01:37 qemu-microblaze
-rwxr-xr-x 1 root root 12257808 Apr 17 01:38 qemu-microblazeel
-rwxr-xr-x 1 root root 18589984 Apr 17 01:38 qemu-mips
-rwxr-xr-x 1 root root 18934112 Apr 17 01:38 qemu-mips64
-rwxr-xr-x 1 root root 18837040 Apr 17 01:39 qemu-mips64el
-rwxr-xr-x 1 root root 18490008 Apr 17 01:39 qemu-mipsel
-rwxr-xr-x 1 root root 19004248 Apr 17 01:39 qemu-mipsn32
-rwxr-xr-x 1 root root 18897880 Apr 17 01:40 qemu-mipsn32el
-rwxr-xr-x 1 root root 11483552 Apr 17 02:52 qemu-nbd
-rwxr-xr-x 1 root root 12268736 Apr 17 01:40 qemu-or1k
-rwxr-xr-x 1 root root 18017784 Apr 17 01:40 qemu-ppc
-rwxr-xr-x 1 root root 18369008 Apr 17 01:40 qemu-ppc64
-rwxr-xr-x 1 root root 18275944 Apr 17 01:41 qemu-ppc64le
-rwxr-xr-x 1 root root 4037752 Apr 17 02:52 qemu-pr-helper
-rwxr-xr-x 1 root root 20331808 Apr 17 01:41 qemu-riscv32
-rwxr-xr-x 1 root root 20642808 Apr 17 01:42 qemu-riscv64
-rwxr-xr-x 1 root root 14635728 Apr 17 01:42 qemu-s390x
-rwxr-xr-x 1 root root 12250120 Apr 17 01:42 qemu-sh4
-rwxr-xr-x 1 root root 12339144 Apr 17 01:42 qemu-sh4eb
-rwxr-xr-x 1 root root 12840424 Apr 17 01:42 qemu-sparc
-rwxr-xr-x 1 root root 13442920 Apr 17 01:42 qemu-sparc32plus
-rwxr-xr-x 1 root root 13376584 Apr 17 01:42 qemu-sparc64
-rwxr-xr-x 1 root root 13571816 Apr 17 02:52 qemu-storage-daemon
-rwxr-xr-x 1 root root 116882456 Apr 17 01:45 qemu-system-aarch64
-rwxr-xr-x 1 root root 52359936 Apr 17 01:45 qemu-system-alpha
-rwxr-xr-x 1 root root 95772416 Apr 17 01:46 qemu-system-arm
-rwxr-xr-x 1 root root 33879656 Apr 17 01:46 qemu-system-avr
-rwxr-xr-x 1 root root 53317136 Apr 17 01:46 qemu-system-hppa
-rwxr-xr-x 1 root root 80874232 Apr 17 01:47 qemu-system-i386
-rwxr-xr-x 1 root root 62130704 Apr 17 01:47 qemu-system-loongarch64
-rwxr-xr-x 1 root root 41044560 Apr 17 01:47 qemu-system-m68k
-rwxr-xr-x 1 root root 35236992 Apr 17 01:47 qemu-system-microblaze
-rwxr-xr-x 1 root root 35239360 Apr 17 01:47 qemu-system-microblazeel
-rwxr-xr-x 1 root root 60581136 Apr 17 01:48 qemu-system-mips
-rwxr-xr-x 1 root root 61566080 Apr 17 01:48 qemu-system-mips64
-rwxr-xr-x 1 root root 65288816 Apr 17 01:49 qemu-system-mips64el
-rwxr-xr-x 1 root root 60492144 Apr 17 01:49 qemu-system-mipsel
-rwxr-xr-x 1 root root 52019168 Apr 17 01:49 qemu-system-or1k
-rwxr-xr-x 1 root root 65632512 Apr 17 01:50 qemu-system-ppc
-rwxr-xr-x 1 root root 72287376 Apr 17 01:50 qemu-system-ppc64
-rwxr-xr-x 1 root root 66706088 Apr 17 01:51 qemu-system-riscv32
-rwxr-xr-x 1 root root 67065288 Apr 17 01:52 qemu-system-riscv64
-rwxr-xr-x 1 root root 34349728 Apr 17 01:52 qemu-system-rx
-rwxr-xr-x 1 root root 51494648 Apr 17 01:52 qemu-system-s390x
-rwxr-xr-x 1 root root 52246760 Apr 17 01:52 qemu-system-sh4
-rwxr-xr-x 1 root root 52337296 Apr 17 01:52 qemu-system-sh4eb
-rwxr-xr-x 1 root root 36288592 Apr 17 01:52 qemu-system-sparc
-rwxr-xr-x 1 root root 53588112 Apr 17 01:53 qemu-system-sparc64
-rwxr-xr-x 1 root root 34714872 Apr 17 01:53 qemu-system-tricore
-rwxr-xr-x 1 root root 84493168 Apr 17 02:53 qemu-system-x86_64
-rwxr-xr-x 1 root root 61588848 Apr 17 01:54 qemu-system-xtensa
-rwxr-xr-x 1 root root 61418928 Apr 17 01:55 qemu-system-xtensaeb
-rwxr-xr-x 1 root root 4005800 Apr 17 02:52 qemu-vmsr-helper
-rwxr-xr-x 1 root root 15485784 Apr 17 01:43 qemu-x86_64
-rwxr-xr-x 1 root root 21922456 Apr 17 01:43 qemu-xtensa
-rwxr-xr-x 1 root root 21754032 Apr 17 01:44 qemu-xtensaeb
I got all running with the some problems:
Error launching details: Host does not support virtualization type 'hvm' for architecture 'x86_64'
Another error I have related to an Ubuntu noble patch, etc.
Also, if I want to create a new VM I get the next two options for Architecture: cris and ppc64le
I have some VMs that for some reason even when they report the error they are able to run but most of the others simply crash.
Any suggestions? I will be placing some more info if necessary
Thanks in advance