/srv/irclogs.ubuntu.com/2021/10/04/#ubuntu-server.txt

=== not_phunyguy is now known as phunyguy
=== Poster` is now known as Poster
=== gpiccoli_ is now known as gpiccoli
=== genii-core is now known as genii
=== masACC is now known as maswan
wdop_Hello, I have a problem bridging ethernet on Ubuntu 21.04 (Host) into kvm/qemu. I had a working configuration until for some reason I deleted the bridge using nm-connection-editor. Now the "wired connection" inside the vm is not working anymore. Anyone could help me?16:59
wdop_I asked in #ubuntu and someone sent me here..17:01
wdop_I tried setting up a bridge but when I want to add a bridged connection "ethernet" on the next dialog I cannot choose a device.17:03
tomreynwdop_: you can also use brctl to set it up17:41
wdop_@tomreyn, I look into that now. Thanks!18:00
wdop_@tomreyn, "brctl show" returns:18:05
wdop_virbr08000.525400423a34yes18:05
wdop_just one line. I am wondering how to proceed from here. In fact, my knowledge is very limited concerning this things.18:06
=== sarnold_ is now known as sarnold
tomreynwdop_: you can create a bridge using "brctl", then optionally attach interfaces to it using "brctl addif", btut you can actually do this with "ip", too.18:16
tomreyneither command provides help on usage and a man page18:17
wdop_Thanks, I barely understand the terms :( Are there good examples of how to do this? I am looking here atm: https://computingforgeeks.com/managing-kvm-network-interfaces-in-linux/18:18
tomreyn!man18:19
ubottuThe "man" command brings up the Linux manual pages for the command you're interested in. Try "man intro" at the  command line, or see https://help.ubuntu.com/community/UsingTheTerminal | Manpages online: http://manpages.ubuntu.com/18:19
tomreynhttps://www.linux-kvm.org/page/Networking18:19
tomreynyou seem to want a "Private Virtual Bridge"18:20
tomreynactually i don't know that, you might as well want a public one18:21
wdop_Yes :) I all worked until I deleted the bridge in a stupid move yesterday. Thanks again. I will try my best!18:21
wdop_I am on 21.04 on a laptop and have 20.04 running inside kvm (w/o working wired connection)18:22
wdop_One more question: What is the type of bridge that is used when first installing kvm on a clean system and then running another Ubuntu in the vm?18:24
TJ-wdop_: that's not done with kvm; I think what you may be using is libvirt/virt-manager ?18:24
wdop_yes18:24
TJ-wdop_: in which case if it's the virbr0 you deleted, restarting libvirtd service will recreate it18:25
TJ-virbr0 is used as part of the default network for the hypervisor18:25
wdop_How would I check if it is recreated? 18:26
TJ-wdop_: restart the service (stop the guest first) "sudo systemctl restart libvirtd"18:27
wdop_done18:27
TJ-wdop_: then "ip link show dev virbr0" should show it has been recreated18:27
wdop_5: virbr0: <BROADCAST,MULTICAST> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 100018:28
wdop_    link/ether 52:54:00:42:3a:34 brd ff:ff:ff:ff:ff:ff18:28
TJ-wdop_: now restart the guest and you should be OK18:28
wdop_really? ok, lat's see18:28
TJ-wdop_: first guest using that bridge should cause the bridge to be put into state UP18:28
wdop_no18:29
wdop_In the UI it shows Wired connecting...18:29
TJ-wdop_: then it is possible you have some other form of network configured in libvirt/virt-manager18:29
wdop_how would I check?18:30
TJ-wdop_: what does "virsh net-list" report?18:31
wdop_ Name      State    Autostart   Persistent18:31
wdop_--------------------------------------------18:31
wdop_ default   active   yes         yes18:31
wdop_ip link show dev virbr018:32
wdop_5: virbr0: <BROADCAST,MULTICAST> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 100018:32
wdop_    link/ether 52:54:00:42:3a:34 brd ff:ff:ff:ff:ff:ff18:32
TJ-wdop_: show us "virsh net-dumpxml default" (in a pastebin)18:32
wdop_https://pastebin.com/VasyuLs418:33
TJ-wdop_: now lets check the guest(s) and what they are connected to. " virsh list --all | nc terbmin.com 9999 "18:34
TJ-oops, typo18:35
TJ-wdop_: now lets check the guest(s) and what they are connected to. " virsh list --all | nc termbin.com 9999 "18:35
TJ-got the m and b swapped!18:35
wdop_https://termbin.com/qg8j18:35
TJ-so it'll be ubuntu20.04 ?18:36
wdop_Both are the same image.18:36
wdop_Let's take the MPI-Ae18:36
TJ-" virsh dumpxml MPI-AE | nc termbin.com 9999 "18:37
wdop_virsh dumpxml MPI-AE | nc termbin.com 999918:37
wdop_https://termbin.com/fn5418:38
TJ-you've got the correct linkage in there " <interface type='network'>"18:40
TJ-so starting the guest should work18:41
TJ-if the problem is solely the guest cannot get to the Internet, then you may affected the host iptables rules18:42
TJ-libvirt sets up IP Masquerading for IPv4 via iptables18:42
wdop_It is in state "connecting" again. no luck18:42
TJ-wdop_: what is 'it' ? the guest's GUI network applet ?18:43
wdop_sorry! yes. the applet on the top right says "Wired Connectiong" and also under Settings -> Network18:44
TJ-wdop_: ok, in the guest start a terminal, then check the log with "journalctl -u NetworkManager -n 50" 18:45
wdop_Now on the guest: "Activation of the network connection failed"18:45
TJ-that'll show the last 50 messages, and in there should be a clue as to why18:45
wdop_You give me hope!18:45
wdop_Should I pate the output? patebin?18:46
wdop_*paste18:46
TJ-if the interface is set to use IPv4 DHCP and that is what is failing, then there's a problem with the hypervisor's DHCP service18:46
TJ-If I recall correctly, the libvirt makes uses of private dnsmasq instances 18:47
TJ-so on the host check if any are active, with "ps -efly | grep dnsmasq "18:47
wdop_https://pastebin.com/vKnmM8uc18:47
TJ-"dhcp4 (enp1s0): request timed out"18:48
TJ-so we've now confirmed that is the cause18:48
wdop_ps -efly | grep dnsmasq18:48
wdop_S libvirt+    1513       1  0  80   0  1948  2439 -      03:36 ?        00:00:00 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper18:48
wdop_S root        1514    1513  0  80   0   332  2432 -      03:36 ?        00:00:00 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper18:48
TJ-wdop_: other than deleting the virbr0 using nmcli, did you do anything else network related, like add/remove iptables rules?18:49
TJ-wdop_: those are the expected processes, owned by libvirt too18:49
wdop_1. I deleted the bridge using the nm-connection-manager18:49
wdop_2. I installed/purged protonvpn18:50
wdop_3. Then installed protonvpn again18:51
TJ-wdop_: I'm thinking you've altered something in iptables by doing that. Show us "sudo iptables-save | nc termbin.com 9999 "18:51
wdop_Currently it is not running18:51
wdop_https://termbin.com/8fli18:52
TJ-wdop_: that all looks correct too18:55
wdop_To ansswer your question from before, I didn't execute any iptables commands before.18:55
TJ-I'm wondering if it is routing, which the vpn may have messed with18:55
TJ-show us " ip route show | nc termbin.com 9999 "18:56
wdop_ip route show | nc termbin.com 999918:56
wdop_https://termbin.com/jbh418:56
TJ-It's a while since I used IPv4 networking but that looks correct; nothing there affecting the virbr0 network18:58
wdop_hm. I will now completely purge the protonvpn, in the meantime18:59
TJ-I don't see anything affecting it right now18:59
wdop_ok19:00
wdop_Would a "apt purge" for kvm/qemu maybe help in resetting the configuration? Thanks so much for your help so far. 19:04
TJ-is the guest active right now? if so, is the bridge in state UP? "ip lnk show dev virbr0"19:04
TJ-oops, another typo. "ip link show dev virbr0"19:04
wdop_5: virbr0: <BROADCAST,MULTICAST> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 100019:05
wdop_    link/ether 52:54:00:42:3a:34 brd ff:ff:ff:ff:ff:ff19:05
wdop_no problem, a realized this ;)19:05
TJ-hmmm, it's still down! try "sudo ip link set up dev virbr0"19:05
wdop_done19:06
wdop_ip link show dev virbr019:06
wdop_5: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 100019:06
wdop_    link/ether 52:54:00:42:3a:34 brd ff:ff:ff:ff:ff:ff19:06
TJ-!!19:06
wdop_I return nothing, btw19:06
TJ-wdop_: have you by chance enabled systemd-networkd on this host?19:06
wdop_idk19:06
TJ-if there were a config, and it is somehow set to manage virbr0, then it could be forcing this19:07
TJ-that interface should be UP now19:07
TJ-wdop_: show us " ip -d link show | nc termbin.com 9999 "19:08
wdop_https://termbin.com/f13hk19:09
TJ-ahhh "vnet1" is "tun type tap" 19:10
wdop_If I knew what this means really..19:11
TJ-I'm setting up an identical config here to compare19:13
wdop_wow19:14
wdop_I will copy the chat history and work through this again to understand the steps we took!19:15
TJ-is it working for you? I'm seeing identical results here to commands but the guest got an address from DHCP without a problem19:17
TJ-turns out virbr9 showing state DOWN is correct :s19:18
wdop_How should I check, just starting the guest and "journalctl -u NetworkManager -n 50"19:19
TJ-actually no, virbr0 is state UP here19:19
wdop_aha19:19
TJ-I'm not sure what you've done!19:21
TJ-let's see if the host's NM is doing something. " journalctl -u NetworkManager -n 250 | nc termbin.com 9999 !19:23
wdop_https://termbin.com/b97oa19:24
wdop_doing nothing...19:26
wdop_>Reminder: Host is 21.04, Guest is 20.0419:27
TJ-that looks ok;I can see you deleted the 2 NM connections that were attached to the bridge and vnet port19:29
TJ-so NM isn't trying to manage them as far as that log shows19:29
TJ-I'd have thought that "device (virbr0): carrier: link connected" would imply "ip link show dev virbr0" should show state UP now19:30
wdop_5: virbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 100019:30
wdop_    link/ether 52:54:00:42:3a:34 brd ff:ff:ff:ff:ff:ff19:30
wdop_It is up now.19:30
wdop_?19:30
TJ-aha!19:32
TJ-so has the guest been able to get an IPv4 address ?19:32
wdop_No.19:32
TJ-hmmph19:33
TJ-when (date/time) did you delete the working config? I want to find the log entries from before then to learn how it was configured when it worked19:33
wdop_hwo to I check? dhclient?19:34
TJ-was it today? yesterday?19:34
wdop_yesterday.19:34
TJ-so 3rd Oct19:34
TJ-roughly what time of day?19:34
wdop_yes19:34
wdop_start from 18:00, but not 100% sure19:35
wdop_Should I reboot the guest?19:37
TJ-no, it doesn't look to be the problem19:37
TJ-show us " journalctl -u NetworkManager --since="2021-10-03 12:00" --until="2021-10-03 22:00" | nc termbin.com 9999 "19:38
wdop_https://termbin.com/aojo19:39
wdop_hmmm, too big?19:40
TJ-ow, looks like loads of VPN errors19:40
wdop_I grep them out?19:40
TJ-lets filter it:  " journalctl -u NetworkManager --since="2021-10-03 12:00" --until="2021-10-03 22:00" | grep -v AEAD | nc termbin.com 9999 "19:41
wdop_https://termbin.com/nrp219:41
wdop_I had this problem with the pvpn-killswitch that was still there in the table of connections after uninstalling protonvpn yesterday. This prevented wifi from connecting. So I deleted the bridge first. but this didn't help. Then deleted the two protonvpn connections that were still there. After that WIFI on the host worked again.19:45
wdop_But the guest then had this current issue which we are working on now.19:45
TJ-hmmm. Can't see anything useful in the log, aside from an apparent confirmation it was working at "Okt 03 21:23:49 nador NetworkManager[1332]: <info>  [1633289029.9938] device (virbr0): bridge port vnet5 was attached"19:46
wdop_Wait maybe it was after midnight?19:46
wdop_https://termbin.com/c1xy19:47
TJ-unfortunately there's not enough info in the logs to reconstruct how it was configured19:47
wdop_I am thankful for your help, even when we cannot solve it. What would you advice me to do? 19:56
TJ-one thing we haven't done is look at the libvirtd log19:57
wdop_ok19:57
TJ-show us " journalctl -u libvirtd -n 500 | nc termbin.com 9999 "19:57
TJ-I notice here it reports some dnsmasq DHCP actions19:58
wdop_https://termbin.com/9wwu19:58
TJ-aha! "DHCP packet received on virbr0 which has no address"19:59
TJ-so, either libvirt isn't adding the address, or something is removing it whwn libvirt does19:59
TJ-lets try it manually to begin with, from the options we saw earlier20:00
TJ-" sudo ip addr add 192.168.122.1/24 dev virbr0 "20:00
TJ-then ensure it 'stuck' with "ip addr show dev virbr0 "20:00
wdop_ip addr show dev virbr020:01
wdop_5: virbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 100020:01
wdop_    link/ether 52:54:00:42:3a:34 brd ff:ff:ff:ff:ff:ff20:01
wdop_    inet 192.168.122.1/24 scope global virbr020:01
wdop_       valid_lft forever preferred_lft forever20:01
wdop_    inet6 fe80::5054:ff:fe42:3a34/64 scope link 20:01
wdop_       valid_lft forever preferred_lft forever20:01
TJ-good, now poke the guest see if it'll get an address20:01
wdop_yeah!!!!20:01
TJ-the libvirt 'default' network config you showed earlier says it should be setting that address20:01
TJ-https://pastebin.com/VasyuLs420:02
TJ-so either that had a glitch, or something else is removing the address when it is added20:02
wdop_just reboot and see if it is permanently fixed?20:03
TJ-last time it worked: "Okt 03 21:23:59 nador dnsmasq-dhcp[1946]: DHCPACK(virbr0) 192.168.122.111 52:54:00:e2:cb:27 franks"20:03
wdop_ok20:03
TJ-reboot should never be needed on Linux, just stop/start the correct services20:04
TJ-so, lets manually clean up and stop things then start them again20:04
wdop_yes I know ;) it has always been "networking" but this is gone in 21.04, no?20:04
TJ-1. Shutdown the guest  2. on host "sudo systemctl stop libvirtd" 20:04
TJ-3. check if virbr0 has gone "ip link show dev virbr0"20:05
wdop_1. DONE 2. sudo systemctl stop libvirtd20:06
wdop_Warning: Stopping libvirtd.service, but it can still be activated by:20:06
wdop_  libvirtd-admin.socket20:06
wdop_  libvirtd-ro.socket20:06
wdop_  libvirtd.socket20:06
wdop_ip link show dev virbr020:06
wdop_5: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 100020:06
wdop_    link/ether 52:54:00:42:3a:34 brd ff:ff:ff:ff:ff:ff20:06
TJ-hmm20:07
TJ-make sure the service stopped "systemctl status libvirtd"20:07
wdop_Start it manually?20:07
TJ-we want virbr0 to disappear20:08
wdop_● libvirtd.service - Virtualization daemon20:08
wdop_     Loaded: loaded (/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)20:08
wdop_     Active: inactive (dead) since Mon 2021-10-04 22:06:07 CEST; 1min 54s ago20:08
TJ-good, dead20:08
TJ-let's manually remove the interface: "sudo ip link del dev virbr0"20:08
wdop_DONE20:09
TJ-check if has gone "ip link show dev virbr0"20:09
wdop_Device "virbr0" does not exist.20:09
TJ-great20:09
TJ- "systemctl start libvirtd" and then "ip link show dev virbr0; ip addr show dev virbr0"20:09
wdop_systemctl start libvirtd20:11
wdop_efemha@nador:~$ ip link show dev virbr0; ip addr show dev virbr020:11
wdop_Device "virbr0" does not exist.20:11
wdop_Device "virbr0" does not exist.20:11
TJ-it's not re-adding it is it?20:11
TJ-I'm doing the same ops here20:11
wdop_sudo systemctl status libvirtd20:12
wdop_● libvirtd.service - Virtualization daemon20:12
wdop_     Loaded: loaded (/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)20:12
wdop_     Active: active (running) since Mon 2021-10-04 22:10:39 CEST; 1min 24s ago20:12
wdop_ip link show dev virbr0; ip addr show dev virbr020:13
wdop_Device "virbr0" does not exist.20:13
wdop_Device "virbr0" does not exist.20:13
TJ-ok do "virsh net-start default" and that should do it20:13
wdop_Network default started20:13
TJ-check it has an IP address20:13
wdop_ip link show dev virbr0; ip addr show dev virbr020:13
wdop_57: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 100020:13
wdop_    link/ether 52:54:00:42:3a:34 brd ff:ff:ff:ff:ff:ff20:13
wdop_57: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 100020:13
wdop_    link/ether 52:54:00:42:3a:34 brd ff:ff:ff:ff:ff:ff20:13
wdop_    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr020:13
wdop_       valid_lft forever preferred_lft forever20:13
shibbolethwdop_, also: i highly recommend apt-get install virt-manager20:13
TJ-yes!20:13
TJ-wdop_: so, that seems to have solved it. Make sure the 'default' libvirt network is set to autostart. "virsh net-autostart default"20:14
wdop_virsh net-autostart default20:15
wdop_Network default marked as autostarted20:15
wdop_ok20:15
wdop_start the guest?20:15
TJ-so, from now on we know the key is that the bridge must have the IP address set20:16
TJ-Yes20:16
wdop_ok, it is not everything 100% clear to me but I will go through it again.20:16
TJ-I'm not clear why libvirt didn't add the address to the bridge, but that was the cause20:17
shibbolethwdop_, install virt-manager on your client and you'll have a local gui to administer this on the server/host through ssh20:17
TJ-shibboleth: please don't interfere; you lack context20:17
wdop_@shibboleth I have it already installed.20:18
shibbolethor, read up on ifupdown, bridges, vlans, and... woldermort/netplan :P20:18
shibbolethTJ-, 10-420:18
TJ-shibboleth: we use virsh since it is precise in giving commands and seeing output via pastebins20:19
shibbolethsure20:19
shibboleth10-4: police code/rtx for received and understood20:19
wdop_@TJ so rebooting the host should not change anything ?20:19
TJ-wdop_: in theory, it should remain good (libvirt/default network)20:20
TJ-wdop_: good to know we fixed your issues faster than Facebook are fixing theirs :D20:21
wdop_OK, I will do the restart shortly. How can I thank you / tipp you. Are you paid fior this service you are giving.  20:21
wdop_?20:22
TJ-no, it's community support (and education)20:22
wdop_I want to give something back, but don't know how. This is the least I can do. I am so thankful!20:24
TJ-pay forward; give your expertise in whatever areas you're good at to others20:28
wdop_@TJ-, Yes, will do. These experiences strengthen altruism. 20:32
wdop_@TJ-, I will now reboot... and pray ;)20:33
TJ-wdop_: :D20:34
wdop_@TJ-, Bye. It was a pleasure having you as someone getting me out of this mess!20:35

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!