site  contact  subhomenews

QEMU 7.1.0 compiled

November 03, 2022 — BarryK

EasyOS has QEMU in the repository. It is compiled in OpenEmbedded, with an existing build recipe. I have never compiled QEMU in a running system, and decided to do so, to explore the configure options. I noticed that the build recipe in OE is using a minimum of system libraries, so wanted to see if that can be improved.

I downloaded QEMU from here:

https://www.qemu.org/download/

Running Easy 4.4.93, which is a release candidate for 4.5, I installed these extra packages via the PKGget package manager:

dtc, sdl2-image, libvncserver, vte

Note, Easy already had 'vte9' which is for gtk2, whereas 'vte' is for gtk3. Then configured, compiled and installed:

# mkdir build
# cd build
# ../configure --prefix=/usr --target-list=aarch64-linux-user,aarch64-softmmu,x86_64-linux-user,x86_64-softmmu,i386-linux-user,i386-softmmu \
 --disable-werror --cpu=x86_64 --audio-drv-list=alsa,default,pa,sdl --bindir=/usr/bin --datadir=/usr/share --docdir=/usr/share/doc \
--enable-lto --enable-slirp=internal --firmwarepath=/usr/share/qemu-firmware --includedir=/usr/include --libdir=/usr/lib \
--libexecdir=/usr/libexec --localedir=/usr/share/locale --localstatedir=/var/local --mandir=/usr/share/man --sysconfdir=/etc \
--with-git=/bin/false --enable-alsa -enable-attr --enable-gio --enable-sdl --enable-sdl-image --enable-virtfs --enable-attr \
--enable-vnc --enable-curl --enable-curses --enable-gtk --enable-iconv --enable-keyring --enable-vte --enable-cap-ng \
--enable-gcrypt --enable-libusb --enable-fdt --enable-opengl --enable-lzo --enable-gnutls --enable-bzip2 --enable-kvm \
--enable-xkbcommon --enable-libudev --enable-pa --enable-png --enable-tools --enable-vhost-crypto --enable-vhost-kernel \
--enable-vhost-net --enable-vhost-user --enable-zstd --with-git-submodules=ignore
# make
# new2dir make install

It isn't essential, but I explicitly listed everything, so as to see any rejects. I had to remove "--enable-libssh" and "--enable-fuse". Package 'libssh2' is installed, so I don't know why that was a problem. The 'fuse3' package is required, whereas Easy only has 'fuse2', so I understand that one.

To do a quick test that it works, these instructions from Drew were very helpful:

https://drewdevault.com/2018/09/10/Getting-started-with-qemu.html

I did this:

# qemu-img create -f qcow2 april.qcow2 16G
# qemu-system-x86_64 -enable-kvm -m 2048 -nic user,model=virtio -drive file=april.qcow2,media=disk,if=virtio \
-cdrom april64-7.2.iso -display sdl

Good old April64, from the Quirky Linux days. Got a desktop:

img1

The plan is to create an SFS with QEMU and a GUI manager, all ready to go. However, firstly need to go back to the kernel; it looks like there are some configure options to enhance performance of KVM and QEMU. Also, will probably compile 'bridge-utils' and 'fuse3' packages.

EDIT 2022-11-07:
Recompiled, running Easy 4.4.94, a RC for 4.5, this time the configure is:

../configure --prefix=/usr --target-list=aarch64-linux-user,aarch64-softmmu,x86_64-linux-user,x86_64-softmmu,i386-linux-user,i386-softmmu \
--disable-werror --cpu=x86_64 --audio-drv-list=alsa,default,pa,sdl --bindir=/usr/bin --datadir=/usr/share --docdir=/usr/share/doc \
--enable-lto --enable-slirp=internal --firmwarepath=/usr/share/qemu-firmware --includedir=/usr/include --libdir=/usr/lib \
--libexecdir=/usr/libexec --localedir=/usr/share/locale --localstatedir=/var/local --mandir=/usr/share/man --sysconfdir=/etc \
--with-git=/bin/false --enable-alsa -enable-attr --enable-gio --enable-sdl --enable-sdl-image --enable-virtfs --enable-attr \
--enable-vnc --enable-curl --enable-curses --enable-gtk --enable-iconv --enable-keyring --enable-vte --enable-cap-ng --enable-gcrypt \
--enable-libusb --enable-fdt --enable-opengl --enable-lzo --enable-gnutls --enable-bzip2 --enable-kvm --enable-xkbcommon \
--enable-libudev --enable-pa --enable-png --enable-tools --enable-vhost-crypto --enable-vhost-kernel --enable-vhost-net \
--enable-vhost-user --enable-zstd --with-git-submodules=ignore

An SFS has been created and uploaded. As usual, click on the "sfs" icon to download and install it. The 'qemu_7.1.0_amd64.sfs' file is 48MB. It should work in earlier releases of Easy, as have included packages in the SFS that will be missing, such as dtc, sdl2-image and fuse3.     

Tags: easy