Reputation: 51229
I have build qemu-7.2.0
and then, when running it I am getting
qemu-system-x86_64: -nic user,model=virtio: network backend 'user' is not compiled into this binary
Apparently, I should enable this feature during build, but how to know which is it namely?
Upvotes: 8
Views: 10721
Reputation: 21
$ git clone https://gitlab.com/qemu-project/qemu.git
$ sudo apt-get install git libglib2.0-dev libfdt-dev libpixman-1-dev zlib1g-dev ninja-build meson
$ git clone https://gitlab.freedesktop.org/slirp/libslirp.git
$ cd libslirp
$ meson build
$ ninja -C build install
$ cd ..
$ cd qemu
$ mkdir -p bin/debug/native
$ cd bin/debug/native
$ ../../.././configure --enable-slirp --enable-debug
$ make -j$(nproc)
$ make install
$ cd ../../..
Upvotes: 1
Reputation: 11493
The 'user' networking backend is provided by the 'slirp' library; you get this message when the QEMU binary was built without slirp support compiled in.
As noted in the 7.2 changelog, QEMU no longer ships a copy of the slirp module with its sources. Instead you need to make sure you have installed your distro's libslirp development package (which is probably called libslirp-devel or libslirp-dev or something similar) before configuring and building QEMU. You need at least libslirp 4.7 or better.
QEMU's configure convention for optional features which require some build-time dependency is:
So you can pass configure --enable-slirp
to force it to give you an error if you haven't got the dependency, as a way of checking that you've installed the right system package for libslirp.
Upvotes: 14