To configure a static IP for a Windows 11 VirtualBox VM wired NIC, open the Network Adapter settings in VirtualBox, switch the mode from NAT to Bridged Adapter, and then assign a static address within your host’s subnet via the Windows Control Panel. This ensures direct connectivity without relying on NAT gateway assumptions.
Understanding Network Modes
Before changing any settings, it is crucial to understand why the default configuration fails for static IP assignments. By default, VirtualBox creates a virtual network using NAT (Network Address Translation). In this mode, the guest operating system receives an IP address from a private DHCP pool managed by VirtualBox, typically in the10.0.2.x range. The host machine acts as a router, but the guest does not have a unique identity on your physical local network. Attempting to set a static IP while in NAT mode often leads to conflicts or complete loss of connectivity because the guest cannot communicate directly with other devices on the LAN.
To resolve this, you must change the networking mode to Bridged Adapter. This mode connects the virtual network card directly to the host’s physical network interface. The virtual machine will then request an IP address from your actual router’s DHCP server, just like a physical computer plugged into the same switch. If your router supports static DHCP reservations, that is the preferred method. However, if you need to manually configure the static IP inside Windows 11, bridging is the necessary prerequisite.
Switching to Bridged Adapter
You can modify the network configuration through the VirtualBox graphical user interface. First, ensure the virtual machine is powered off or at least ready for configuration changes. Select your Windows 11 VM in the main VirtualBox Manager window and click the Settings icon. Navigate to the Network tab. Under the Adapter 1 section, change the Attached to dropdown menu from NAT to Bridged Adapter. In the Name field, select the specific network interface on your host computer that provides internet access. For example, if you are on Wi-Fi, select your wireless adapter; if you are on Ethernet, select the wired connection. Some users may see multiple options labeled "Intel(R) Ethernet Connection" or similar. Choose the one that corresponds to your active internet source. Once selected, apply the changes. You do not need to restart the VM immediately, but the network service inside Windows 11 will need to refresh its connection.Configuring Static IP in Windows 11
Once the VM is connected via Bridged Adapter, the next step is to assign a static IP address within the Windows 11 operating system. This process mirrors configuring a physical PC. Start the virtual machine and log in to Windows 11. Open the Settings application by pressingWin + I. Navigate to Network & internet, then select Ethernet. If the network is not detected as Ethernet, look under Wi-Fi settings instead, depending on how the host presents the connection.
Click on the properties of the active network connection. Scroll down to find IP assignment. Change the setting from Automatic (DHCP) to Manual. Toggle the IPv4 switch to On. You will now need to enter four key pieces of information:
- IP address: Choose an unused address in your local subnet. For example, if your router is
192.168.1.1, you might choose192.168.1.50. - Subnet mask: Typically
255.255.255.0for home networks. - Gateway: Enter your router’s IP address, such as
192.168.1.1. - Preferred DNS: Use your router’s IP or a public DNS like
8.8.8.8.
ipconfig. The output should show the static IP you assigned, along with a valid subnet mask and default gateway.
Troubleshooting Connectivity Issues
If the VM loses internet access after switching to Bridged Adapter, several factors could be responsible. First, check if your physical router has a firewall or MAC filtering enabled that blocks unknown devices. Some enterprise networks require authentication or register new MAC addresses before granting access. In such cases, you may need to whitelist the VM’s MAC address in your router settings. Another common issue arises when the host computer switches between Wi-Fi and Ethernet. If you configured the bridge to use Wi-Fi but then plug in an Ethernet cable, the VM may lose connectivity until you update the Bridged Adapter selection in VirtualBox settings to match the new active interface. Additionally, ensure that no third-party antivirus software on the host is blocking the virtual network driver. For advanced scenarios where bridging is restricted by your network administrator, consider using Port Forwarding as an alternative. This allows you to map specific host ports to guest ports without exposing the VM to the entire LAN. However, for most users seeking a static IP for console login or file sharing, Bridged Adapter remains the standard solution. Configure Two Virtual Machines: Host VirtualBox to Use Guest's VPN demonstrates another way to manage network isolation, which might be useful if you need secure tunneling instead of direct LAN access.Frequently Asked Questions
Why did my VM lose internet after setting a static IP?
This usually happens because the static IP falls outside your router’s DHCP pool or conflicts with another device. Ensure the IP address you chose is not reserved for another machine and that the subnet mask matches your network exactly. Restarting the network adapter in Windows often resolves temporary glitches.
Can I use a static IP with NAT mode?
No, NAT mode uses a private virtual network where the guest IP is dynamically assigned by VirtualBox. You cannot force a static IP on the guest side because the NAT engine manages the translation table. Switching to Bridged Adapter is required for true static addressing on your LAN.
How do I find my host’s subnet mask?
Open Command Prompt on your host machine and run ipconfig. Look for the IPv4 Subnet Mask under your active network adapter. It is typically 255.255.255.0 for most home and small office networks. Use this exact value in your Windows 11 VM configuration.
What if Bridged Adapter shows no network option?
This indicates that VirtualBox lacks permission to access the host’s network interfaces. Try running VirtualBox as an Administrator. On Linux hosts, you may also need to install the vboxnetflt module or add your user to the vboxusers group.
Does enabling a static IP affect WSL2?
WSL2 runs in its own isolated Hyper-V virtual network, separate from the primary VM’s network adapter. Configuring a static IP for your Windows 11 VM does not directly impact WSL2 connectivity, though both rely on the host’s underlying virtualization platform.