Raspberry Pi 4 Model B Rev 1.5 ("raspi4b"): No keyboard input after booting; "raspi3b" works
Host environment
- Operating system:
Gentoo Linux - OS/kernel version:
Linux <hostname_censored> 6.12.21-gentoo #1 SMP PREEMPT_DYNAMIC Fri Apr 25 10:37:40 CEST 2025 x86_64 Intel(R) Core(TM) i5-3450 CPU @ 3.10GHz GenuineIntel GNU/Linux - Architecture:
x86_64 - QEMU flavor:
qemu-system-aarch64 - QEMU version: Master branch commit hash:
757a34115e7491744a63dfc3d291fd1de5297ee2 - QEMU command line:
Raspberry Pi 4 Model B Rev 1.5 (raspi4b):
- Keyboard inputs and
SSHconnection do not work:
$ qemu-system-aarch64 \
-vnc "unix:/run/user/$(id --user)/qemu-vnc.sock" \
-machine "raspi4b" \
-dtb "./rpi4_model_b_rev1.5/bcm2711-rpi-4-b_2024-11-19.dtb" \
-kernel "./kernel8_2024-11-19.img" \
-append "earlyprintk loglevel=8 root=/dev/mmcblk1p2 rootdelay=1 rw console=tty0,115200" \
-drive "file=./2024-11-19-raspios-bookworm-arm64-lite.img,format=raw,if=sd,cache=writeback" \
-netdev "user,id=net_ssh,hostfwd=tcp:127.0.0.1:2222-:22" \
-device "usb-net,netdev=net_ssh" \
-usb \
-usbdevice "keyboard"
- Keyboard inputs and
SSHconnection do not work:
$ qemu-system-aarch64 \
-vnc "unix:/run/user/$(id --user)/qemu-vnc.sock" \
-machine "raspi4b" \
-dtb "./rpi4_model_b_rev1.5/bcm2711-rpi-4-b_from_master_branch_0ea28740607daed588912930379ed6ad40cfc4be.dtb" \
-kernel "./kernel8_from_master_branch_0ea28740607daed588912930379ed6ad40cfc4be.img" \
-append "earlyprintk loglevel=8 root=/dev/mmcblk1p2 rootdelay=1 rw console=tty0,115200" \
-drive "file=./2024-11-19-raspios-bookworm-arm64-lite.img,format=raw,if=sd,cache=writeback" \
-netdev "user,id=net_ssh,hostfwd=tcp:127.0.0.1:2222-:22" \
-device "usb-net,netdev=net_ssh" \
-usb \
-usbdevice "keyboard"
- Keyboard inputs and
SSHconnection do not work:
$ qemu-system-aarch64 \
-vnc "unix:/run/user/$(id --user)/qemu-vnc.sock" \
-machine "raspi4b" \
-dtb "./rpi4_model_b_rev1.5/bcm2711-rpi-4-b_2025-05-13.dtb" \
-kernel "./kernel8_2025-05-13.img" \
-append "earlyprintk loglevel=8 root=/dev/mmcblk1p2 rootdelay=1 rw console=tty0,115200" \
-drive "file=./2025-05-13-raspios-bookworm-arm64-lite.img,format=raw,if=sd,cache=writeback" \
-netdev "user,id=net_ssh,hostfwd=tcp:127.0.0.1:2222-:22" \
-device "usb-net,netdev=net_ssh" \
-usb \
-usbdevice "keyboard"
Raspberry Pi 3 Model B (raspi3b):
- Keyboard inputs via
terminalandSSHconnection work:
$ qemu-system-aarch64 \
-vnc "unix:/run/user/$(id --user)/qemu-vnc.sock" \
-machine "raspi3b" \
-dtb "./rpi3_model_b/bcm2710-rpi-3-b_2024-11-19.dtb" \
-kernel "./kernel8_2024-11-19.img" \
-append "earlyprintk loglevel=8 root=/dev/mmcblk0p2 rootdelay=1 rw console=tty0,115200" \
-drive "file=./2024-11-19-raspios-bookworm-arm64-lite.img,format=raw,if=sd,cache=writeback" \
-netdev "user,id=net_ssh,hostfwd=tcp:127.0.0.1:2222-:22" \
-device "usb-net,netdev=net_ssh" \
-usb \
-usbdevice "keyboard"
- Keyboard inputs via
terminalwork, butSSHconnection not:
$ qemu-system-aarch64 \
-vnc "unix:/run/user/$(id --user)/qemu-vnc.sock" \
-machine "raspi3b" \
-dtb "./rpi3_model_b/bcm2710-rpi-3-b_from_master_branch_0ea28740607daed588912930379ed6ad40cfc4be.dtb" \
-kernel "./kernel8_from_master_branch_0ea28740607daed588912930379ed6ad40cfc4be.img" \
-append "earlyprintk loglevel=8 root=/dev/mmcblk0p2 rootdelay=1 rw console=tty0,115200" \
-drive "file=./2024-11-19-raspios-bookworm-arm64-lite.img,format=raw,if=sd,cache=writeback" \
-netdev "user,id=net_ssh,hostfwd=tcp:127.0.0.1:2222-:22" \
-device "usb-net,netdev=net_ssh" \
-usb \
-usbdevice "keyboard"
- Keyboard inputs via
terminalandSSHconnection work:
$ qemu-system-aarch64 \
-vnc "unix:/run/user/$(id --user)/qemu-vnc.sock" \
-machine "raspi3b" \
-dtb "./rpi3_model_b/bcm2710-rpi-3-b_2025-05-13.dtb" \
-kernel "./kernel8_2025-05-13.img" \
-append "earlyprintk loglevel=8 root=/dev/mmcblk0p2 rootdelay=1 rw console=tty0,115200" \
-drive "file=./2025-05-13-raspios-bookworm-arm64-lite.img,format=raw,if=sd,cache=writeback" \
-netdev "user,id=net_ssh,hostfwd=tcp:127.0.0.1:2222-:22" \
-device "usb-net,netdev=net_ssh" \
-usb \
-usbdevice "keyboard"
Emulated/Virtualized environment
- Operating system:
Raspberry Pi OS (Debian 12, Bookworm) - OS/kernel version:
- 2024-11-19:
Linux raspberrypi 6.6.51+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.51-1+rpt3 (2024-10-08) aarch64 GNU/Linux - 2025-05-13:
Linux raspberrypi 6.12.25+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.12.25-1+rpt1 (2025-04-30) aarch64 GNU/Linux
- 2024-11-19:
- Architecture:
aarch64
Description of problem
I am using a non-root setup.
Regarding raspi4b
All commands lead to a successful boot to the virtual terminal, but no keyboard inputs via VNC, SDL or GTK are possible. I have not tested SPICE, yet.
Even sending keys from the QEMU console, which can be opened via CTRL+ALT+2, is not working: sendkey ctrl-alt-delete.
qemu-system-aarch64 returns some warnings, when executed:
qemu-system-aarch64: warning: bcm2711 dtc: brcm,bcm2711-pcie has been disabled!
qemu-system-aarch64: warning: bcm2711 dtc: brcm,bcm2711-rng200 has been disabled!
qemu-system-aarch64: warning: bcm2711 dtc: brcm,bcm2711-thermal has been disabled!
qemu-system-aarch64: warning: bcm2711 dtc: brcm,bcm2711-genet-v5 has been disabled!
slirp4netns is returning errors, when trying to connect via SSH:
$ nc -zvn 127.0.0.1 2222
(UNKNOWN) [127.0.0.1] 2222 (?) open
$ ssh -p 2222 pi@127.0.0.1
Connection timed out during banner exchange
Connection to 127.0.0.1 port 2222 timed out
In the other shell, where qemu-system-aarch64 was executed:
[...]
qemu-system-aarch64: Slirp: Failed to send packet, ret: -1
qemu-system-aarch64: Slirp: Failed to send packet, ret: -1
[...]
Regarding raspi3b
All commands lead to a successful boot to the virtual terminal, where keyboard inputs via VNC are possible. An SSH connection can also be established, except for the newest Kernel with the newest DTB file from here: The network interface cannot be created; see screenshot below.
qemu-system-aarch64 returns some warnings, when executed:
usbnet: failed control transaction: request 0x8006 value 0x600 index 0x0 length 0xa
usbnet: failed control transaction: request 0x8006 value 0x600 index 0x0 length 0xa
usbnet: failed control transaction: request 0x8006 value 0x600 index 0x0 length 0xa
The weird part is, that the parameters -usb and -usbdevice "keyboard" are mandatory for keyboard inputs via VNC. Actually the VNC client/server should handle keyboard inputs and key translation. When I was trying out Live CDs (Debian 12 (Bookworm, x86_64) and Devuan 5 (Daedalus, x86_64)), keyboard and mouse inputs worked without these parameters.
I was also able to reproduce the no keyboard inputs issue twice. It was working at login and I could enter some commands, but suddenly the inputs were dead. I could not reproduce it again and it is working so far.
Steps to reproduce
- Install
latestQEMU version fromMaster branch. As of writing commit hash757a34115e7491744a63dfc3d291fd1de5297ee2:
$ ACCEPT_KEYWORDS="**" \
USE="qemu_softmmu_targets_aarch64 qemu_softmmu_targets_x86_64 qemu_user_targets_aarch64 qemu_user_targets_x86_64 -ncurses slirp spice virtfs aio alsa bzip2 curl dock fdt filecaps gnutls jpeg oss pam pin-upstream-blobs png pulseaudio python_targets_python3_12 python_targets_python3_13 seccomp slirp spice udev usb vhost-net virtfs vnc xattr zstd" \
emerge --oneshot =app-emulation/qemu-9999
All USE flags can be found below.
- Install
slirp4netns,libslirpandtigervnc:
$ USE="-opengl -server" emerge --oneshot =app-containers/slirp4netns-1.2.0 =net-libs/libslirp-4.7.0 =net-misc/tigervnc-1.15.0
All USE flags can be found below.
- Prepare directory structure in the
current working directory:
$ mkdir "rpi3_model_b/" "rpi4_model_b_rev1.5/"
- Download
DTBandKernel image filesfrom theRaspberry Pi firmware Git repository:
$ wget "https://github.com/raspberrypi/firmware/raw/0ea28740607daed588912930379ed6ad40cfc4be/boot/bcm2710-rpi-3-b.dtb" \
--output-document="./rpi3_model_b/bcm2710-rpi-3-b_from_master_branch_0ea28740607daed588912930379ed6ad40cfc4be.dtb"
$ wget "https://github.com/raspberrypi/firmware/raw/0ea28740607daed588912930379ed6ad40cfc4be/boot/bcm2711-rpi-4-b.dtb" \
--output-document="./rpi4_model_b_rev1.5/bcm2711-rpi-4-b_from_master_branch_0ea28740607daed588912930379ed6ad40cfc4be.dtb"
$ wget "https://github.com/raspberrypi/firmware/raw/0ea28740607daed588912930379ed6ad40cfc4be/boot/kernel8.img" \
--output-document="./kernel8_from_master_branch_0ea28740607daed588912930379ed6ad40cfc4be.img"
- Download, verify and extract
Raspberry Pi OS Liteimage files:
$ wget \
"https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-11-19/2024-11-19-raspios-bookworm-arm64-lite.img.xz" \
"https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-11-19/2024-11-19-raspios-bookworm-arm64-lite.img.xz.sha256" \
"https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-11-19/2024-11-19-raspios-bookworm-arm64-lite.img.xz.sig" \
"https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2025-05-13/2025-05-13-raspios-bookworm-arm64-lite.img.xz" \
"https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2025-05-13/2025-05-13-raspios-bookworm-arm64-lite.img.xz.sha256" \
"https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2025-05-13/2025-05-13-raspios-bookworm-arm64-lite.img.xz.sig"
$ sha256sum --check *.sha256
2024-11-19-raspios-bookworm-arm64-lite.img.xz: OK
2025-05-13-raspios-bookworm-arm64-lite.img.xz: OK
$ for i in *.sig; do echo "${i}"; gpg --verify "${i}" "${i%\.sig}"; done
2024-11-19-raspios-bookworm-arm64-lite.img.xz.sig
gpg: Signature made Tue Nov 19 15:51:51 2024 CET
gpg: using RSA key 54C3DD610D9D1B4AF82A37758738CD6B956F460C
gpg: Good signature from "Raspberry Pi Downloads Signing Key" [full]
2025-05-13-raspios-bookworm-arm64-lite.img.xz.sig
gpg: Signature made Tue May 13 08:52:21 2025 CEST
gpg: using RSA key 54C3DD610D9D1B4AF82A37758738CD6B956F460C
gpg: Good signature from "Raspberry Pi Downloads Signing Key" [full]
$ for i in *.xz; do pixz -d "${i}"; done
$ LS_COLORS="" tree -FC --noreport
./
├── 2024-11-19-raspios-bookworm-arm64-lite.img.xz.sha256
├── 2024-11-19-raspios-bookworm-arm64-lite.img.xz.sig
├── 2024-11-19-raspios-bookworm-arm64-lite.img
├── 2025-05-13-raspios-bookworm-arm64-lite.img.xz.sha256
├── 2025-05-13-raspios-bookworm-arm64-lite.img.xz.sig
├── 2025-05-13-raspios-bookworm-arm64-lite.img
├── kernel8_from_master_branch_0ea28740607daed588912930379ed6ad40cfc4be.img
├── rpi3_model_b/
│ ├── bcm2710-rpi-3-b_from_master_branch_0ea28740607daed588912930379ed6ad40cfc4be.dtb
└── rpi4_model_b_rev1.5/
└── bcm2711-rpi-4-b_from_master_branch_0ea28740607daed588912930379ed6ad40cfc4be.dtb
- Grow
image sizeto make it be apower of 2:
$ qemu-img resize -f raw "./2024-11-19-raspios-bookworm-arm64-lite.img" 4G
Image resized.
$ qemu-img resize -f raw "./2025-05-13-raspios-bookworm-arm64-lite.img" 4G
Image resized.
- Get
DTBandKernel images filesfrom theRaspberry Pi OS image files, prepare auserandSSHD:
$ losetup --find --partscan --show "./2024-11-19-raspios-bookworm-arm64-lite.img"
/dev/loop0
$ mount "/dev/loop0p1" "/mnt/"
$ cp "/mnt/bcm2710-rpi-3-b.dtb" "./rpi3_model_b/bcm2710-rpi-3-b_2024-11-19.dtb"
$ cp "/mnt/bcm2711-rpi-4-b.dtb" "./rpi4_model_b_rev1.5/bcm2711-rpi-4-b_2024-11-19.dtb"
$ cp "/mnt/kernel8.img" "./kernel8_2024-11-19.img"
$ touch "/mnt/ssh"
$ echo "pi:$(openssl passwd -6)" > "/mnt/userconf"
Password: 1234
Verifying - Password: 1234
$ umount "/mnt/"
$ losetup --find --partscan --show "./2025-05-13-raspios-bookworm-arm64-lite.img"
/dev/loop1
$ mount "/dev/loop1p1" "/mnt/"
$ cp "/mnt/bcm2710-rpi-3-b.dtb" "./rpi3_model_b/bcm2710-rpi-3-b_2025-05-13.dtb"
$ cp "/mnt/bcm2711-rpi-4-b.dtb" "./rpi4_model_b_rev1.5/bcm2711-rpi-4-b_2025-05-13.dtb"
$ cp "/mnt/kernel8.img" "./kernel8_2025-05-13.img"
$ touch "/mnt/ssh"
$ echo "pi:$(openssl passwd -6)" > "/mnt/userconf"
Password: 1234
Verifying - Password: 1234
$ umount "/mnt/"
$ losetup --list
NAME SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE DIO LOG-SEC
/dev/loop1 0 0 0 0 /home/<some_username>/qemu/2025-05-13-raspios-bookworm-arm64-lite.img 0 512
/dev/loop0 0 0 0 0 /home/<some_username>/qemu/2024-11-19-raspios-bookworm-arm64-lite.img 0 512
$ losetup --detach "/dev/loop0" "/dev/loop1"
$ losetup --list
$ LS_COLORS="" tree -FC --noreport
./
├── 2024-11-19-raspios-bookworm-arm64-lite.img
├── 2024-11-19-raspios-bookworm-arm64-lite.img.xz.sha256
├── 2024-11-19-raspios-bookworm-arm64-lite.img.xz.sig
├── 2025-05-13-raspios-bookworm-arm64-lite.img
├── 2025-05-13-raspios-bookworm-arm64-lite.img.xz.sha256
├── 2025-05-13-raspios-bookworm-arm64-lite.img.xz.sig
├── kernel8_2024-11-19.img
├── kernel8_2025-05-13.img
├── kernel8_from_master_branch_0ea28740607daed588912930379ed6ad40cfc4be.img
├── rpi3_model_b/
│ ├── bcm2710-rpi-3-b_2024-11-19.dtb
│ ├── bcm2710-rpi-3-b_2025-05-13.dtb
│ ├── bcm2710-rpi-3-b_from_master_branch_0ea28740607daed588912930379ed6ad40cfc4be.dtb
└── rpi4_model_b_rev1.5/
├── bcm2711-rpi-4-b_2024-11-19.dtb
├── bcm2711-rpi-4-b_2025-05-13.dtb
└── bcm2711-rpi-4-b_from_master_branch_0ea28740607daed588912930379ed6ad40cfc4be.dtb
- Execute the first
qemu-system-aarch64command atQEMU command lineabove:
$ qemu-system-aarch64 \
-vnc "unix:/run/user/$(id --user)/qemu-vnc.sock"
[...]
8.1. Warnings will be returned:
raspi4b:
qemu-system-aarch64: warning: bcm2711 dtc: brcm,bcm2711-pcie has been disabled!
qemu-system-aarch64: warning: bcm2711 dtc: brcm,bcm2711-rng200 has been disabled!
qemu-system-aarch64: warning: bcm2711 dtc: brcm,bcm2711-thermal has been disabled!
qemu-system-aarch64: warning: bcm2711 dtc: brcm,bcm2711-genet-v5 has been disabled!
raspi3b:
usbnet: failed control transaction: request 0x8006 value 0x600 index 0x0 length 0xa
usbnet: failed control transaction: request 0x8006 value 0x600 index 0x0 length 0xa
usbnet: failed control transaction: request 0x8006 value 0x600 index 0x0 length 0xa
- Connect via
VNCviaUNIX socket:
$ vncviewer "/run/user/$(id --user)/qemu-vnc.sock"
-
Press and hold the
f keyorright arrowin thetigervnc window, even while booting. There should be no characters at all. Forraspi3bthere will be. -
Open the
QEMU consoleviaCTRL+ALT+2.
11.1. Try to send a reboot command:
> sendkey ctrl-alt-delete
11.2. Raspberry Pi OS will not reboot or receive any keyboard inputs, but raspi3b will.
- Try to connect via
SSHfromanother shell:
$ ssh -p 2222 pi@127.0.0.1
12.1. The connection will time out:
Connection timed out during banner exchange
Connection to 127.0.0.1 port 2222 timed out
12.2. slirp4netns will continuously return errors in the shell, where qemu-system-aarch64 was executed:
[...]
qemu-system-aarch64: Slirp: Failed to send packet, ret: -1
qemu-system-aarch64: Slirp: Failed to send packet, ret: -1
[...]
- Go to the shell, where
qemu-system-aarch64was executed and send aSIGTERM (15)signal to the process:
Press CTRL+C
13.1. If this does not work, terminate the process form another shell:
$ ps aux | grep "qemu-system-aarch64"
<some_username> 24399 149 3.1 4265780 522276 pts/2 SNl+ 21:32 4:21 qemu-system-aarch64 -vnc unix:/run/user/[...]
$ kill -SIGTERM 24399
13.2. In the worst case, kill the process in a dirty way:
$ kill -SIGKILL 24339
- Repeat step
8to13with the nextqemu-system-aarch64command atQEMU command lineabove.Keyboard inputswill only work forraspi3andSSHonly for number4and6. If keyboard inputs are possible, one can log in with the userpiand password1234or use theQEMU console(CTRL+ALT+2) to reboot:sendkey ctrl-alt-delete.
Additional information
Screenshots regarding raspi3b
4. Keyboard inputs via terminal and SSH connection work
5. Keyboard inputs via terminal work, but SSH connection not
6. Keyboard inputs via terminal and SSH connection work
Debug files
Generated, by appending the parameters -d "unimp,guest_errors" -D "./debug_<machine_type>_<image_iso_date_or_master_branch_commit_hash>.log" to above qemu-system-aarch64 commands and boot to the virtual terminal:
Regarding raspi4b
1. Keyboard inputs and SSH connection do not work
2. Keyboard inputs and SSH connection do not work
debug_raspi4b_from_master_branch_0ea28740607daed588912930379ed6ad40cfc4be.log
3. Keyboard inputs and SSH connection do not work
Regarding raspi3b
4. Keyboard inputs via terminal and SSH connection work
5. Keyboard inputs via terminal work, but SSH connection not
debug_raspi3b_from_master_branch_0ea28740607daed588912930379ed6ad40cfc4be.log
6. Keyboard inputs via terminal and SSH connection work
Kernel drivers
From Gentoo Wiki and linux-kvm.org.
Expand
$ grep --extended-regexp "KVM|QEMU|HIGH_RES|KVM_INTEL|HPET|COMPACTION|MIGRATION|KSM|SYSFS|PROC_FS|TRANSPARENT|CGROUPS|VHOST|NET_CORE|TUN|IPV6|BRIDGE|VFIO_MDEV|DRM_I915_GVT|VIRTUALIZATION|VIRTIO|PCI_MSI|GUEST|HOTPLUG|FAMILY" "/usr/src/linux-6.12.21-gentoo/.config" | sort
# CONFIG_8139TOO_TUNE_TWISTER is not set
CONFIG_ACPI_HOTPLUG_CPU=y
CONFIG_ACPI_HOTPLUG_IOAPIC=y
# CONFIG_ACPI_HOTPLUG_MEMORY is not set
# CONFIG_ACRN_GUEST is not set
CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION=y
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
CONFIG_ARCH_ENABLE_THP_MIGRATION=y
CONFIG_ARCH_SUPPORTS_CRASH_HOTPLUG=y
CONFIG_BALLOON_COMPACTION=y
CONFIG_BLK_MQ_VIRTIO=y
# CONFIG_BRIDGE_CFM is not set
CONFIG_BRIDGE_IGMP_SNOOPING=y
# CONFIG_BRIDGE_MRP is not set
CONFIG_BRIDGE_NETFILTER=y
# CONFIG_BRIDGE_NF_EBTABLES is not set
CONFIG_BRIDGE_VLAN_FILTERING=y
CONFIG_BRIDGE=y
# CONFIG_BT_VIRTIO is not set
CONFIG_CGROUPS=y
CONFIG_COMPACTION=y
# CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set
CONFIG_CRASH_HOTPLUG=y
# CONFIG_CRYPTO_DEV_VIRTIO is not set
# CONFIG_DMABUF_SYSFS_STATS is not set
# CONFIG_DMI_SYSFS is not set
CONFIG_DRM_BRIDGE=y
# CONFIG_DRM_CIRRUS_QEMU is not set
CONFIG_DRM_I915_GVT_KVMGT=y
CONFIG_DRM_I915_GVT=y
CONFIG_DRM_PANEL_BRIDGE=y
# CONFIG_DRM_VIRTIO_GPU is not set
CONFIG_EDAC_LEGACY_SYSFS=y
# CONFIG_EDAC_SBRIDGE is not set
# CONFIG_FW_CFG_SYSFS is not set
CONFIG_GENERIC_IRQ_MIGRATION=y
CONFIG_GUEST_PERF_EVENTS=y
CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD=y
CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT=y
CONFIG_HAVE_KVM_DIRTY_RING_ACQ_REL=y
CONFIG_HAVE_KVM_DIRTY_RING_TSO=y
CONFIG_HAVE_KVM_DIRTY_RING=y
CONFIG_HAVE_KVM_IRQ_BYPASS=y
CONFIG_HAVE_KVM_IRQCHIP=y
CONFIG_HAVE_KVM_IRQ_ROUTING=y
CONFIG_HAVE_KVM_MSI=y
CONFIG_HAVE_KVM_NO_POLL=y
CONFIG_HAVE_KVM_PFNCACHE=y
CONFIG_HAVE_KVM_PM_NOTIFIER=y
CONFIG_HAVE_KVM_READONLY_MEM=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_HOTPLUG_CORE_SYNC_DEAD=y
CONFIG_HOTPLUG_CORE_SYNC_FULL=y
CONFIG_HOTPLUG_CORE_SYNC=y
CONFIG_HOTPLUG_CPU=y
CONFIG_HOTPLUG_PARALLEL=y
# CONFIG_HOTPLUG_PCI_ACPI_IBM is not set
CONFIG_HOTPLUG_PCI_ACPI=y
# CONFIG_HOTPLUG_PCI_CPCI is not set
CONFIG_HOTPLUG_PCI_PCIE=y
# CONFIG_HOTPLUG_PCI_SHPC is not set
CONFIG_HOTPLUG_PCI=y
CONFIG_HOTPLUG_SMT=y
CONFIG_HOTPLUG_SPLIT_STARTUP=y
CONFIG_HPET_EMULATE_RTC=y
# CONFIG_HPET_MMAP is not set
CONFIG_HPET_TIMER=y
CONFIG_HPET=y
CONFIG_HW_RANDOM_VIRTIO=y
CONFIG_HYPERVISOR_GUEST=y
# CONFIG_I2C_VIRTIO is not set
CONFIG_INET_TUNNEL=y
CONFIG_IP6_NF_MATCH_IPV6HEADER=y
# CONFIG_IPV6_ILA is not set
# CONFIG_IPV6_IOAM6_LWTUNNEL is not set
# CONFIG_IPV6_MIP6 is not set
# CONFIG_IPV6_MROUTE is not set
# CONFIG_IPV6_MULTIPLE_TABLES is not set
CONFIG_IPV6_NDISC_NODETYPE=y
# CONFIG_IPV6_OPTIMISTIC_DAD is not set
# CONFIG_IPV6_ROUTER_PREF is not set
# CONFIG_IPV6_RPL_LWTUNNEL is not set
# CONFIG_IPV6_SEG6_HMAC is not set
# CONFIG_IPV6_SEG6_LWTUNNEL is not set
# CONFIG_IPV6_SIT_6RD is not set
CONFIG_IPV6_SIT=y
# CONFIG_IPV6_TUNNEL is not set
# CONFIG_IPV6_VTI is not set
CONFIG_IPV6=y
# CONFIG_IP_VS_IPV6 is not set
# CONFIG_JAILHOUSE_GUEST is not set
CONFIG_KSM=y
# CONFIG_KVM_AMD is not set
CONFIG_KVM_ASYNC_PF=y
CONFIG_KVM_COMMON=y
CONFIG_KVM_COMPAT=y
CONFIG_KVM_EXTERNAL_WRITE_TRACKING=y
CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT=y
CONFIG_KVM_GENERIC_HARDWARE_ENABLING=y
CONFIG_KVM_GENERIC_MMU_NOTIFIER=y
CONFIG_KVM_GENERIC_PRE_FAULT_MEMORY=y
CONFIG_KVM_GUEST=y
CONFIG_KVM_HYPERV=y
CONFIG_KVM_INTEL=y
CONFIG_KVM_MAX_NR_VCPUS=1024
CONFIG_KVM_MMIO=y
CONFIG_KVM_SMM=y
CONFIG_KVM_VFIO=y
CONFIG_KVM_X86=y
# CONFIG_KVM_XEN is not set
CONFIG_KVM_XFER_TO_GUEST_WORK=y
CONFIG_KVM=y
# CONFIG_LWTUNNEL is not set
# CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE is not set
CONFIG_MEMORY_HOTPLUG=y
CONFIG_MIGRATION=y
# CONFIG_NET_ACT_TUNNEL_KEY is not set
CONFIG_NET_CORE=y
CONFIG_NETFILTER_FAMILY_BRIDGE=y
# CONFIG_NET_FOU_IP_TUNNELS is not set
CONFIG_NET_IP_TUNNEL=y
CONFIG_NET_UDP_TUNNEL=y
# CONFIG_NF_CONNTRACK_BRIDGE is not set
CONFIG_NF_DEFRAG_IPV6=y
# CONFIG_NF_DUP_IPV6 is not set
CONFIG_NF_LOG_IPV6=m
CONFIG_NF_REJECT_IPV6=y
# CONFIG_NF_SOCKET_IPV6 is not set
# CONFIG_NFS_V4_1_MIGRATION is not set
# CONFIG_NF_TPROXY_IPV6 is not set
CONFIG_NVMEM_SYSFS=y
CONFIG_PCI_MSI=y
CONFIG_PROC_FS=y
CONFIG_PTP_1588_CLOCK_KVM=y
# CONFIG_RPMSG_VIRTIO is not set
# CONFIG_RTC_DRV_DS1685_FAMILY is not set
CONFIG_RTC_INTF_SYSFS=y
CONFIG_SCSI_PROC_FS=y
CONFIG_SND_PROC_FS=y
# CONFIG_SND_VIRTIO is not set
CONFIG_SYSFS_SYSCALL=y
CONFIG_SYSFS=y
CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y
# CONFIG_TRANSPARENT_HUGEPAGE_MADVISE is not set
# CONFIG_TRANSPARENT_HUGEPAGE_NEVER is not set
CONFIG_TRANSPARENT_HUGEPAGE=y
# CONFIG_TUN_VNET_CROSS_LE is not set
CONFIG_TUN=y
CONFIG_VFIO_MDEV=y
# CONFIG_VHOST_CROSS_ENDIAN_LEGACY is not set
CONFIG_VHOST_IOTLB=y
CONFIG_VHOST_MENU=y
CONFIG_VHOST_NET=y
CONFIG_VHOST_TASK=y
CONFIG_VHOST=y
CONFIG_VIRTIO_ANCHOR=y
CONFIG_VIRTIO_BALLOON=y
CONFIG_VIRTIO_BLK=y
CONFIG_VIRTIO_CONSOLE=y
# CONFIG_VIRTIO_DEBUG is not set
# CONFIG_VIRTIO_FS is not set
# CONFIG_VIRTIO_INPUT is not set
# CONFIG_VIRTIO_IOMMU is not set
CONFIG_VIRTIO_MENU=y
# CONFIG_VIRTIO_MMIO is not set
CONFIG_VIRTIO_NET=y
CONFIG_VIRTIO_PCI_ADMIN_LEGACY=y
CONFIG_VIRTIO_PCI_LEGACY=y
CONFIG_VIRTIO_PCI_LIB_LEGACY=y
CONFIG_VIRTIO_PCI_LIB=y
CONFIG_VIRTIO_PCI=y
# CONFIG_VIRTIO_VFIO_PCI is not set
CONFIG_VIRTIO=y
CONFIG_VIRTUALIZATION=y
# CONFIG_WATCHDOG_SYSFS is not set
CONFIG_X86_MINIMUM_CPU_FAMILY=64
CONFIG_YENTA_ENE_TUNE=y
USE flags: app-emulation/qemu
Expand
$ equery uses app-emulation/qemu-9999
[ Legend : U - final flag setting for installation]
[ : I - package is installed with flag ]
[ Colors : set, unset ]
* Found these USE flags for app-emulation/qemu-9999:
U I
- - accessibility : Adds support for braille displays using brltty
+ + aio : Enables support for Linux s Async IO
+ + alsa : Enable alsa output for sound emulation
- - bpf : Enable eBPF support for RSS implementation.
+ + bzip2 : Enable bzip2 compression support
- - capstone : Enable disassembly support with dev-libs/capstone
+ + curl : Support ISOs / -cdrom directives via HTTP or HTTPS.
- - debug : Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces
+ + doc : Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally
+ + fdt : Enables firmware device tree support
+ + filecaps : Use Linux file capabilities to control privilege rather than set*id (this is orthogonal to USE=caps which uses capabilities at runtime e.g. libcap)
- - fuse : Enables FUSE block device export
- - glusterfs : Enables GlusterFS cluster fileystem via sys-cluster/glusterfs
+ + gnutls : Enable TLS support for the VNC console server. For 1.4 and newer this also enables WebSocket support. For 2.0 through 2.3 also enables disk quorum support.
- - gtk : Add support for x11-libs/gtk+ (The GIMP Toolkit)
- - infiniband : Enable Infiniband RDMA transport support
- - io-uring : Enable the use of io_uring for efficient asynchronous IO and system requests
- - iscsi : Enable direct iSCSI support via net-libs/libiscsi instead of indirectly via the Linux block layer that sys-block/open-iscsi does.
- - jack : Add support for the JACK Audio Connection Kit
- - jemalloc : Use dev-libs/jemalloc for memory management
+ + jpeg : Enable jpeg image support for the VNC console server
- - keyutils : Support Linux keyrings via sys-apps/keyutils
- - lzo : Enable support for lzo compression
- - multipath : Enable multipath persistent reservation passthrough via sys-fs/multipath-tools.
- - ncurses : Enable the ncurses-based console
- - nfs : Enable NFS support
- - nls : Add Native Language Support (using gettext - GNU locale utilities)
- - numa : Enable NUMA support
- - opengl : Add support for OpenGL (3D graphics)
+ + oss : Add support for OSS (Open Sound System)
+ + pam : Add support for PAM (Pluggable Authentication Modules) - DANGEROUS to arbitrarily flip
+ + pin-upstream-blobs : Pin the versions of BIOS firmware to the version included in the upstream release. This is needed to sanely support migration/suspend/resume/snapshotting/etc... of instances. When the blobs are
different, random corruption/bugs/crashes/etc... may be observed.
- - pipewire : Enable pipewire output for sound emulation
- - plugins : Enable qemu plugin API via shared library loading.
+ + png : Enable png image support for the VNC console server
+ + pulseaudio : Enable pulseaudio output for sound emulation
- - python : Add optional support/bindings for the Python language
- - python_targets_python3_11 : Build with Python 3.11
+ + python_targets_python3_12 : Build with Python 3.12
+ + python_targets_python3_13 : Build with Python 3.13
+ + qemu_softmmu_targets_aarch64 : ARM64 system emulation target
- - qemu_softmmu_targets_alpha : system emulation target
- - qemu_softmmu_targets_arm : system emulation target
- - qemu_softmmu_targets_avr : system emulation target
- - qemu_softmmu_targets_hppa : system emulation target
- - qemu_softmmu_targets_i386 : system emulation target
- - qemu_softmmu_targets_loongarch64 : system emulation target
- - qemu_softmmu_targets_m68k : system emulation target
- - qemu_softmmu_targets_microblaze : system emulation target
- - qemu_softmmu_targets_microblazeel : system emulation target
- - qemu_softmmu_targets_mips : system emulation target
- - qemu_softmmu_targets_mips64 : system emulation target
- - qemu_softmmu_targets_mips64el : system emulation target
- - qemu_softmmu_targets_mipsel : system emulation target
- - qemu_softmmu_targets_or1k : OpenRISC system emulation target
- - qemu_softmmu_targets_ppc : system emulation target
- - qemu_softmmu_targets_ppc64 : system emulation target
- - qemu_softmmu_targets_riscv32 : system emulation target
- - qemu_softmmu_targets_riscv64 : system emulation target
- - qemu_softmmu_targets_rx : Renesas RX system emulation target
- - qemu_softmmu_targets_s390x : system emulation target
- - qemu_softmmu_targets_sh4 : system emulation target
- - qemu_softmmu_targets_sh4eb : system emulation target
- - qemu_softmmu_targets_sparc : system emulation target
- - qemu_softmmu_targets_sparc64 : system emulation target
- - qemu_softmmu_targets_tricore : system emulation target
+ + qemu_softmmu_targets_x86_64 : system emulation target
- - qemu_softmmu_targets_xtensa : system emulation target
- - qemu_softmmu_targets_xtensaeb : system emulation target
+ + qemu_user_targets_aarch64 : ARM64 userspace emulation target
- - qemu_user_targets_aarch64_be : ARM64 big endian userspace emulation target
- - qemu_user_targets_alpha : userspace emulation target
- - qemu_user_targets_arm : ARM (little endian) userspace emulation target
- - qemu_user_targets_armeb : ARM (big endian) userspace emulation target
- - qemu_user_targets_hexagon : Qualcomm hexagon userspace emulation target
- - qemu_user_targets_hppa : userspace emulation target
- - qemu_user_targets_i386 : userspace emulation target
- - qemu_user_targets_loongarch64 : userspace emulation target
- - qemu_user_targets_m68k : userspace emulation target
- - qemu_user_targets_microblaze : userspace emulation target
- - qemu_user_targets_microblazeel : userspace emulation target
- - qemu_user_targets_mips : userspace emulation target
- - qemu_user_targets_mips64 : userspace emulation target
- - qemu_user_targets_mips64el : userspace emulation target
- - qemu_user_targets_mipsel : userspace emulation target
- - qemu_user_targets_mipsn32 : MIPS N32 ABI userspace emulation target
- - qemu_user_targets_mipsn32el : MIPS N32 ABI LE userspace emulation target
- - qemu_user_targets_or1k : OpenRISC system emulation target
- - qemu_user_targets_ppc : PowerPC 32-bit big endian userspace emulation target
- - qemu_user_targets_ppc64 : PowerPC 64-bit big endian userspace emulation target
- - qemu_user_targets_ppc64le : PowerPC 64-bit little endian userspace emulation target
- - qemu_user_targets_riscv32 : userspace emulation target
- - qemu_user_targets_riscv64 : userspace emulation target
- - qemu_user_targets_s390x : userspace emulation target
- - qemu_user_targets_sh4 : userspace emulation target
- - qemu_user_targets_sh4eb : userspace emulation target
- - qemu_user_targets_sparc : userspace emulation target
- - qemu_user_targets_sparc32plus : userspace emulation target
- - qemu_user_targets_sparc64 : userspace emulation target
+ + qemu_user_targets_x86_64 : userspace emulation target
- - qemu_user_targets_xtensa : userspace emulation target
- - qemu_user_targets_xtensaeb : userspace emulation target
- - rbd : Enable rados block device backend support, see https://docs.ceph.com/en/mimic/rbd/qemu-rbd/
- - sasl : Add support for the Simple Authentication and Security Layer
- - sdl : Enable the SDL-based console
- - sdl-image : SDL Image support for icons
+ + seccomp : Enable seccomp (secure computing mode) to perform system call filtering at runtime to increase security of programs
+ + slirp : Enable TCP/IP in hypervisor via net-libs/libslirp
- - smartcard : Enable smartcard support
- - snappy : Enable support for Snappy compression (as implemented in app-arch/snappy)
+ + spice : Enable Spice protocol support via app-emulation/spice
- - ssh : Enable SSH based block device support via net-libs/libssh2
- - static-user : Build the User targets as static binaries
- - systemtap : Enable SystemTap/DTrace tracing
- - test : Enable dependencies and/or preparations necessary to run tests (usually controlled by FEATURES=test but can be toggled independently)
+ + udev : Enable virtual/udev integration (device discovery, power and storage device support, etc)
+ + usb : Enable USB passthrough via dev-libs/libusb
- - usbredir : Use sys-apps/usbredir to redirect USB devices to another machine over TCP
- - vde : Enable VDE-based networking
+ + vhost-net : Enable accelerated networking using vhost-net, see https://www.linux-kvm.org/page/VhostNet
- - virgl : Enable experimental Virgil 3d (virtual software GPU)
+ + virtfs : Enable VirtFS via virtio-9p-pci / fsdev. See https://wiki.qemu.org/Documentation/9psetup
+ + vnc : Enable VNC (remote desktop viewer) support
- - vte : Enable terminal support (x11-libs/vte) in the GTK+ interface
- - wayland : Enable dev-libs/wayland backend
+ + xattr : Add support for getting and setting POSIX extended attributes, through sys-apps/attr. Requisite for the virtfs backend.
- - xdp : Enable support for XDP through net-libs/xdp-tools
- - xen : Enables support for Xen backends
+ + zstd : Enable support for ZSTD compression
ebuild file: qemu-9999.ebuild
USE flags: app-containers/slirp4netns
Expand
$ equery uses slirp4netns
!!! No USE flags found for app-containers/slirp4netns-1.2.0
$ eix --installed app-containers/slirp4netns
[I] app-containers/slirp4netns
Available versions: 1.2.0^t
Installed versions: 1.2.0^t(17:18:10 22/08/24)
Homepage: https://github.com/rootless-containers/slirp4netns
Description: User-mode networking for unprivileged network namespaces
USE flags: net-libs/libslirp
Expand
$ equery uses net-libs/libslirp
[ Legend : U - final flag setting for installation]
[ : I - package is installed with flag ]
[ Colors : set, unset ]
* Found these USE flags for net-libs/libslirp-4.7.0:
U I
- - static-libs : Build static versions of dynamic libraries as well
- - valgrind : Enable annotations for accuracy. May slow down runtime slightly. Safe to use even if not currently
using dev-debug/valgrind
USE flags: net-misc/tigervnc
Expand
$ equery uses net-misc/tigervnc
[ Legend : U - final flag setting for installation]
[ : I - package is installed with flag ]
[ Colors : set, unset ]
* Found these USE flags for net-misc/tigervnc-1.15.0:
U I
- - dri3 : Build with DRI3 support
+ + drm : Build with DRM support
- - gnutls : Prefer net-libs/gnutls as SSL/TLS provider (ineffective with USE=-ssl)
- - java : Build TigerVNC Java viewer
- - nls : Add Native Language Support (using gettext - GNU locale utilities)
- - opengl : Add support for OpenGL (3D graphics)
- - server : Build TigerVNC server
+ + viewer : Build TigerVNC viewer
- - xinerama : Add support for querying multi-monitor screen geometry through the Xinerama API
Configuration for non-root user (from nemu)
Expand
udev rules
$ < "/etc/udev/rules.d/99-nemu.rules
KERNEL=="kvm", MODE="0660", GROUP="kvm"
KERNEL=="vhost-net", MODE="0660", GROUP="vhost"
SUBSYSTEM=="usb", MODE="0664", GROUP="usb"
SUBSYSTEM=="macvtap", MODE="0660", GROUP="vhost"
$ udevadm control --reload-rules
$ udevadm trigger
Add user to udev groups
$ gpasswd --add <some_username> kvm
$ gpasswd --add <some_username> usb
$ groupadd vhost
$ gpasswd --add <some_username> vhost
$ gawk --field-separator ":" '/kvm|vhost|usb/ { printf "Group name: %-20s GID: %-10s Members: %-10s\n", $1, $3, $4 }' "/etc/group" | sort --numeric-sort --key="5"
Group name: kvm GID: 78 Members: qemu,<some_username>
Group name: usb GID: 85 Members: <some_username>
Group name: vhost GID: 1002 Members: <some_username>
Set capabilities for network configurations
$ ls -1 "/usr/bin/qemu-system-"* | xargs --max-args="1" setcap CAP_NET_ADMIN="ep"
$ setcap CAP_NET_ADMIN="ep" "/usr/bin/nemu"
$ ls -1 "/usr/bin/qemu-system-"* "/usr/bin/nemu" | xargs -n 1 getcap
/usr/bin/nemu cap_net_admin=ep
/usr/bin/qemu-system-aarch64 cap_net_admin=ep
/usr/bin/qemu-system-x86_64 cap_net_admin=ep
This issue solves #2351 and is related to this comment and #2533.


