<div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br><br>
I've found running a kernel under qemu with my normal rootfs to be quite<br>
useful to quickly try out things. See the qemu-test script in the RAUC project<br>
for an example: <a href="https://github.com/rauc/rauc/blob/master/qemu-test" rel="noreferrer" target="_blank">https://github.com/rauc/rauc/blob/master/qemu-test</a><br>
<br></blockquote><div><br></div><div><br></div><div>I would agree. </div><div>I find "virtme" tool to be super simple and effective.</div><div>It reuses your running system install, mounted with 9P,</div><div>no need to futz with a 2nd system image.</div><div>I barely had to tinker with all the qemu options and args...</div><div><br></div><div>heres my every-day usage (w my own boring shell funcs wrapping)</div><div>function krun () {<br> echo vm $KRUN_SHOW $KRUN_STDS $KDBG_OPTS $QM_OPTS $*<br> virtme-run $KRUN_SHOW $KRUN_STDS $KDBG_OPTS $QM_OPTS $*<br> # -qmp tcp:localhost:4444,server,nowait<br>}<br></div><div>[jimc@frodo local-i915m]$ krun<br>vm --show-command --show-boot-console --kdir . --mods=auto --kopt nokaslr --kopt dynamic_debug.verbose=3 --kopt module.dyndbg=+pmf --qemu-opts -machine dump-guest-core=on -m 2G<br>./.virtme_mods/lib/modules/0.0.0<br>/usr/bin/qemu-system-x86_64 -fsdev local,id=virtfs1,path=/,security_model=none,readonly,multidevs=remap -device virtio-9p-pci,fsdev=virtfs1,mount_tag=/dev/root -fsdev local,id=virtfs5,path=/usr/local/lib/python3.9/site-packages/virtme-0.1.1-py3.9.egg/virtme/guest,security_model=none,readonly,multidevs=remap -device virtio-9p-pci,fsdev=virtfs5,mount_tag=virtme.guesttools -machine accel=kvm:tcg -watchdog i6300esb -cpu host -parallel none -net none -echr 1 -serial none -chardev stdio,id=console,signal=off,mux=on -serial chardev:console -mon chardev=console -vga none -display none -kernel ./arch/x86/boot/bzImage -append 'virtme_link_mods=/home/jimc/projects/lx/wk-next/builds/local-i915m/.virtme_mods/lib/modules/0.0.0 earlyprintk=serial,ttyS0,115200 console=ttyS0 psmouse.proto=exps "virtme_stty_con=rows 24 cols 141 iutf8" TERM=xterm-256color rootfstype=9p rootflags=version=9p2000.L,trans=virtio,access=any raid=noautodetect ro nokaslr dynamic_debug.verbose=3 module.dyndbg=+pmf init=/bin/sh -- -c "mount -t tmpfs run /run;mkdir -p /run/virtme/guesttools;/bin/mount -n -t 9p -o ro,version=9p2000.L,trans=virtio,access=any virtme.guesttools /run/virtme/guesttools;exec /run/virtme/guesttools/virtme-init"' -machine dump-guest-core=on -m 2G<br>Wrong EFI loader signature.<br>early console in extract_kernel<br>input_data: 0x00000000047a340d<br>input_len: 0x00000000009f7f00<br>output: 0x0000000001000000<br>output_len: 0x0000000004139814<br>kernel_total_size: 0x0000000003630000<br>needed_size: 0x0000000004200000<br>trampoline_32bit: 0x000000000009d000<br><br><br>KASLR disabled: 'nokaslr' on cmdline.<br><br></div><div>......</div><div><br></div></div></div>