Problems creating kvm network bridg

Good morning!

While not new to Linux I am quite new to Garuda/Arch Linux. Definitely a different way of doing things coming from Debian/Redhat based systems. My issue is simply this: I'm having a hell of a time getting a network bridge created for use with qemu-kvm on this system. Installing and setting up was a piece of cake but the bridge setup is kickin my backside.

I've been following this guide: https://computingforgeeks.com/how-to-create-and-use-network-bridge-on-arch-linux-and-manjaro/

Its at Step 3 that really has me twisted up. Exactly where in blue blazes am I supposed to add a line set IP=no?

The guide references NetworkManager, but as best I can tell I'm not seeing it nor am I able to accomplish what it suggest I should be able to do. I'd rather open the actual config file and just add the blasted line, but have NO idea where that would be. And I have looked... for hours.

Thank you in advance...
Mark

garuda-inxi

System:
  Kernel: 5.18.12-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 12.1.0
    parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
    root=UUID=9447a2d2-dd23-4b94-807d-40ef71169242 rw rootflags=subvol=@
    quiet quiet splash rd.udev.log_priority=3 vt.global_cursor_default=0
    resume=UUID=75a614c4-8b61-4697-a12e-c4ba252e3de4 loglevel=3
  Desktop: KDE Plasma v: 5.25.3 tk: Qt v: 5.15.5 info: latte-dock
    wm: kwin_x11 vt: 1 dm: SDDM Distro: Garuda Linux base: Arch Linux
Machine:
  Type: Desktop System: LENOVO product: 30AK000LUS v: ThinkStation P300
    serial: <superuser required>
  Mobo: LENOVO model: SHARKBAY v: SDK0E50510 PRO
    serial: <superuser required> BIOS: LENOVO v: FBKTCCAUS date: 11/21/2016
CPU:
  Info: model: Intel Core i5-4590 bits: 64 type: MCP arch: Haswell
    gen: core 4 built: 2013-15 process: Intel 22nm family: 6
    model-id: 0x3C (60) stepping: 3 microcode: 0x28
  Topology: cpus: 1x cores: 4 smt: <unsupported> cache: L1: 256 KiB
    desc: d-4x32 KiB; i-4x32 KiB L2: 1024 KiB desc: 4x256 KiB L3: 6 MiB
    desc: 1x6 MiB
  Speed (MHz): avg: 3292 min/max: 800/3700 scaling: driver: intel_cpufreq
    governor: performance cores: 1: 3292 2: 3292 3: 3292 4: 3292
    bogomips: 26337
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: itlb_multihit status: KVM: VMX disabled
  Type: l1tf
    mitigation: PTE Inversion; VMX: conditional cache flushes, SMT disabled
  Type: mds mitigation: Clear CPU buffers; SMT disabled
  Type: meltdown mitigation: PTI
  Type: mmio_stale_data status: Not affected
  Type: spec_store_bypass
    mitigation: Speculative Store Bypass disabled via prctl
  Type: spectre_v1
    mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2 mitigation: Retpolines, IBPB: conditional, IBRS_FW,
    STIBP: disabled, RSB filling
  Type: srbds mitigation: Microcode
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics
    vendor: Lenovo driver: i915 v: kernel arch: Gen5.75 process: Intel 45nm
    built: 2010 ports: active: DP-1,DP-2 empty: HDMI-A-1,HDMI-A-2,VGA-1
    bus-ID: 00:02.0 chip-ID: 8086:0412 class-ID: 0300
  Device-2: Ruision UVC Camera type: USB driver: snd-usb-audio,uvcvideo
    bus-ID: 3-4:4 chip-ID: fefe:4321 class-ID: 0102 serial: <filter>
  Display: x11 server: X.Org v: 21.1.4 with: Xwayland v: 22.1.3
    compositor: kwin_x11 driver: X: loaded: modesetting
    alternate: fbdev,intel,vesa gpu: i915 display-ID: :0 screens: 1
  Screen-1: 0 s-res: 3840x1080 s-dpi: 96 s-size: 1016x285mm (40.00x11.22")
    s-diag: 1055mm (41.54")
  Monitor-1: DP-1 pos: primary,left model: Acer H233H serial: <filter>
    built: 2009 res: 1920x1080 hz: 60 dpi: 96 gamma: 1.2
    size: 510x287mm (20.08x11.3") diag: 585mm (23") ratio: 16:9 modes:
    max: 1920x1080 min: 720x400
  Monitor-2: DP-2 pos: right model: Acer H233H serial: <filter> built: 2009
    res: 1920x1080 hz: 60 dpi: 96 gamma: 1.2 size: 510x287mm (20.08x11.3")
    diag: 585mm (23") ratio: 16:9 modes: max: 1920x1080 min: 720x400
  OpenGL: renderer: Mesa Intel HD Graphics 4600 (HSW GT2)
    v: 4.6 Mesa 22.1.3 direct render: Yes
Audio:
  Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor HD Audio
    vendor: Lenovo driver: snd_hda_intel bus-ID: 3-4:4 v: kernel
    chip-ID: fefe:4321 bus-ID: 00:03.0 chip-ID: 8086:0c0c class-ID: 0102
    class-ID: 0403 serial: <filter>
  Device-2: Intel 8 Series/C220 Series High Definition Audio vendor: Lenovo
    driver: snd_hda_intel v: kernel bus-ID: 00:1b.0 chip-ID: 8086:8c20
    class-ID: 0403
  Device-3: Ruision UVC Camera type: USB driver: snd-usb-audio,uvcvideo
  Sound Server-1: ALSA v: k5.18.12-zen1-1-zen running: yes
  Sound Server-2: PulseAudio v: 16.1 running: no
  Sound Server-3: PipeWire v: 0.3.56 running: yes
Network:
  Device-1: Intel Ethernet I217-LM vendor: Lenovo driver: e1000e v: kernel
    port: f080 bus-ID: 00:19.0 chip-ID: 8086:153a class-ID: 0200
  IF: eno1 state: up speed: 100 Mbps duplex: full mac: <filter>
  IF-ID-1: virbr0 state: down mac: <filter>
Drives:
  Local Storage: total: 5.46 TiB used: 384.01 GiB (6.9%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/sda maj-min: 8:0 vendor: Seagate model: ST2000DM006-2DM164
    size: 1.82 TiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s
    type: HDD rpm: 7200 serial: <filter> rev: CC26 scheme: MBR
  ID-2: /dev/sdc maj-min: 8:32 type: USB vendor: Western Digital
    model: WD My Book 25EE size: 3.64 TiB block-size: physical: 4096 B
    logical: 512 B type: N/A serial: <filter> rev: 4003 scheme: GPT
Partition:
  ID-1: / raw-size: 1.8 TiB size: 1.8 TiB (100.00%) used: 384.01 GiB (20.8%)
    fs: btrfs dev: /dev/sda1 maj-min: 8:1
  ID-2: /home raw-size: 1.8 TiB size: 1.8 TiB (100.00%)
    used: 384.01 GiB (20.8%) fs: btrfs dev: /dev/sda1 maj-min: 8:1
  ID-3: /var/log raw-size: 1.8 TiB size: 1.8 TiB (100.00%)
    used: 384.01 GiB (20.8%) fs: btrfs dev: /dev/sda1 maj-min: 8:1
  ID-4: /var/tmp raw-size: 1.8 TiB size: 1.8 TiB (100.00%)
    used: 384.01 GiB (20.8%) fs: btrfs dev: /dev/sda1 maj-min: 8:1
Swap:
  Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
  ID-1: swap-1 type: zram size: 15.52 GiB used: 768 KiB (0.0%)
    priority: 100 dev: /dev/zram0
  ID-2: swap-2 type: partition size: 17.07 GiB used: 0 KiB (0.0%)
    priority: -2 dev: /dev/sda2 maj-min: 8:2
Sensors:
  System Temperatures: cpu: 48.0 C mobo: N/A
  Fan Speeds (RPM): N/A
Info:
  Processes: 273 Uptime: 1h 45m wakeups: 0 Memory: 15.52 GiB
  used: 6.67 GiB (43.0%) Init: systemd v: 251 default: graphical
  tool: systemctl Compilers: gcc: 12.1.0 Packages: pacman: 1382 lib: 331
  Shell: fish v: 3.4.1 default: Bash v: 5.1.16 running-in: konsole
  inxi: 3.3.19
e[1;34mGaruda (2.6.5-1):e[0m
e[1;34m  System install date:e[0m     2022-07-19
e[1;34m  Last full system update:e[0m 2022-07-20 e[1;31m↻
e[1;34m  Is partially upgraded:  e[0m No
e[1;34m  Relevant software:      e[0m NetworkManager
e[1;34m  Windows dual boot:      e[0m <superuser required>
e[1;34m  Snapshots:              e[0m Snapper (maybe)
e[1;34m  Failed units:           e[0m bluetooth-autoconnect.service

Hi there, just wanted to welcome you to the forum...!
I'm everything but an expert on virtualization, so my only suggestion is, as usual, rather than leveraging on internet articles, to check the Arch wiki. Maybe try to give a look at the following. If nothing helps/applies, just disregard and keep the welcome :wink:
https://wiki.archlinux.org/title/QEMU#Networking
https://wiki.archlinux.org/title/Libvirt#Networks
https://wiki.archlinux.org/title/Network_bridge

3 Likes

thank you for the links... I've seen one or two of them in my struggle, er I mean path to enlightenment, but they're a bit confusing so far seeming to lack a bit of context. But I will have a look at the last one dealing with networking. The guide that I posted is pretty comprehensive except for step 3 which left almost everything to the imagination. Hate when the assumption is made the a concept, which is obvious to the writer is then therefore obvious to the reader.

Welcome to the forum

If you right click on your network connection then chose configure network connections
When open add new connection
Screenshot_42

Choose bridge
Screenshot_43

create it and call it something and add a connection and save

All your settings are in there just in a gui

3 Likes

It can't be that easy... that would explain why i've been struggling with it for a few days. I think I made a bridge although it's been calculating for about 10 minutes now trying to bring it up.
image

although it shows in the console when I issue the command ip a as br0

nmcli connection up qemu_bridge
Connection successfully activated (master waiting for slaves) (D-Bus active path: /org/freedesktop/NetworkMana
ger/ActiveConnection/4)

Not only that, but also there are more than one way to do it.
You have chosen to follow a random web tutorial, which uses netctl as a Network Manager (NM).
There are other NMs, like NetworkManager (broadly used) and systemd-networkd (from systemd suite).

Each NM has its own directories to save configuration, which looks different from the others’.

Being in Arch, the default/expected move is to look in Archwiki for any task you want. It has everything, or else… there is a problem… :laughing:

Using netctl for your system network connections, you would have created a profile file for each of them, saved at

Step 2: Create Bridge:
Create bridge file inside /etc/netctl/ directory.

Then,

Step 3: Remove the ip of interface added to the bridge; eno1
You can do this either by editing network profile and adding the line:

set IP=no

edit the profile file for eno1, which you would have already, if you were using netctl for NM, in /etc/netctl/.
Since I have never used netctl for anything, I am not sure if there is an Author’s mistake, or Web design mistake, as set IP=no looks different from IP=no from the example profile in the tutorial.

Just what was my next remark: when using a random web tutorial, ask questions to them first, so they may modify it to improve it.
I think it is almost a clone of this Archwiki :crown: article.

Good luck! :wink:

4 Likes

The Solution: For posterity's sake and others new to Qemu-kvm needing to create a bridge network as well as saving the next guys sanity here's the solution that really is easy. Had the WIKI and other docs been written with the reader looking for knowledge rather than being written to others who already know how this is done, I may not have even asked the question. Course, it's always easy to tell someone to RTFM or "you're not reading the pre-approved information for this distro", rather than simply passing on the information or saying, "I simply don't know.

News flash folks! The Arch wiki was written for an audience that already understands the basic process and NOT for those who really don't know, so suggesting they're getting bad information or to RTFM you shame yourself. But I digress.

This solution will likely work on many, if not most systems which are systemd based.
ASSUMPTION: You have already installed the Qemu-kvm and libvirt packages for your linux distro including bridge-utils. It's also assumed your system is using NetworkManager. There are other methods to create a bridge but this solution is based on using NetworkManager. Not certain your system is running NetworkManager?

Issue this command...

nmcli connection show

If you get a return in the console that is not an error but shows your network device, i.e on my system the return is thus:
[root@mark-garuda mweaver]# nmcli connection show
NAME UUID TYPE DEVICE
br0 e630337f-3fb0-4796-abce-733eb1cf826d bridge br0
enp1s0 5c48367d-423c-4d6f-a7c7-dfd745cc9035 ethernet enp1s0

Then NetworkManager is installed and operating. You will of course need to change some of the values to suite your network and device names. Before getting started check the status of the libvirtd.service.

systemctl status libvirtd

if you get a return that appears like this:
[root@mark-garuda mweaver]# systemctl status libvirtd
â—‹ libvirtd.service - Virtualization daemon
Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; disabled; preset: disabled)
Active: inactive (dead)
TriggeredBy: â—‹ libvirtd-admin.socket
â—‹ libvirtd-ro.socket
â—‹ libvirtd.socket
Docs: man:libvirtd(8)

Then you'll need to enable the service.
systemctl enable libvirtd

Then start the service
systemctl start libvirtd

The steps for creating a network bridge on a system using QEMU-KVM are these:

  1. nmcli connection show
  2. sudo nmcli connection add type bridge autoconnect yes con-name br0 ifname br0
  3. sudo nmcli connection modify br0 ipv4.addresses 10.10.3.49/24 gw4 10.10.3.1 ipv4.method manual
  4. sudo nmcli connection modify br0 ipv4.dns 10.10.3.6
  5. sudo nmcli connection del "Wired Connection 1"
  6. sudo nmcli connection add type bridge-slave autoconnect yes con-name enp1s0 ifname enp1s0 master br0
  7. sudo nmcli connection up br0
  8. nmcli connection show br0
  9. ip add show br0

That's it... you should now have a working network bridge. If you mouse over the network manager icon in your tool tray it may complain and indicate you have no network connection, but if you check your browser or run a ping command you should get a positive return.

By the way... in my original post I made reference to a site that I had been reading to gain an understanding of the process. It just happened to be NOT one that appears on the Arch Wiki.... I stopped drinking kool aid a long time ago. Just thought I'd mention it.

I don’t agree with this assessment of the Arch Wiki. It is true the documentation covers some very advanced topics, but very basic material is covered as well. In general, things are linked and cross-referenced well enough that if you get to a sticking point (i.e. something you have not learned about yet), documentation that can bring you up to speed is very accessible.

This can make for a prolonged rabbit-holing session, but I do not think this makes the material useful only to those who are already knowledgeable. Rather, the material is appropriate for anyone who is willing to spend the time reading and learning the material until they understand it.

In this way, the Arch Wiki is extremely appropriate for the Linux distribution it directly serves: Arch Linux. Arch is made to be built up manually from a very modest base, and understanding the underpinnings of your system is part of doing that successfully.

The Arch Wiki is not a great place to look if you just want a command you can blindly paste into the terminal without having to bother learning what you are doing, because the typical Arch Linux user is not well served by that kind of solution. However, I do not believe this makes Arch Linux inaccessible to new users or even inappropriate for them; it is a suitable distribution for anyone who is willing to take the time to read and learn the material.

No one was pointing you to the documentation as a way of being dismissive or belittling. This is the way a lot of us find solutions when we are dealing with something we don’t know off the top of our heads. I think if you are picking up on an accusatory tone in the advice above, you might be misreading the thread. Linking to the Arch Wiki is not meant as “go figure it out”; rather, it is meant as “here, this might be helpful”.

In any case, I am glad you solved your issue. I also really appreciate how you doubled-back and detailed your solution, so folks searching in the future can benefit from your efforts. I have marked your post as the solution to the thread. Welcome to the community. :slightly_smiling_face:

4 Likes

I guess your justified frustration with this difficult to accomplish technical task, has blinded you for a moment :joy:
In the HUGE technology world, whether computers or any other kind,

nobody can know everything!

In my personal experience, the one that knows where and how to find the solution is the king :crown: . Not the one that knows one or a few or many solutions, because, as I said, nobody can know everything.
Today, one must know how to read books/wikis/documentation well, not to have read all those.
Also, in your rush of finding someone to blame, you blamed those that tried to help you solve your problem. How smart fair is this in your opinion?

And, last but not least, you yourself have fallen into the same mistake you have blamed others. There is no adequate explanation of what those commands do, letting me (that I have no idea of this) wonder, if I should trust a random stranger and blindly run them, in case I want to create a bridge, or should I search (a wiki or a man page?) about what those commands (ran with root privileges) would do to my system.

I hope you won’t disagree… I don’t like this kind of empty discussions… :stuck_out_tongue_winking_eye:

4 Likes

This acronym is rarely seen on the Garuda forum as this seems rather rude and we try not to be rude to anyone here. We do however expect users to research as much as possible before asking others to solve their problem.

Welcome to Garuda @mweaver , and thanks for posting in detail the solution you discovered.

3 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.