Skip to content

Instantly share code, notes, and snippets.

@lemenkov
Created September 25, 2013 15:01
Show Gist options
  • Select an option

  • Save lemenkov/6700931 to your computer and use it in GitHub Desktop.

Select an option

Save lemenkov/6700931 to your computer and use it in GitHub Desktop.
How to build VM for Qemu/KVM w/o using virt-manager.
#!/bin/sh
NAME=$1
virt-install --connect=qemu:///system \
--network=bridge:virbr0 \
--location=http://mirror.yandex.ru/centos/5/os/x86_64/ \
--extra-args="ks=ftp://fileserv.local/pub/kickstarters/${NAME}.ks ip=dhcp console=tty0 console=ttyS0,115200" \
--name=${NAME} \
--disk /var/lib/libvirt/images/${NAME}.img,size=20 \
--ram 2048 \
--vcpus=2 \
--check-cpu \
--accelerate \
--hvm \
--nographics
# --network network:default
# --os-type=linux \
# --os-variant=rhel5 \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment