How to enable WiFi in a VirtualBox virtual machine

Virtualization has become an integral part of the work of IT professionals and enthusiasts, allowing them to run isolated operating systems on a single physical computer. However, one of the most common problems users encounter when first launching a guest OS is a lack of internet access. This is especially true for wireless networks, since VirtualBox by default does not always correctly emulate the operation of a physical Wi-Fi adapter.

The difficulty lies in the fact that the virtual machine doesn't technically see the wireless interface directly, as the host system does. Instead, it relies on the host's network adapters to broadcast the signal through them. Understanding how it works network bridges Network Address Translation (NAT) is key to a successful setup. In this article, we'll discuss how to ensure a stable connection and why default settings may not work.

First, you need to make sure that Wi-Fi is already active and functioning properly on your physical computer. If the host machine isn't connected to the global network, the virtual guest won't be able to access the internet. Next, you should check whether the necessary extensions, known as Extension Pack, which add support for additional network devices.

Choosing the Right Type of Network Adapter

The first step in the configuration process is to select the appropriate connection type in the virtual machine settings. By default, VirtualBox often offers the following mode: NAT, which allows the guest OS to access the internet via the host's IP address. This is the simplest option if you only need to access web pages within the virtual machine, but it hides the machine from the outside network.

However, if your goal is full integration into a local network or port forwarding, NAT mode may not be sufficient. In this case, you need to switch to Network bridge (Bridged Adapter). In this mode, the virtual machine becomes an equal participant in the network, receiving its own IP address from your router, as if it were a separate physical device.

⚠️ Attention: When using the Network Bridge mode on some corporate networks with a hard MAC address binding, your virtual device may be blocked by the network administrator.

To switch the mode, close the virtual machine (don't just turn it off, but actually shut down the guest OS), then in the main VirtualBox window, click Tune. Go to the section Net and select the desired option from the "Connection Type" drop-down list. If you're using Wi-Fi, make sure your wireless adapter is selected in the "Name" field, not Ethernet.

Setting up a Wi-Fi network bridge

Mode Bridged Adapter This is the most efficient way to provide a virtual machine with direct access to a Wi-Fi signal. In this mode, the virtual network driver intercepts packets and forwards them through the physical wireless adapter, preserving the original MAC addresses or generating new ones, depending on the settings. This resolves most compatibility issues that arise when attempting to forward Wi-Fi directly.

It's important to note that when using a bridge, the virtual machine will request an IP address from your router independently of the host. This means that if you have a limit on the number of devices that can connect in your router's DHCP table, the virtual machine may take up one of the available slots. Check your router settings if the connection doesn't establish automatically after changing the adapter type.

In some cases, especially on Windows 10 and 11, manual activation of the protocol may be required. Bridged Networking Driver in the properties of the physical adapter. To do this, open "Network Connections" in the host control panel, find your Wi-Fi adapter, right-click it, and select "Properties." Make sure the checkbox next to "Properties" is checked. VirtualBox Bridged Networking Driver installed.

☑️ Checking bridge settings

Completed: 0 / 4

Using NAT and port forwarding

If the bridge mode is not required or causes network conflicts, the optimal solution remains to use NATIn this configuration, VirtualBox acts as a router for the guest system, hiding it behind its own IP address. This provides basic internet access, sufficient for installing updates, using browsers, and downloading files.

The main advantage of NAT is isolation: the virtual machine is not visible to other devices on the network, which improves security. However, if you need the host or other computers to access services within the virtual machine (for example, a web server on port 80), you will need to configure port forwardingWithout this setting, external connections to the guest OS are blocked.

To set up port forwarding, go to Settings → Network → Advanced → Port ForwardingHere you need to add a new rule: specify the name (e.g., Web), protocol (TCP), host port (e.g., 8080), and guest port (80). Now, when accessing port 8080 on the host machine, traffic will be redirected to port 80 inside the virtual machine.

Parameter Description Example of meaning
Name Arbitrary rule name SSH_Access
Protocol Network protocol type TCP / UDP
Host IP Host machine address (leave blank) 127.0.0.1
Host port Port on a physical PC 2222
Guest port Port inside the virtual machine 22
Why is NAT configured faster?

NAT mode does not require interaction with the physical adapter drivers, so it works out of the box in 99% of cases if visibility of the machine on the local network is not required.

Installing Guest Additions

A critical step for stable network operation, especially in graphical interfaces, is installing the package Guest AdditionsThis set of drivers and utilities optimizes the guest operating system, ensuring proper operation of the video adapter, shared folders, and, importantly for our topic, network interfaces.

Without the add-ons installed, the virtual machine may use emulated network cards with low performance or limited functionality. After installing the package, the system will be able to use paravirtualized drivers. virtio-net, which significantly reduce the processor overhead when processing network packets.

To install, start the virtual machine, in the top menu of the VirtualBox window, select Devices → Mount Guest Additions Disk ImageThe installation disk will open inside the guest system (in Windows this is usually autorun, in Linux you will need to mount the disk and run the script) VBoxLinuxAdditions.run). After installation, be sure to reboot the guest OS.

