Skip to content

Instantly share code, notes, and snippets.

@anuragregmi
Created April 4, 2019 05:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anuragregmi/744514d7ab911539f36ae97195af34d1 to your computer and use it in GitHub Desktop.
Save anuragregmi/744514d7ab911539f36ae97195af34d1 to your computer and use it in GitHub Desktop.
creating qemu images and running virtual machine

Create image

  • 20G is size of your image, or hard disk for virtual machine
  • virtual.img is the image file
qemu-img create -f qcow2 virtual.img 20G

Booting img for first time for installation

  • 2G is RAM for virtual machine
qemu-system-aarch64 -boot d -cdrom isoimage.iso virtual.img -m 2G -enable-kvm -machine q35,accel=kvm

Using the virtual machine

qemu-system-x86_64 -boot d virtual.img -m 2G -enable-kvm -machine q35,accel=kvm -cpu host

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