Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
kvm [2012/04/14 14:13]
stojan
kvm [2012/04/14 14:20]
stojan
Line 2: Line 2:
 ** **
 Creating VMs from Debian repositories** Creating VMs from Debian repositories**
 +
 +How to create a new VM with 2GB of memory and 15GB disk image directly from Debian repo:
 +
 <code> <code>
 virt-install -n vmserver -r 2048 --os-type=linux --os-variant=debiansqueeze \ virt-install -n vmserver -r 2048 --os-type=linux --os-variant=debiansqueeze \
---disk /backups/vmserver.raw,device=disk,bus=virtio,size=15,sparse=true,format=raw -w bridge=br0,model=virtio \+--disk /vmdisk/vmserver.raw,device=disk,bus=virtio,size=15,sparse=true,format=raw -w bridge=br0,model=virtio \
 --vnc --noautoconsole --location  http://cdn.debian.net/debian/dists/stable/main/installer-amd64/ --vnc --noautoconsole --location  http://cdn.debian.net/debian/dists/stable/main/installer-amd64/
 </code> </code>
 +
 +**Some useful commands for handling VMs**
 +
 +List existing VMs:
 +<code>
 +virsh list
 +</code>
 +
 +Shutdown an existing VM:
 +<code>
 +virsh shutdown vmname
 +</code>
 +
 +Destroy (hard shutdown) an existing VM:
 +<code>
 +virsh destroy vmname
 +</code>
 +
 +Start an existing VM:
 +<code>
 +virsh start vmname
 +</code>
 +
 +Set the 'autostart' flag on the existing VM:
 +<code>
 +virsh autostart vmname
 +</code>
 +
 +Clone an existing VM. Make sure you update the udev settings after cloning if you want your network to work:
 +<code>
 +virt-clone -o OldVM -n NewVM -f /disk/NewVmImage.img
 +</code>
 +
 +Remove a VM from the system 'registry':
 +<code>
 +virsh undefine vmname
 +</code>
 +
  
 [[http://www.linux-kvm.com/content/get-performance-boost-backing-your-kvm-guest-hugetlbfs|Get a performance boost by backing your KVM guest with hugetlbfs]] [[http://www.linux-kvm.com/content/get-performance-boost-backing-your-kvm-guest-hugetlbfs|Get a performance boost by backing your KVM guest with hugetlbfs]]
kvm.txt ยท Last modified: 2012/04/14 14:25 by stojan
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0 ipv6 ready