User Tools

Site Tools


KVM/Qemu recipes

I'm just copying and pasting stuffs I want to keep around. Maybe sometime I will write an article on this.


- Do a snapshot of a VM

$ 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

- 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:

  <forward mode='nat'/>
  <bridge name='virbr0' stp='on' delay='0' />
  <mac address='52:54:00:7c:4d:e8'/>
  <ip address='' netmask=''>
      <range start='' end='' />

Then define this network using the virsh command line.

virsh net-define /etc/libvirt/qemu/networks/default.xml
en/ressources/articles/kvm_qemu.txt · Last modified: 2024/04/17 10:19 by