tocOn this page 6 sections
If you run VirtualBox inside a Windows VPS to build test labs, check installers or keep an old app in its own sandbox, you have to choose a network mode for every guest. On a home PC, NAT and bridged mostly differ in convenience. On a rented server they behave very differently, and the wrong choice can leave a guest with no connection at all. This guide explains what each mode does, why bridged usually fails in a hosted environment, and how to set up guests with PowerShell over RDP.
How the two modes work
NAT: the guest hides behind the host
With the NAT adapter, VirtualBox puts a small virtual router between the guest and the host's network stack. The guest gets a private address from VirtualBox's built-in DHCP service (by default in the 10.0.2.0/24 range, with the host side acting as the gateway). Outgoing traffic leaves through the host's own IP address, so to the outside world it looks like it came from the VPS.
- Outbound works right away. Windows Update, package managers and web browsing in the guest work without any changes.
- Inbound is closed by default. Nothing outside, including the host, can open a connection to the guest unless you add a port-forwarding rule.
- Guests are isolated from each other. Each NAT adapter gets its own private network, so two NAT guests can't see each other. If you need that, use a NAT Network, which is a shared NAT segment several VMs can join.
Bridged: the guest joins the physical network
A bridged adapter connects the guest's virtual NIC to one of the host's real network adapters. The guest shows up on that network as a separate machine with its own MAC address and asks the upstream network for an IP address, just like a second physical box plugged into the same switch.
- The guest is a full peer on the network, reachable directly without port forwarding.
- It depends on the upstream network accepting a new MAC address and giving it an address.
Why bridged usually fails on a VPS
That last point matters most here. Your VPS's network adapter is already virtual, and the hosting platform above it usually expects exactly one known MAC address per VPS. It often drops frames from any other MAC as a protection against spoofing. Hosting networks also rarely run a DHCP server that hands out addresses to unknown machines. In practice, a bridged guest inside a VPS usually ends up with no address, or with a self-assigned 169.254.x.x address, and no traffic gets through.
Two things make it worse:
- Don't give a bridged guest the host's public IP. Two machines claiming the same address on the same segment can knock the VPS itself offline, and with it your RDP session.
- Extra IPs aren't automatic. Some platforms can route an additional IP to a VPS, sometimes tied to a registered MAC address. Check with support before you plan around bridged networking, and don't assume it will work.
For most nested labs on a VPS, NAT or NAT Network plus port forwarding is the right default. Use bridged only when your provider has confirmed the setup.
Setting up NAT and port forwarding from PowerShell
You can do all of this in the VirtualBox GUI, but scripting it with VBoxManage is quicker and easy to repeat. Open PowerShell in your RDP session:
$vbox = "$env:ProgramFiles\Oracle\VirtualBox\VBoxManage.exe"
# List VMs and check the current NIC configuration
& $vbox list vms
& $vbox showvminfo "Lab-Win" | Select-String "NIC"
Change the first adapter to NAT (the VM must be powered off for modifyvm):
& $vbox modifyvm "Lab-Win" --nic1 nat
Forward a host port to the guest's RDP port. The rule format is name,protocol,host IP,host port,guest IP,guest port. Binding to 127.0.0.1 keeps it reachable only from the VPS itself:
& $vbox modifyvm "Lab-Win" --natpf1 "guest-rdp,tcp,127.0.0.1,33389,,3389"
Then, from inside your RDP session on the VPS, connect to the nested guest:
mstsc /v:127.0.0.1:33389
To add or remove rules while the VM is running, use controlvm:
& $vbox controlvm "Lab-Win" natpf1 "web,tcp,127.0.0.1,8080,,80"
& $vbox controlvm "Lab-Win" natpf1 delete "web"
Letting guests talk to each other
For a small domain lab with a domain controller and a member server, create a NAT Network and attach both VMs to it:
& $vbox natnetwork add --netname labnet --network "10.10.0.0/24" --enable --dhcp on
& $vbox modifyvm "Lab-DC" --nic1 natnetwork --nat-network1 labnet
& $vbox modifyvm "Lab-Srv" --nic1 natnetwork --nat-network1 labnet
For a domain, give the DC a static address inside that range and point the member server's DNS at it.
If you do have a routed IP for bridged mode
If your provider has confirmed that an extra address can reach a guest, find the exact host adapter name and bridge to it:
& $vbox list bridgedifs | Select-String "^Name:"
& $vbox modifyvm "Lab-Web" --nic1 bridged --bridgeadapter1 "Ethernet"
If the provider registered a specific MAC address, set the guest NIC to match it with --macaddress1, then set the IP, mask and gateway exactly as support gave them. A guest with a public address is exposed to the internet, so firewall and patch it like any other server before you start it.
Quick decision guide
- Guest only needs internet access: NAT.
- You need to reach one or two guest services: NAT with port forwarding bound to localhost.
- Several guests must talk to each other: NAT Network.
- Only the host should talk to the guest: a host-only adapter, optionally alongside NAT.
- The guest needs its own public address: bridged, but only after your provider confirms it.
Security notes
Keep forwarded ports bound to 127.0.0.1 unless you really need outside access. If you bind to all addresses, open the matching port in Windows Defender Firewall on purpose and limit it to known source IPs. Don't put a nested guest's RDP port on the internet without account lockout and strong passwords. Also remember that a snapshot of a nested VM is not a backup of the VPS. Keep real copies off-server, for example with Rclone to cloud storage.
Nested labs fit naturally on a Windows VPS for development and testing. If you later move a lab machine onto a proper hypervisor, our guide to moving a live Windows Server into Proxmox covers how.
Run this on your own Windows VPS
Get a Windows VPS from WindowsVPS in about 60 seconds, with full Administrator access over RDP, NVMe storage and the Windows license included.
Written by the WindowsVPS Team
We run Windows Server VPS hosting and write these guides from the same setups our customers use: RDP, PowerShell, trading terminals and always-on bots. Questions about a guide? Contact us.