Created
November 14, 2025 03:03
-
-
Save richinseattle/ecacaf7a3b56747b077e5ed1af15e9c5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # connect image to system as qemu nbd device | |
| sudo modprobe nbd max_part=8 | |
| sudo qemu-nbd -f raw --connect=/dev/nbd0 disk.img | |
| sudo partprobe /dev/nbd0 | |
| # examine img | |
| sudo fdisk -l /dev/nbd0 | |
| sudo blkid /dev/nbd0* | |
| # mount | |
| sudo mount /dev/nbd0p3 ./rootfs | |
| sudo mount /dev/nbd0p5 ./home | |
| # disconnect | |
| sudo umount ./rootfs | |
| sudo umount ./home | |
| sudo qemu-nbd --disconnect /dev/nbd0 | |
| # boot | |
| qemu-system-x86_64 -drive file=disk.img,format=raw -display none -chardev stdio,id=terminal,mux=on -device isa-debugcon,iobase=0x4 | |
| 02,chardev=terminal -serial chardev:terminal -bios /usr/share/ovmf/OVMF.fd -smbios type=0,uefi=on -m 4096 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment