Please read the qemu-sanity-check(1) man page, but basic usage is very
simple. You probably want to use one of the following commands:
-Test qemu on path against most recent installed Linux kernel in /boot:
+Test qemu on path against most recent installed Linux kernel in /boot
+(or /lib/modules/VERSION/vmlinuz on some distros):
qemu-sanity-check
qemu-sanity-check
In this case, the script will look for a suitable qemu binary on the
-C<$PATH> and the latest Linux kernel in F</boot> and try to boot that
+C<$PATH> and the latest Linux kernel in F</boot> (or
+F</lib/modules/VERSION/vmlinuz> on some distros) and try to boot that
kernel on that qemu.
You can also specify a qemu binary or a Linux kernel (either or both
# Locate kernel if not specified.
if [ -z "$kernel" ]; then
+ shopt -s nullglob
if [ "$verbose" = "yes" ]; then
echo "all kernels:"
- ls -1dvr /boot/vmlinuz-*.$arch*
+ ls -1dvr /lib/modules/*/vmlinuz /boot/vmlinuz-*.$arch*
fi
- kernel="$(ls -1dvr /boot/vmlinuz-*.$arch* 2>/dev/null | grep -v xen | head -1)"
+ kernel="$(ls -1dvr /lib/modules/*/vmlinuz /boot/vmlinuz-*.$arch* 2>/dev/null | grep -v xen | head -1)"
if [ -z "$kernel" ]; then
echo "$0: cannot find a Linux kernel in /boot"
echo "Choose a kernel to test using --kernel=/path/to/vmlinuz"
exit 2
fi
+ shopt -u nullglob
fi
if [ ! -r "$kernel" ]; then
echo "$0: kernel $kernel is not readable"