Date created: Monday, March 7, 2016 9:13:19 AM. Last modified: Monday, November 13, 2017 3:48:31 PM

KVM Guest Install Examples

Install with VNC:

virt-install --connect qemu:///system -n Cots- -r 4096 --hvm --vcpus sockets=1,cores=4,threads=1 --disk /media/hdd/cots_vanilla_17.1.1.321.qcow2,device=disk,bus=virtio --cdrom /media/hdd/cots_vanilla_17.1.1.321.iso --boot cdrom -w bridge=virbr0,model=virtio --graphics vnc,listen=

sudo firewall-cmd --zone=public --add-port=5900/tcp

Install CentOS

qemu-img create -f qcow2 ~/Projects/VMs/CentOS1.qcow2 10240M
sudo brctl addbr virbr0
sudo brctl stp virbr0 off
sudo brctl addif virbr0 eth0
virt-install -n CentOS1 -r 512 --vcpus 2 -f ~/Projects/VMs/CentOS1.qcow2 --network bridge=0 --cdrom ~/Downloads/CentOS-6.7-x86_64-netinstall.iso
virsh --connect qemu:///system start CentOS1

Importing an existing disk as a new machine:

virt-install -n dpdk-01 -r 1024 --vcpus 2 --disk /home/bensley/Projects/VMs/dpdk-01-disk1.qcow,device=disk,bus=virtio -w bridge=virb r0,model=virtio -w bridge=virbr1,model=virtio --import

Install Ubuntu

Create a 30GB qcow2 image;

qemu-img create -f qcow2 /media/vm/cinnamon.qcow2 30720M

Create a new VM with 512MBs of RAM, 2 vCPUs and attach to existing network brdige br235;

sudo virt-install -n cinnamon -r 512 --vcpus 2 -f /media/vm/cinnamon.qcow2 --network bridge=br235 --cdrom /media/iso/ubuntu-12.04.3-server-amd64.iso