Cannot use WiFi on my QEMU VM?

Hi, I am using Fedora 34 and wanted to use a VM on it. It is QEMU KVM. My VM is also Fedora 34.

It all worked well but instead of the WiFi settings on the top right, it only shows wired connections which is unusual.

As I searched for WiFi settings, it said I need a WiFi adapter in order to use WiFi. Why is that? Because on my normal OS which I’m controlling the VM from it works perfectly.

I am not very familiar with the tech but I have read I have to use a NAT connection (?). Is that correct? If yes, is it secure? I want to use the VM for more privacy and security. The IP address should not be the same, I want another identity in the VM. However, a WiFi connection would be neat.

Guest network is typically provided with a virtual switch operating in NAT mode:
libvirt: Virtual Networking

So, you don’t really need to access physical wireless adapters from the guest.
Just set up the wireless connection on the host and guests should be able to use it.

3 Likes

Thank you, but I couldn’t even enable WiFi on the VM because it says I need a WiFi adapter. :frowning:

In normal default configuration, the wifi adaptor is controlled by the host - the guests got virtual network adaptors (LAN) in NAT mode. The guests will not aware there is wifi adaptor in your host.

My hosts have a LAN port and a wifi adaptor. I can use PCI passthrough to assigned my wifi adaptor to my guest (only one), then that guest will can there is a wifi adaptor. (Once assigned, the hosts will not see the wifi adaptor any more.)

2 Likes

Just to add on to what the others are saying.

On your host machine, the one running qemu, you make a connection to your wireless network.

Since the host machine is using wifi network adapter, the guest machine will be given a virtual lan adapter which is using the wifi adapter on the host.

That is the way it normally works.

However, if you have some special purpose application where you are wanting to have the VM have direct access to the wifi adapter, you can do that by setting it up for PCI passthrough. However, that will block the host from having access to wifi which is why most people wouldn’t configure it this way.

2 Likes

Makes sense, thanks. Can you tell me how I can manage that with the virtual LAN adapter in the VM?

Are you using virt-manager?

1 Like

Yes. I have found out the reason I think but this leads to another problem. Can you quickly check out my newest question?

https://discussion.fedoraproject.org/t/installing-networkmanager-is-failing/71398

Guest NIC settings in virt-manager:

  • Network source: Bridge device…
  • Device name: virbr0
  • Device model: virtio

Oh thank you, but I actually want to use NAT as it seems to be more fitting to my needs regarding privacy and security.

That’s it, virbr0 is the default virtual network/switch operating in NAT mode.

1 Like

But how am I using NAT when i switch from NAT to Bridge? I don’t really understand that. :confused:

The guest NIC is bridged to the virtual switch that operates in NAT mode.

1 Like

I did that, but it still shows “No network adapter found”.
(If it is the right approach to go to WiFi settings in the VM).

No, and it doesn’t seem like a good idea to pass the wireless adapter to the guest.
There’s neither privacy nor security benefit, so you’d better reconsider.

1 Like

I understand, thank you for your advice. I basically want to have WiFi on my VM with as much privacy and security as possible. Can you advise me anything?

2 Likes

again, your host connects to wifi, and provides a virtual, wired network connection to the guest(s). All traffic is routed through the host. That network connection can be configured. You don’t want your VM access the physical wifi adapter.

2 Likes

Thank you two guys. Would you also recommend the Red Hat guide Vladislav sent me as a solution to use WiFi on my VM with high security and privacy?

Don’t know, you haven’t told us why you want this setup and not use the default…

2 Likes