1
Libvirt is a virtualization infrastracture
3
configuration: /etc/libvirt
5
UI client: virt-manager
6
/var/run/libvirt/libvirt-sock - should be accessible by user
9
vde: VDE network to connect with stand-alone qemu (not needed in simple config)
10
dnsmasq: DNS proxy (automatically launched)
13
- Libvirt network manager (TAP based), creates two interfaces
14
virtbr0 - bridge used by the clients
15
vnet0 - virtual NAT device which masquerades packets from virtbr0
16
this configured using following directive in domain config (networks
17
are defined in /etc/libvirt/qemu/networks):
18
<interface type='network'>
19
<mac address='54:52:00:63:a8:88'/>
20
<source network='default'/>
22
- Existing bridges can be used:
23
<interface type='bridge'>
24
<mac address='54:52:00:63:a8:88'/>
25
<source bridge='br0'/>
27
The bridges are created in /etc/conf.d/net
30
and can be checked using 'brctl' tool
32
- If virtual machine with configured networking is executed using libvirt,
33
by 'ps | grep kvm' you can see network parameters, something like:
35
Running it directly will never work because libvirt normally sets up the
36
network connections and passes them as open files to kvm.
39
Sharing network with stanalone qemu
40
===================================
41
1. We are creating a VDE network
42
- Lets call it 'vlan0'
43
- It should be accessible by users
45
VDE_SOCK_CHOWN=":qemu"
46
- The actual IP in /etc/conf.d/vde is not important, it just should not
47
interfer with other networks
48
2. Creating a bridge to vlan0, and setting it's IP to the network where would
49
reside our virtual machines
51
config_br0=("192.168.28.1/24")
53
3. Libvirt virtual machines should be configured to use bridge 'br0'
54
<interface type='bridge'>
55
<mac address='54:52:00:63:a8:88'/>
56
<source bridge='br0'/>
58
4. Qemu is started as follows
59
kvm -net nic,model=rtl8139 -net vde,vlan=0,sock=/var/run/vde.ctl ...
61
Independ how the virtual machine is run, it could have an address from
62
192.168.28.xxx network.
64
The following daemons should be started:
66
- dnsmasq (automatically executed by libvirt, but is needed if only a
67
standalone machines are used and libvirt is not started)
71
- There is multiple things which will prevent suspend: SATA/IDE controllers
72
(virtio works fine), passthrough PCI devices (USB is fine), ...
73
- By default libvirt tries to suspend machines on shutdown, if something
74
prevents machine from suspending, they will crash. So, it is better to
75
change behavior to shutdown
b'\\ No newline at end of file'