Networking warning after creating bridge

When my pc returns from sleep I see a warning about limited networking connectivity. It is probably related to a network bridge I created to have a QEMU macos VM share the network and so have macos File Sharing work. Since I am not a network savvy I followed steps shown on github related to creating that macos VM. (macOS-Simple-KVM/ at master · foxlet/macOS-Simple-KVM · GitHub) Below I have copied the relevant journald log and below that the Networkmanager nmcli recipe I used (which does work). It seems to me that this bridge setup leaves the system in a not so good state. I am ofcourse happy to provide more info.

02-08-2022 13:11	kded5	"Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/2”"
02-08-2022 13:11	kdeconnectd	"Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/2”"
02-08-2022 13:11	kded5	"Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/1”"
02-08-2022 13:11	kdeconnectd	"Object does not exist at path “/org/freedesktop/NetworkManager/ActiveConnection/1”"
02-08-2022 13:11	NetworkManager	<info>  [1659438682.2489] manager: NetworkManager state is now CONNECTED_SITE
02-08-2022 13:11	NetworkManager	<info>  [1659438694.5177] device (br1): carrier: link connected
02-08-2022 13:11	NetworkManager	<info>  [1659438696.2939] manager: NetworkManager state is now CONNECTED_GLOBAL
02-08-2022 13:22	kwin_x11	qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 25564, resource id: 41943773, major code: 18 (ChangeProperty), minor code: 0
02-08-2022 13:22	kwin_x11	qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 27023, resource id: 73400340, major code: 18 (ChangeProperty), minor code: 0
02-08-2022 13:24	kwin_x11	qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 37022, resource id: 77594808, major code: 2 (ChangeWindowAttributes), minor code: 0

The recipe is:
You can use NetworkManager to control the bridge and tun/tap interfaces, by creating them with the following commands. Replace DEVICENAME with your ethernet card’s device name. (And that is eno1).

Make the Bridge

nmcli connection add type bridge \
    ifname br1 con-name mybridge

Attach Bridge to Ethernet

nmcli connection add type bridge-slave \
    ifname DEVICENAME con-name mynetwork master br1

Make the Tun/Tap

nmcli connection add type tun \
    ifname tap0 con-name mytap \
    mode tap owner 1000

NB The “owner 1000” is in the recipe "owner ‘id -u’ " which created an error.

Attach Tun/Tap to Bridge

nmcli connection mod mytap connection.slave-type bridge \
    connection.master br1

Attach Bridge to QEMU

Once you have set up the bridge and tun/tap on the host, you’ll have to add the following line to (in , replacing -netdev user,id=net0. Change tap0 to your corresponding device name.

-netdev tap,id=net0,ifname=tap0,script=no,downscript=no \
❯ nmcli connection show
NAME       UUID                                  TYPE      DEVICE 
mybridge   fec3d3ef-935a-4e64-8ead-85d3bc80231e  bridge    br1    
eno1       8da4fb47-be32-40cf-8f9e-2944bc363124  ethernet  eno1   
mytap      39e52158-4886-4d31-806e-d4ff654578ed  tun       tap0   
mynetwork  d21e4903-4bc8-49e8-b65a-3beb309e247c  ethernet  -- 

mybridge and mytap lines are in bright green, the eno1 line is dark green, the mynetwork line is white.

this is probably supposed to be

mode tab owner 1000

but I could not find anything about the “owner” part
in the manual for

man nmcli

it’s likely a typo as well as incorrect syntax
and would result in a failure to execute that command for each one of these reasons

… but I did not yet look at the guides that you referenced …

now that I did have a look:

have a look at the arch wiki on this (creating a bridge)
or use the part where he describes it using netctl
if nmcli fails to do what the author thought it would

macOS-Simple-KVM/ at master · foxlet/macOS-Simple-KVM · GitHub

Thanks for looking into this. Yes, maybe it is better to try the setup with netctl. What are the steps to roll back the nmcli setup?
On the Arch wiki Network bridge - ArchWiki there is not a description how to do that with nmcli, only with bridge-utils. The 2nd post in Need help creating a network bridge gives an example which I do not understand.

to be honest: I don’t know.

but every step/keyword that creates something
could probably be adapted to remove that same thing, by using another keyword.

I haven’t tried - I’ll not remove my working bridge device just to find out :wink:

and that is what I used, not nmcli, but bridgeutils
as far as I can remember that is - it’s at least two years ago now

you’d need to elaborate - because on first glance, this also refers to the very same arch wiki mentioned earlier.

I always prefer the arch wiki over anything else.

The 2nd post says:
Athlon13: Can you try this?
#!/usr/bin/env bash
nmcli con add ifname br10 type bridge con-name br10
nmcli con add type bridge-slave ifname enp3s0 master br10
nmcli con modify br10 bridge.stp no
nmcli con down “Conexión cableada 1”
nmcli con up br10
ip a s br10

!/usr/bin/env bash
nmcli con down br10
nmcli con delete nmcli -f NAME,UUID con | grep -i bridge-slave-enp3s0 | awk '{print $2 }'
nmcli con delete nmcli -f NAME,UUID con | grep -i br10 | awk '{print $2 }'
nmcli con up enp3s0
ip a s

The idea here seems to be: use the script “up” when you need the bridge and the script “down” when you are done using the bridge. And that is appealing to me now, because of the slow downs that the bridge seems to cause after I am done using it.

If you read further down, it is explained that

refers to the unique name of that wired connection on the “explainers” computer.
the command sequence would need to be adapted to fit your needs
(the spanish name for “wired connection 1” for one …)

I cannot say whether this does what is described
it was an example - probably untested - I don’t know

What is it that you struggle with, understanding it?

no - scratch that

Just use the arch wiki to create a bridge device.
It’s mere presence does not slow down anything.

“Slow down” in the sense that somehow my pc when returning from sleep is not seeing internet connectivity for a few seconds.
What I can try is first create a timeshift snapshot, then more-or-less reverse the “nmcli creates” with “deletes” and see what happens. And /Or roll back to a timeshift snapshot created before this nmcli adventure. :wink:

I will not an cannot debug this.

My advice:
remove that somehow defunct bridge that you created using several guides using nmcli

It appears that this way does not actually work that well - certainly not for you.

(and) use the Arch Wiki documentation on qemu and kvm … and on how to create a bridge device
bridging whatever network connection you currently have and use
to a virtual machine
so it as well has connectivity.

You can do without a bridge, of course.
It’s “less efficient” or “not as fast” … it is said.
In practice I have seen no difference to just using NAT.

But I don’t run several VM’s at the same time - perhaps that is where performance decreases without a bridge.

I have seen no difference - but my network speed is slow anyway.
I’m probably not hitting any noticeable limits with 1 Mbit/s tops :wink:

rolling back your whole system
just to remove a bridge device
is overkill, to put it mildly

Well, Vielen Dank for your help, it is really appreciated!

Kein Problem.
… dann hätten wir ja gleich deutsch reden können :wink:
but the vast majority here would not have been able to follow …

Genau, und my native language is Dutch.

For posterity: I just deleted the 3 connections that were added by the “nmcli recipy” e.g.

nmcli conn delete mytap

and nmcli did that without protesting. (It probably thought I knew what I was doing) After that the internet was un-reachable. I logged out and back in, and now the desktop was gone too! After a reboot the desktop and the ethernet connection returned. Phew!
So did is not the way to do it :crazy_face: