Skip to content

Instantly share code, notes, and snippets.

@nmandery
Last active August 29, 2015 13:56
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 nmandery/9238688 to your computer and use it in GitHub Desktop.
Save nmandery/9238688 to your computer and use it in GitHub Desktop.
qemu start command for images provided on http://people.debian.org/~aurel32/qemu/amd64/
#!/bin/bash
# qemu start command for images provided on http://people.debian.org/~aurel32/qemu/amd64/
set -eu
IMG=$(dirname $0)/images/debian-wheezy.qcow2
VM_MEMORY='1024'
SSH_PORT=2223
VM_NCPUS="`grep -c ^processor /proc/cpuinfo`"
qemu-system-x86_64 \
-hda "$IMG" \
-enable-kvm \
-machine accel=kvm:tcg \
-m ${VM_MEMORY} \
-smp "${VM_NCPUS}" \
-net nic,vlan=0,model=virtio \
-net user,vlan=0,hostfwd=tcp::"${SSH_PORT}"-:22 \
-nographic \
"$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment