QEMU-SANITY-CHECK(1)

πŸ“¦
version 1.1.6 Β· 4 versions
, in epel 9

🌸 qemu-sanity-check πŸ’…

okay so this is the manual page for qemu-sanity-check, and honestly? she's a little icon. it's a vibe check for your virtualization setup. let's get into it 🫢

✨ NAME ✨

qemu-sanity-check β€” run a simple sanity check on qemu and the Linux kernel

πŸŽ€ SUMMARY πŸŽ€

qemu-sanity-check [options]

πŸ’– DESCRIPTION πŸ’–

qemu-sanity-check is a short shell script (yes, just a shell script, no cap) that test-boots a Linux kernel under qemu, making sure it boots alllll the way up to userspace. the whole idea is to test the Linux kernel and/or qemu and make sure they're actually working. like, are you okay bestie? let's find out πŸ’€

you can just run it on its own, zero thoughts:

qemu-sanity-check

in that case, the script will look for a suitable qemu binary on the $PATH and the latest Linux kernel in /boot, then try to boot that kernel on that qemu. lowkey doing the most so you don't have to ✨

you can also specify a qemu binary or a Linux kernel β€” either or both options can be omitted, she's flexible like that:

qemu-sanity-check --qemu=/path/to/qemu --kernel=/path/to/vmlinuz

🧚 KVM 🧚

KVM (kvm or qemu-kvm) can be used in place of qemu. same energy, different binary.

🌈 KERNEL DRIVERS 🌈

the good news: no kernel modules or special drivers are required, except as noted below. the test uses an initramfs containing a static binary, so the kernel is not required to locate block devices, use virtio, mount filesystems, etc. it's giving minimal-effort, maximum-slaying πŸŽ€

the kernel must support only the following, and they gotta be compiled in (not as modules β€” i said what i said):

  • a serial port (usually: CONFIG_SERIAL_8250=y)
  • Initrd/initramfs (CONFIG_BLK_DEV_INITRD=y)

πŸ’… OPTIONS πŸ’…

  • --help β€” display short help message and exit. the classic.
  • --accel=kvm, --accel=tcg, --accel=kvm:tcg β€” this sets the -machine accel=... parameter which is passed to qemu.

if not set, then kvm:tcg is the default, which means: try to use KVM (hardware-assisted virtualization), and fall back to software emulation if KVM is not possible. bestie has a backup plan πŸ’–

other typical values of this parameter are: tcg, which means force software emulation; and kvm, which means force KVM and fail if KVM is unavailable. no plan b, she's committed 😭

  • --cpu=CPU β€” set the qemu --cpu option. if not set then a suitable default is picked depending on the architecture and whether KVM is available. you can also use --cpu= to let qemu pick the default. letting her choose, main character energy πŸ‘‘
  • -i INITRD, --initrd=INITRD β€” use the initramfs image named INITRD instead of the default.
  • -k VMLINUZ, --kernel=VMLINUZ β€” use the kernel image VMLINUZ instead of searching for the latest kernel installed in /boot.
  • -m MACHINE, --machine=MACHINE β€” set the qemu -m (machine type) option. if not set then a suitable default is picked depending on the architecture. you can also use --machine= to let qemu pick the default.
  • -q QEMU, --qemu=QEMU β€” use the qemu (or KVM) binary QEMU instead of searching $PATH for a suitable binary.
  • -t TIMEOUT, --timeout=TIMEOUT β€” specify a timeout instead of the default which is 10m (10 minutes). the syntax for the TIMEOUT is described in full in the man page for timeout(1). yes, go read that one too, i'll wait πŸ“
  • -v, --verbose β€” print extra debugging information. she's a talker, we love that.
  • -V, --version β€” display version and exit.

⭐ EXIT STATUS ⭐

  • the exit status is 0 if the Linux kernel booted as far as userspace under qemu; or if the --help or --version options were used. slay πŸ’…
  • the exit status is 1 if the kernel boot failed under qemu. sad girl hours 😭
  • the exit status is 2 if the script itself failed (eg. incorrect command line options were used, a suitable kernel could not be found). not her fault, fr fr.

πŸ¦‹ FILES πŸ¦‹

  • /usr/lib64/qemu-sanity-check/initrd β€” the default location for the small initramfs image that is used to test that userspace has been reached. tiny but mighty πŸŽ€

πŸ”₯ SEE ALSO πŸ”₯

🌸 AUTHORS 🌸

Richard W.M. Jones <rjones@redhat.com>

(C) Copyright 2013-2020 Red Hat Inc.

this program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

this program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. see the GNU General Public License for more details.

you should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.


and that's the whole page bestie, stream it, bookmark it, live by it πŸ’œβœ¨ version qemu-sanity-check-1.1.6, dated 2023-09-01 β€” mwah, love u, bye πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from