Is there an easier way to do bridged networking with KVM?
Linux - Virtualization and CloudThis forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,336
Rep:
Is there an easier way to do bridged networking with KVM?
Every other VM solution I've used never required to screw around with network configuration to create virtual interfaces, or having to restart the service or reboot, but everything I read seems to lead to having to edit the interfaces file and restarting networking.
Is there not a better way to do this? Why can't I just bridge directly to the eth0.3/bond0.3 etc interfaces? (where 3 is vlan id). Is there something I'm missing?
Also when they say "use virtio" what exactly do they mean? What do I do to use that? I feel like all the documentation I read makes too many assumptions about existing knowledge. I can't seem to find anything that starts from the beginning.
Currently to add vlans I just use "vconfig add bond0 3" where 3 is vlan 3. I don't use the interface script because that requires a network restart, which is unacceptable on a production machine. I have a startup script that also executes all these to add vlans. If I later on want to add another vlan then I just edit that script, but I can also issue the command.
Is there a way to do this with bridging, or a way to just bridge directly to the actual vlan interface instead of having to create two interfaces per vlan?
I also read a lot about xml files, where am I suppose to create these?
Last edited by Red Squirrel; 06-02-2014 at 09:50 PM.
the short answer is yes. Longer answer is that you can use lib-virt, and virt-manager to easily set this up once and forget about it. How to install these depends on your OS.
in the "Virtual Networks" tab click on the "+" to add a new network and then you should be walked through setting up a new network however you like.
Alternatively you can use the virsh on the command line to create, modify, start, stop, etc networks. See the man page or online documentation for details.
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,336
Original Poster
Rep:
I was trying to figure out how to use vish but it wants a xml file to create a network, I have no idea what that file is, how or where I create it. Nothing seems to explain that.
I was trying to figure out how to use vish but it wants a xml file to create a network, I have no idea what that file is, how or where I create it. Nothing seems to explain that.
You can create it using virt-manager as explained above. Then if you need to tweak some seetings you can use virsh. For example if you have a network called "default", you can modify it with:
Code:
virsh net-edit default
You'll need to read the documentation if you want to use virsh.
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,336
Original Poster
Rep:
Do you have any documentation I should start with? I'm having trouble finding something that's targeted at someone who has never used it before. I'm also really confused about all the different tools/systems used. There's qemu, kvm, libvirt, virt-manager, virtsh etc... just not sure what I'm suppose to use and what not, so even googling for documentation is hard as I'm not even sure what I should be searching for.
Do you have any documentation I should start with? I'm having trouble finding something that's targeted at someone who has never used it before. I'm also really confused about all the different tools/systems used. There's qemu, kvm, libvirt, virt-manager, virtsh etc... just not sure what I'm suppose to use and what not, so even googling for documentation is hard as I'm not even sure what I should be searching for.
libvirt is a set of libraries/tools for managing virtual machines. It can be used to manage kvm and others. Roughly speaking, virt-manager is a graphical front end for using libvirt and virsh is a commandline front end for using libvirt. Perhaps https://wiki.debian.org/libvirt is reasonable place to start.
If you have libvirt installed on your machine, there is a very nice, version specific documentation library in your docs directory. On my Slackware install the index page for it is file:///usr/doc/libvirt-1.0.3/html/index.html.
Evo is exactly correct with the reference but when I first started digging into libvirt I created confusion for myself looking at some documentation that didn't refer to my particular version.
Libvirt seems to be under extremely heavy development releasing version 1.2.5 just the other day.
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,336
Original Poster
Rep:
I decided to give up and go ESXi. Installing it now. Maybe once libvirt/kvm/qemu etc is more mature and has a more unified management system I will reconsider it. There is just too much involved to do simple things that are normally a mouse click away in any other hypervisor. I don't know why Linux devs always make things more complicated than they have to be. I think that is the biggest thing that keeps people away from Linux. Nothing is plug and play, you always have to read tons of documentations and do tons of stuff manually.
Here's about 30 3rd party management tools that work with QEMU-KVM. Many of them web based so their as graphical as any other GUI.
That said, they have an extremely well developed commandline interface (I thinks so anyway)
One of the things I really prefer about QEMU-KVM is they seem to work on developing functionality instead of interface. They leave that to the user, which makes sense in the environment they're working in.
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,336
Original Poster
Rep:
Wow did not know there was that many management interfaces, I googled but did not find much. Once I migrate everything over from my old server I can maybe experiment more on the old server when I get the chance.
I'm already setting up VMs and everything in vmware now so probably going to stick with that, but I will still need a fallback plan in case they stop making it free, and eventually if I add multiple servers I will want to be able to do live migrations and stuff. Though another issue with kvm is having to shut down the vm just to do a trivial change like changing the cd though, unless some of those tools fix that problem?
You know Red, I'm really interested in comparing vmware to QEMU-KVM in some limited applications, anything you can post about your experiences converting images would be welcome.
If you have libvirt installed on your machine, there is a very nice, version specific documentation library in your docs directory. On my Slackware install the index page for it is file:///usr/doc/libvirt-1.0.3/html/index.html.
OP is running Debian, so would need to install the libvirt-doc package and will then find the docs at file:///usr/share/doc/libvirt-doc/index.html
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.