📊 What guest OS do you use most often?
Windows 10/11
Ubuntu/Linux Mint
macOS
Android x86
Other

Diagnosing driver problems

Even with proper configuration, situations may arise where the network does not work. Often, the cause lies in the incompatibility of the network controller type selected in the VirtualBox settings. By default, Intel PRO/1000 MT Desktop, which is a good choice for most modern operating systems. However, older systems or specific Linux distributions may require other options.

Try changing the card type in the virtual machine settings (Network → Advanced → Adapter Type). For Windows XP and older versions, it is better suited PCnet-FAST III, and for maximum compatibility with Linux, it is often recommended Paravirtualized Network (virtio-net)Changing this setting requires reinstalling the drivers inside the guest system.

It's also worth checking whether the host system's firewall or antivirus software is blocking the virtual machine's network activity. Sometimes adding a process VirtualBox.exe Adding firewall exceptions solves the problem of sudden internet connection loss after a Windows security update.

⚠️ Attention: Changing the network adapter type (for example, from Intel to PCnet) within a running system may result in a second network connection or a complete loss of connection until the drivers are reinstalled.

Setting up a static IP in a guest system

In some use cases, such as deploying test servers or databases, dynamic address acquisition (DHCP) may be inconvenient, as the virtual machine's IP address may change after a reboot. In such cases, it is advisable to specify static IP address directly in the guest operating system settings.

When using Bridged mode, the address must be in the same subnet as your router, but outside the DHCP range to avoid conflicts. For example, if your router assigns addresses from 192.168.1.100 to 192.168.1.200, you can assign 192.168.1.50 to your virtual machine. In NAT mode, a static IP is also possible, but the gateway will be the address of the VirtualBox virtual router (usually 10.0.2.2).

To set up in Windows, go to Control Panel → Network and Internet → Network and Sharing Center, select the adapter and click "Properties". Find the protocol Internet Protocol version 4 (TCP/IPv4), select "Use the following IP address" and enter the details. In Linux (Ubuntu), this can be done through Netplan or the settings interface by specifying the address, mask, and gateway.

Frequently Asked Questions (FAQ)

Why does the virtual machine see the cable but not connect to Wi-Fi?

The virtual machine doesn't have direct access to the Wi-Fi radio module. It sees a virtual cable routed through the host's physical adapter. Make sure "Bridged" mode is selected in the network settings and that the network name is your wireless adapter, not Ethernet.

Is it possible to share Wi-Fi from a virtual machine to other devices?

This is theoretically possible, but extremely difficult to implement. VirtualBox can't directly control the Wi-Fi adapter to create an access point. Host-Only mode is typically used for Wi-Fi distribution, coupled with connection forwarding on the host, but it's more reliable to create an access point directly on the host machine.

How do I reset network settings in VirtualBox if everything stops working?

In the VirtualBox main menu, go to File → Settings → NetworkYou can clear saved DHCP server settings there. It's also helpful to run the network reset command from the host command line: VBoxManage modifyvm "VM_Name" --macaddress1 auto, which will generate a new MAC address.

Why is there internet only in NAT mode, but not in Bridge mode?

This often indicates a problem with the bridge driver on the host machine or a blocking issue with the router. Check if the "VirtualBox Bridged Networking Driver" component is installed in your Wi-Fi adapter's properties in Windows. Also, try temporarily disabling your antivirus.