You are not logged in.

#1 2024-07-10 05:41:46

p4nzhOS
Member
Registered: 2024-07-10
Posts: 5

How to Bridge a Wireless Network in KVM for Virtual Machines?

Hello everyone,

I am new to Arch but have several years of experience with Linux. I have the following question: for many years, I was a VMware Workstation user, where I had the ability to use the autobridge network format. This allowed me to connect a virtual machine to the local network where my host was, regardless of whether it was on eth1, eth0, or wlan0 with an internet connection. In other words, if I left the virtual machine in bridge mode, it would take an IP from the local network without any problems.

Now, in KVM, I have created a bridge and added the two wired networks, which work without any issues. However, I cannot add the wireless network card so that my virtual machine can use it, as I used to do in VMware. Is this possible in KVM, or is it only a feature of VMware?

I work with my laptop and often need to go to clients or hotels that only have Wi-Fi, which means I cannot use or start these virtual machines, negatively impacting my work.

I would greatly appreciate any guidance on whether this is possible and how I could solve this problem.

Thank you in advance.


Best regards,
p4nzhOS
"I think the biggest impact of open source is that it has dramatically lowered the barriers to entry for software development and innovation." - Linus Torvalds, creator of Linux

Offline

#2 2024-07-10 05:47:00

cryptearth
Member
Registered: 2024-02-03
Posts: 820

Re: How to Bridge a Wireless Network in KVM for Virtual Machines?

How do you setup your WiFi?
systemd-networkd
NetworkManager
netplan
etc.
Depending on that there're seceral ways to get this done.
TLDR: it doesn't matter if your host connects via ethernet or wifi - tge process is gge same and only depends on how you manage your network

Offline

#3 2024-07-11 04:21:34

p4nzhOS
Member
Registered: 2024-07-10
Posts: 5

Re: How to Bridge a Wireless Network in KVM for Virtual Machines?

Dear cryptearth:

Thank you for your help, and I apologize for not providing all the necessary information from the start. You're right; it's a very important point that I forgot to mention.

Allow me to provide additional details about my configuration:
* Operating System: Arch Linux
* Desktop Environment: KDE6
* Hardware: Lenovo T14 Intel Gen1
* WiFi connection tool: The default one in KDE6

The problem I have, as I mentioned, is that I used to use VMware Workstation. A few months ago, I started getting into the KVM world at the server level with Proxmox (I work for small and medium-sized businesses). Due to recent events related to VMware and Broadcom, many clients are migrating to KVM.

In numerous interviews or sessions with clients, it's not well-regarded that I'm running VMware while "selling" KVM. The question arises of how it's possible that I'm selling one solution and using another. For this reason, I need to have some kind of "auto-bridging" option similar to VMware's, which detects the network card or interface that's connected and allows the virtual machine to "go out" through it and request an IP from the client's LAN or the facility where I'm located.

As I indicated, if I try to add the WiFi interface with brctl to the bridge I have, it gives me an error stating that the WiFi interface is not supported.

Could you help me with this problem? I'd prefer not to have to go back to VMware, as I don't like that option, considering that I'm migrating most of my clients to KVM at the Proxmox level. Moving away from KVM would be counterproductive for my work, as it would be inconsistent to work with one tool and deploy another.

The command I execute is:

❯ sudo brctl addif nm-bridge enp0s31f6
Can't add wlp0s20f3 to bridge nm-bridge: Operation not supported

My WiFi interface is:  wlp0s20f3

Thank you very much for your help and to those who can offer assistance. I truly appreciate it a lot.

Atte.
p4nzhOS

Last edited by p4nzhOS (2024-07-13 02:20:20)


Best regards,
p4nzhOS
"I think the biggest impact of open source is that it has dramatically lowered the barriers to entry for software development and innovation." - Linus Torvalds, creator of Linux

Offline

#4 2024-07-11 05:32:28

cryptearth
Member
Registered: 2024-02-03
Posts: 820

Re: How to Bridge a Wireless Network in KVM for Virtual Machines?

this sounds AI-generated - but as there's a valid question in it, nevermind
the important part is:

p4nzhOS wrote:

WiFi connection tool: The default one in KDE6

as this is arch there is no default - hence my question: which network manager do you use?

Offline

#5 2024-07-11 10:28:10

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,824

Re: How to Bridge a Wireless Network in KVM for Virtual Machines?

If unsure, post the output of

find /etc/systemd -type l -exec test -f {} \; -print | sort

Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#6 2024-07-12 04:43:53

p4nzhOS
Member
Registered: 2024-07-10
Posts: 5

Re: How to Bridge a Wireless Network in KVM for Virtual Machines?

Thank you very much for your help, this is what it prints when running the command:

find /etc/systemd -type l -exec test -f {} \; -print | sort
/etc/systemd/system/bluetooth.target.wants/bluetooth.service
/etc/systemd/system/dbus-org.bluez.service
/etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service
/etc/systemd/system/dbus-org.freedesktop.timesync1.service
/etc/systemd/system/display-manager.service
/etc/systemd/system/getty.target.wants/getty@tty1.service
/etc/systemd/system/multi-user.target.wants/cups.path
/etc/systemd/system/multi-user.target.wants/cups.service
/etc/systemd/system/multi-user.target.wants/fprintd.service
/etc/systemd/system/multi-user.target.wants/libvirtd.service
/etc/systemd/system/multi-user.target.wants/NetworkManager.service
/etc/systemd/system/multi-user.target.wants/remote-fs.target
/etc/systemd/system/multi-user.target.wants/tuned.service
/etc/systemd/system/multi-user.target.wants/vmware-networks.service
/etc/systemd/system/multi-user.target.wants/vmware.service
/etc/systemd/system/multi-user.target.wants/vmware-usbarbitrator.service
/etc/systemd/system/multi-user.target.wants/vmware-workstation-server.service
/etc/systemd/system/network-online.target.wants/NetworkManager-wait-online.service
/etc/systemd/system/printer.target.wants/cups.service
/etc/systemd/system/sockets.target.wants/cups.socket
/etc/systemd/system/sockets.target.wants/libvirtd-admin.socket
/etc/systemd/system/sockets.target.wants/libvirtd-ro.socket
/etc/systemd/system/sockets.target.wants/libvirtd.socket
/etc/systemd/system/sockets.target.wants/systemd-userdbd.socket
/etc/systemd/system/sockets.target.wants/virtlockd-admin.socket
/etc/systemd/system/sockets.target.wants/virtlockd.socket
/etc/systemd/system/sockets.target.wants/virtlogd-admin.socket
/etc/systemd/system/sockets.target.wants/virtlogd.socket
/etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service
/etc/systemd/system/timers.target.wants/fstrim.timer
/etc/systemd/user/default.target.wants/xdg-user-dirs-update.service
/etc/systemd/user/pipewire.service.wants/wireplumber.service
/etc/systemd/user/pipewire-session-manager.service
/etc/systemd/user/sockets.target.wants/p11-kit-server.socket
/etc/systemd/user/sockets.target.wants/pipewire-pulse.socket
/etc/systemd/user/sockets.target.wants/pipewire.socket

Last edited by p4nzhOS (2024-07-13 02:17:00)


Best regards,
p4nzhOS
"I think the biggest impact of open source is that it has dramatically lowered the barriers to entry for software development and innovation." - Linus Torvalds, creator of Linux

Offline

#7 2024-07-12 09:19:10

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,824

Re: How to Bridge a Wireless Network in KVM for Virtual Machines?

Please edit your last post to use code-tags .

You are running NetworkManager , but also vmware-networks.service and libvirtd .

Since the thread title mentions KVM I guess you want to use libvirt as frontend for qemu/kvm ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#8 2024-07-13 02:19:29

p4nzhOS
Member
Registered: 2024-07-10
Posts: 5

Re: How to Bridge a Wireless Network in KVM for Virtual Machines?

and that's the idea, to definitively eliminate VMWARE from my system. For now, I'm keeping both to be able to comply, but as I mentioned earlier, I only want to use KVM.


Best regards,
p4nzhOS
"I think the biggest impact of open source is that it has dramatically lowered the barriers to entry for software development and innovation." - Linus Torvalds, creator of Linux

Offline

#9 2024-07-13 10:58:23

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,824

Re: How to Bridge a Wireless Network in KVM for Virtual Machines?

It appears additional steps are needed to use a wireless interface with a bridge , https://wiki.archlinux.org/title/Networ … n_a_bridge .
The debian link looks a bit old (iptables / ebtables are deprecated) but may still give more insight .

For clarity : the VMs you want to connect to over the bridge are running on your laptop , not on a remote location ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#10 2024-07-14 06:27:40

p4nzhOS
Member
Registered: 2024-07-10
Posts: 5

Re: How to Bridge a Wireless Network in KVM for Virtual Machines?

Indeed, what I need is to be able to spin up my virtual machine with an IP from the same network that the router broadcasts, such as when I stay at a hotel. Similarly, when I visit a client's premises, I should be able to access network ports or Wi-Fi, but it must be from the client's network, their router.

As I mentioned earlier, I don't have issues with VMWARE because there's an option called autobridge that allows me to connect to the local network through any available interface—whether it's eth0, eth1, WiFi, etc.—whichever is available and connected.

Thank you very much. I'll review the information you sent me about Debian and see if I can adapt it. Thanks a lot.


Best regards,
p4nzhOS
"I think the biggest impact of open source is that it has dramatically lowered the barriers to entry for software development and innovation." - Linus Torvalds, creator of Linux

Offline

Board footer

Powered by FluxBB