[Slackbuilds-users] qemu updates roadmap

KB_SBo sbo at linuxgalaxy.org
Wed May 31 17:34:22 UTC 2023


On 5/30/23 21:00, Lockywolf wrote:
> 
> I cannot build qemu from SBo on a clean Slackware64.
> 
> 
> ../meson.build:1745:0: ERROR: Feature virtfs cannot be enabled: virtio-9p (virtfs) on Linux requires libcap-ng-devel and libattr-devel
> 
> building like  AUDIODRIVERS=pa VNC_ENABLE=no TARGETS=x86_64-linux-user bash qemu.SlackBuild
> 
> KB_SBo <sbo at linuxgalaxy.org> writes:
> 

Lockywolf,

Although already mentioned on IRC #slackbuilds, I'll reiterate on this 
list with a bit more clarity for those qemu users not one IRC (with 
proper grammar and spelling now that I have had some sleep).

There are two types of qemu target emulation: USER and SYSTEM.
<arch>-linux-user == user mode
<arch>-softmmu == system mode emulation.
The --enable-virtfs (virtio-9p) is not valid for user mode emulation (no 
system peripherals), and is valid only for system emulation. To compile 
for x86_64 to include all x86_64 features

TARGETS=x86_64-softmmu,x86_64-linux-user ./qemu.SlackBuild

to generate binaries qemu-system-x86_64 and qemu-x86_64 and supported 
function dependencies.

see also:
https://en.wikipedia.org/wiki/QEMU
https://www.qemu.org/docs/master/system/index.html
https://www.qemu.org/docs/master/user/index.html

qemu-system-x86_64: will emulate an entire computer, based on 
<arch>-softmmu choices on x86_64 host - all hardware.  This is the most 
common use case.

x86_64-linux-user; will only emulate the CPU - no hardware, same OS type.

user mode is when you need to run a specific program, compiled for a 
different instruction set, say linux x86 program on x86_64. (for 
x86_64-linux-user yo will be emulating an X86_64 CPU, which is 
nonsensical if compiled on an x86_64 host: use i386-linux-user instead. 
This is very different from emulating the entire Linux, Windows or Mac, 
etc, OS system (whole computer). So it depends on the type of emulation 
you need. You cannot run Windows x86[_64] program via user mode since 
only Linux/BSD are supported.  I expect most people want <arch>-softmmu 
and *NOT* <arch>-[linux,bsd]-user.

You stated:
kingbeowulf: I would still ask that this be added to README
Also since, I guess, many people would want to only compile qemu for 
x86_64. Because it is the most often used target.

Your statement misunderstands the user vs system target purpose and 
usage (as explained above). I'll add a README note about user targets vs 
system targets. Its a bit buried in the docs and I had forgotten it 
since I do not use user mode for my linux and windows quests running on 
Slackware64 host.

The qemu.Slackbuild is designed specifically for full system emulation 
and user mode is NOT SUPPORTED (by me).  If you want to compile just 
x86_64 target and shrink the package size:

TARGETS=x86_64-softmmu \
VNC_ENABLE=no \
SLIRP=no \
AUDIODRIVERS="" \
./qemu.SlackBuild

(SLIRP=yes default next update). Or edit the buildscript.

-kb


PS:
A possible interesting use case for Slackware64 to avoid multilib is to

TARGETS=x86_64-softmmu,i386-linux-user ./qemu.SlackBuild

then use qemu-i386 to run Linux x86 (32 bit) programs on pure x86_64.




More information about the SlackBuilds-users mailing list