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:
How to bridge with KVM / Qemu / Virt-manager?
Every time I try to change the network settings, it just reverts back to default of NAT and says "some changes require a guest shutdown to take effect" even if the guest is already shut down.
I hate the idea that such mundane settings even require to restart the guest (every other vm solution I've used allows to do these things on the fly) but guess there's not much I can do. This is a remote dedicated server that runs CentOS as the base OS for the webserver and I just want to be able to run a few windows VMs on it so going something better like ESXi is not really an option.
Is there a way I can get this network stuff to work? I just want to bridge to the main network interface so I can then set a static IP in the range assigned by my server provider.
I found this tutorial, but there's got to be a better way. I can't take down or mess with eth0, this is a production server!
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,336
Original Poster
Rep:
On second thought, I kind of would like to just make eth0.x interfaces on the host, then forward specific ports to VMs, is this possible to do? This would allow me to manage stuff like IP blocks/allow lists right from IP tables and not even have to worry about individual firewalls in VMs. Since NAT is default config this may even be easier to do than trying to do bridge mode. Is this possible, if yes how do I go about setting this up?
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,336
Original Poster
Rep:
Why would a mac change cause you to have to remake the interface? I don't think I will be faced with that issue though, this is a dedicated server provider so I doubt they'll just start changing the mac on me.
At this point, I just want to make it work in a way where I don't have to screw around with the eth0 interface. It's just too risky. The tutorials I read seem to always point towards having to edit that. I'm guessing that is for situations where the eth0 is not actually used to access the server, but in this case it is. I cannot lose access to the actual host since it's about a thousand km away, there's simply no way of getting console access so I cannot risk any situation where I need to make a major change to it and have to restart networking. In fact, restarting networking in general is not exactly a proper approach. There's got to be a better way of doing it. I can't be having to screw around with the core networking each time I want to add a VM.
I hate the idea that such mundane settings even require to restart the guest (every other vm solution I've used allows to do these things on the fly) but guess there's not much I can do. This is a remote dedicated server that runs CentOS as the base OS for the webserver and I just want to be able to run a few windows VMs on it so going something better like ESXi is not really an option.
Like I told you before, that is a problem with your server configuration, not KVM/qemu/virt-manager.
On my test box, I made a bridge interface (vnet0) and added eth0 to it.
Code:
brctl addbr vnet0
ifconfig eth0 down
ifconfig eth0 0.0.0.0 promisc up
brctl addif vnet0 eth0
As you can see, the bridge has the same MAC address as eth0:
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,336
Original Poster
Rep:
This is a completely different server, when you say "my" configuration... what do I have to do? Everything is default. I did not configure anything, I just installed kvm, qemu, virt-manager and then ran virt-manager and created a new VM. When I try to change the network it just does not do anything. At some point I got some kind of error about operation not supported, I guess the options did stick after a while. If I try to use bridged now I get this:
This is what my ifconfig looks like now, is this right?
So if I do it your way I don't have to mess with eth0 then? All the tutorials I read seem to indicate either changing the config of eth0 directly, or having to do ifdown and ifup.
Just getting a blue screen of death though so network config working or not, don't think this VM solution will work for Windows anyway.
So if I do it your way I don't have to mess with eth0 then?
Just replace eth0 with eth0:1 and try the code on my previous post. That will ceate a bridge device with eth0:1
Quote:
Originally Posted by Red Squirrel
don't think this VM solution will work for Windows anyway.
A good artist does not blame his tools...
Like I, and others, told you before: qemu works fine with windows.
I have several windows 2008 and windows xp VMs running at work and a few win8/7/xp at home.
All run at near native speed.
If you are having performance issues, that is due to your particular setup.
Since you are running this on a hosted server, ask your provider for help.
Sharing the hardware specs would also help us spot potential problems.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.