Libvirt Port Forwarding – How to Set Up with KVM Virtualization

kvm-virtualizationlibvirtport-forwardingqemu

I'm trying to get port forwarding working through libvirt on top of QEMU and KVM. I found this article (https://snippets.webaware.com.au/howto/running-qemu-with-port-redirection-through-libvirt/), but the XMLNS it points to (http://libvirt.org/schemas/domain/qemu/1.0) does not seem to exist anymore. Any advice would be greatly appreciated!

I'm running libvirt version 1.2.18 and qemu-kvm version 2.3.0

Thanks

Best Answer

If you want to run a server, you should not use port-forwarding anyway. You can create a bridge on your physical ethernet interface and use your VM network interfaces as slaves of this bridge as. Then every VM can get its own IP address and you can access it directly (just open the port on the VM). Network setup is mentioned in the libvirt docs.