Qemu: Difference between revisions

From Braindump
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 5: Line 5:
  qemu-img create -f qcow2 Image.img 10G
  qemu-img create -f qcow2 Image.img 10G
  qemu-system-x86_64 -enable-kvm -cdrom OS_ISO.iso -boot menu=on -drive file=Image.img -m 2G
  qemu-system-x86_64 -enable-kvm -cdrom OS_ISO.iso -boot menu=on -drive file=Image.img -m 2G
qemu-system-x86_64 -nographic -kernel bzImage -initrd init.cpio -append "console=ttyS0"


  -enable-kvm enables KVM,
  -enable-kvm enables KVM,

Latest revision as of 13:43, 23 September 2025

https://youtu.be/AAfFewePE7c

https://denshi.org

qemu-img create -f qcow2 Image.img 10G
qemu-system-x86_64 -enable-kvm -cdrom OS_ISO.iso -boot menu=on -drive file=Image.img -m 2G
qemu-system-x86_64 -nographic -kernel bzImage -initrd init.cpio -append "console=ttyS0"
-enable-kvm enables KVM,
-cdrom selects an iso to load as a cd
-boot menu=on enables a boot menu
-drive file= selects a file for the drive
-m sets the amount of dedicated RAM)

Ctrl + Alt + G to exit capture

Ctrl + Alt + F to fullscreen!

-cpu host (sets the CPU to the hosts' CPU)
-smp 2 (sets the numbers of cores)
-vga qxl
-vga virtio -display sdl,gl=on

https://qemu-project.gitlab.io/qemu/system/invocation.html#hxtool-6

qemu-system-x86_64 -serial mon:stdio -nographic

CTRL-A X

https://superuser.com/questions/1795299/what-is-the-proper-way-to-use-qemus-socket-feature

qemu-system-x86_64 -nographic \
-device isa-debugcon,chardev=debugsock -chardev socket,id=debugsock,path=/tmp/qemu.sock,server=on,wait=off \
-monitor unix:monitor.sock,server=on,wait=off \
-serial mon:stdio
nc -U monitor.sock
socat -,raw,echo=0 UNIX-CONNECT:monitor.sock

bios.img (0x003ffff0)

wa "mov al, 0x48" "out 0xe9, al" "mov al, 0x69" "out 0xe9, al" "hlt"

qemu-system-x86_64 -bios bios.img -nographic \
-device isa-debugcon,chardev=debugsock -chardev socket,id=debugsock,path=/tmp/qemu.sock,server=on,wait=off \
-monitor unix:monitor.sock,server=on,wait=off \
-serial mon:stdio

https://doc.coreboot.org/tutorial/part1.html

qemu-system-aarch64 -cpu cortex-a55 -nographic   -machine virt,virtualization=on,gic-version=3 -chardev stdio,id=con,mux=on -serial chardev:con   -global virtio-mmio.force-legacy=false   -device virtio-^Crial-device,bus=virtio-mmio-bus.0 -chardev socket,telnet=on,host=127.0.0.1,port=3450,server=on,wait=off,id=foo   -device virtconsole,chardev=foo   -device virtio-rng-device,bus=virtio-mmio-bus.1 -netdev user,id=u1,hostfwd=tcp:127.0.0.1:10023-10.0.2.15:23,hostfwd=tcp:127.0.0.1:15001-10.0.2.15:5001   -device virtio-net-device,netdev=u1,bus=virtio-mmio-bus.2   -drive file=./mydisk-1gb.img,if=none,format=raw,id=hd   -device virtio-blk-device,bus=virtio-mmio-bus.3,drive=hd   -mon chardev=con,mode=readline -kernel ./build/nuttx