mirror of
https://github.com/SolidEva/nixos-qemu-image.git
synced 2026-01-22 21:21:27 +01:00
No description
| .gitignore | ||
| default.nix | ||
| nixos-config.nix | ||
| README.md | ||
this builds a kernel-less nixos image for running with arbitrary kernels in qemu
build:
nix-build
# copy the image out so we can use it with qemu
install -m644 result/nixos.qcow2 qemu-image.img
build your kernel image
we assume your linux checkout is at ../linux/
run qemu:
qemu-system-x86_64 -s \
-kernel ../linux/arch/x86/boot/bzImage \
-hda qemu-image.img \
-append "root=/dev/sda console=ttyS0 nokaslr" \
-enable-kvm \
-nographic \
-m 2048
and if you want it to halt boot until gdb is connected, add -S:
qemu-system-x86_64 -s -S \
-kernel arch/x86/boot/bzImage \
-hda qemu-image.img \
-append "root=/dev/sda console=ttyS0 nokaslr" \
-enable-kvm \
-nographic \
-m 2048
modified from suggestions found at https://nixos.wiki/wiki/Kernel_Debugging_with_QEMU