0

I would like to install a KVM type-1 hypervisor. This hypervisor should run two guest operating-systems. Both guest operating-systems need one IPv4 address from 192.168.11.0/24 network and I guess that I should configure one IPv4 address to hypervisor itself for management purposes? I am familiar with bridges under Linux and VLAN-subinterfaces, but what is the recommended practice for such KVM installation, i.e. which interfaces should I create in hypervisor and which interfaces should I create for virtual-machines with virt-install and how should I configure management for hypervisor itself?

  • 1
    What are the options you want to compare? The mail point is IMHO whether the VMs shall be able to (a) communicate with each other and (b) to communicate with the outside world without routing on the hypervisor. – Hauke Laging Jan 16 '15 at 17:26
  • 1
    I am not sure if it helps but I followed this approach and got it to work in my machine. – Ramesh Jan 16 '15 at 18:09
  • @HaukeLaging If I read the "Setting guest network" document for KVM, then "Public Bridge" seems to be the set-up I need: linux-kvm.org/page/Networking#public_bridge In other words, just as you said, VMs shall be able to communicate with each other and with outside world. So I need to create a bridge(br0), add one of the physical interfaces(eth0 in my case) into this bridge, create a tun device(tun0) and add it to this very same bridge br0. So I guess I need to create the VMs with virt-install using "--network bridge:tun0" option? – Martin Jan 19 '15 at 22:49
  • 1
    If you need only 2 vms then maybe a separate manager layer like virsh/virt-install is a bit much. Abstracting like that will only remove you - and your understanding of what makes it tick - from the whole process. This makes sense when talking about spawning vms programatically in great number - but if you just want to launch two vms occasionally then you'd probably get a better feel for how its done in man qemu. – mikeserv Jan 20 '15 at 0:01
  • 1
    qemu-kvm isnt a thing anymore - for a while it was the kernel support was getting baked-in to project, but its just qemu now. And yeah - those tools are indirect layers atop it. You can just call qemu from the cmdline. Check its man pages. Its easy. – mikeserv Jan 21 '15 at 16:06
1

I have never used virt-install, I always use virsh define file.xml. But a look at the man page tells me that --network bridge:tun0 is wrong. You need --network=bridge=br0.

I am not a libvirt/qemu expert thus I don't know whether you can create a tun device and make libvirt use it. Usually virtual interfaces are created dynamically when a VM is started and get connected to the bridge (and/or network).

In libvirt's XML it looks like this:

<interface type='bridge'>
  <mac address='52:54:00:42:c4:c8'/>
  <source bridge='br0'/>
  <model type='virtio'/>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.