Skip to content

Instantly share code, notes, and snippets.

@netrunn3r
Last active December 8, 2017 08:22
Show Gist options
  • Save netrunn3r/b44528358582e15cfe5ef8bbe52dd217 to your computer and use it in GitHub Desktop.
Save netrunn3r/b44528358582e15cfe5ef8bbe52dd217 to your computer and use it in GitHub Desktop.
QEMU cheetsheet

Boot VM from iso with port redirection

qemu-system-x86_64 -enable-kvm -usbdevice tablet
-boot d -cdrom image.iso    # boot from iso
-m 512                      # 512MB RAM
-netdev user,id=net0,hostfwd=tcp::8080-:80 -device e1000,netdev=net0  # redirect host 8080 to guest 80

Create new disk

qemu-img create mydisk.img 10G

Boot from iso and use mydisk.img

qemu-system-x86_64 -boot d -cdrom image.iso -m 512 -hda mydisk.img

mhdd

qemu-system-x86_64 -hda /dev/sdb -cdrom ~/kvm/mhdd32ver4.6.iso -boot d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment