What I am trying to do is simple as hell on vmware but no so straight forward (that I can find) to do with kvm on CentOS 8 via Cockpit.
When I create a virtual machine I want that vm to appear in the same subnet as the host. I want it to look like a regular device on my network.
What must I do to accomplish this?
From what I read online I think I have to use/setup a new bridge interface but I was unable to get this working due to a lack of understanding, created a loopback broadcast, fucked up my network temporarily and then had to roll it back.
If someone could provide an example of a working XML I would be very grateful.
That bit which says “in most configurations, does not work for host to guest communications” does that mean Windows does not play well with others?
From what I can see it sends all traffic from the nic I defined it to listen on. This will be very useful should I seek to setup a failover lagg in the future.
Aha… I found this a pain in the balls as well. I simply set up a pfsense box with a dedicated physical NIC and set up an internal only subnet behind it, and routed that
Will need to set things up this way at home, where I don’t have multiple NICs
doing this on a server and I have no GUI its just via CLI so I do not think I can use virt-manager.
Actually, you can. Most of the boxes I manage are headless.
virt-manager is a libvirt API frontend. It can connect to remote libvirtd instances and exchange information over SSH via the API.
Any Libvirt API clients can be used at the same time. Changes made in Cockpit reflect in virt-manager and vice versa, since both are just changing the state of the libvirtd on the system running the virtual machines.
You just configure the client on your local workstation or laptop with multiple destinations and initiate connections to them as needed. You can see multiple remote vmhosts configured in this setup.
Nope, has nothing to do with Windows. This method should work just fine for Windows VM’s as well, and since Windows doesn’t run libvirt natively, you can’t run into host-guest communication issues due to this.
What that warning refers to is host-guest communication. When you start up a virtual machine in NAT mode, a routing rule is put into place that allows you to access it via standard TCP/IP connections. Once your machine is running, you can open a terminal on your local machine and SSH into it’s NAT-based IP address.
When you use a macvtap device, that routing rule isn’t put into place, so attempting to SSH into the virtual machine fails with “No route to host”.
But that’s not a big deal because the workaround is easy enough. If you want access via your local machine and via the bridged mode setup, you can just add a second virtual NIC. One using bridged macvtap, and one using NAT.
Update: as of today with the release of CentOS 8.2 it is now possible to configure this way of networking through the Cockpit web GUI as the base Cockpit version has now been updated but let this thread stand as a reference in case any poor soul needs to configure it manually.
I forgot about this.
I never had any luck vis a vis guest to host.
All the nic options in virtual-manager were macvtap , all with “bridge” mode default, no “Nat” available. There was an option to pass through nics, but the problem was not reaching the internet, it was reaching the host, so I didn’t bother.
It wasn’t till I checked the networking page in cockpit that I saw an easy one click “make bridge” button.
Then choosing the bridge interface allows my guests to talk to the host And the network.
I guess I should have created a bridge earlier, through ip or whatever, but all the listed nic’s in the virtual-manager interface had bridge mode as default.
Not sure why I was getting this on Ubuntu, but one click in cockpit seems all I needed.
Sorry, forgot to mention multiple vm’s/guests sharing the same bridge0 are able to communicate to each other, the host, or the internet.
Using that one click bridge mode on cockpit.