virt-install commands
Jul 16, 2015
Here’s a few commands I usually use when creating new KVM virtual machines from the command line. Requires the virtinst
package. You can also use Virtual Machine Manager
to easily create VMs without the command line.
Debian 8
virt-install --name=debian8 \
--arch=x86_64 \
--vcpus=4 \
--ram=4096 \
--os-type=linux \
--os-variant=debianwheezy \
--hvm \
--network bridge:br0,model=virtio \
--cdrom=/path/to/iso \
--disk path=/path/to/disk,size=20,cache=none,bus=virtio \
--accelerate \
--graphics vnc \
--noautoconsole \
--connect=qemu:///system
Windows Server 2008 R2
virt-install --name=server2008r2 \
--arch=x86_64 \
--vcpus=4 \
--ram=4096 \
--cdrom=/path/to/iso \
--disk path=/path/to/disk,size=80,cache=none,bus=virtio \
--disk path=/path/to/virtio/drivers,device=cdrom,perms=ro \
--network=bridge:br0,model=virtio \
--vnc \
--accelerate \
--noautoconsole \
--os-type=windows \
--os-variant=win2k8 \
--hvm \
--connect qemu:///system
PXE Boot
virt-install --name=pxe \
--arch=x86_64 \
--vcpus=4 \
--ram=4096 \
--os-type=linux \
--os-variant=debianwheezy \
--hvm \
--network bridge:br0,model=virtio \
--disk path=/path/to/disk,size=20,cache=none,bus=virtio \
--accelerate \
--vnc \
--noautoconsole \
--pxe \
--connect=qemu:///system