Differences

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

Link to this comparison view

en:ressources:articles:kvm_qemu [2013/05/06 21:13] (current)
Line 1: Line 1:
 +====== KVM/Qemu recipes ======
  
 +I'm just copying and pasting stuffs I want to keep around. Maybe sometime I will write an article on this.
 +
 +sources:
 +  * http://​fedoraproject.org/​wiki/​Virtualization_Quick_Start
 +  * http://​www.howtoforge.com/​virtualization-with-kvm-on-a-debian-squeeze-server
 +
 +
 +===== - Do a snapshot of a VM =====
 +
 +<code bash>
 +$ virsh -c qemu:///​system
 +Welcome to virsh, the virtualization interactive terminal.
 +
 +Type:  '​help'​ for help with commands
 +       '​quit'​ to quit
 +
 +virsh # list
 + Id Name                 State
 +----------------------------------
 +  1 centos_gln ​          ​running
 +
 +virsh # save 1 /​home/​jvehent/​Documents/​GLN/​kvm/​centos_gln.img.snapshot.1300806811
 +Domain 1 saved to /​home/​jvehent/​Documents/​GLN/​kvm/​centos_gln.img.snapshot.1300806811
 +
 +</​code>​
 +
 +===== - Create a new network =====
 +
 +Fedora doesn'​t come with a predefined network. Virsh can be used to create one prior to creating new virtual machines.
 +
 +First, create the following file in **/​etc/​libvirt/​qemu/​networks/​default.xml**:​
 +<​file>​
 +<​network>​
 +  <​name>​default</​name>​
 +  <​uuid>​a9378609-10a3-400c-a0fd-6bea10567db6</​uuid>​
 +  <forward mode='​nat'/>​
 +  <bridge name='​virbr0'​ stp='​on'​ delay='​0'​ />
 +  <mac address='​52:​54:​00:​7c:​4d:​e8'/>​
 +  <ip address='​192.168.122.1'​ netmask='​255.255.255.0'>​
 +    <​dhcp>​
 +      <range start='​192.168.122.2'​ end='​192.168.122.254'​ />
 +    </​dhcp>​
 +  </ip>
 +</​network>​
 +</​file>​
 +
 +Then define this network using the **virsh** command line.
 +
 +<code bash>
 +virsh net-define /​etc/​libvirt/​qemu/​networks/​default.xml
 +</​code>​
en/ressources/articles/kvm_qemu.txt ยท Last modified: 2013/05/06 21:13 (external edit)
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0