Virtualbox Bridged Networking Mode Allows VM to Connect to Your Router

The default networking mode in Virtualbox is NAT. It allows the guest machine to browse the Internet via a virtual router and that’s great for most people. But if you are looking to have more interaction between host machine and guest machine, like SSH into guest machine, visiting website developed in guest machine, allow other devices in your network to see the guest machine and enable guest machine to browse the Internet, the you can choose the bridged networking mode for your guest.

Change Networking Mode to Bridged

When the guest machine is shut off, open the settings dialog. Click the Network tab on the left pane.

virtualbox bridged networking mode

By default only adapter 1 is enabled for guest machine and the default networking mode for adapter 1 is NAT. To change networking mode to bridged, click NAT and select Bridged Adapter from the list. Click OK button to save your settings. That’s very simple.

IP Address of Guest Machine in Bridged Networking Mode

Now start your guest machine. In my case, my host is Ubuntu and guest is openSUSE. Once it’s started, open a terminal and type ifconfig command to find the IP address of guest machine. You can see that the IP address of my openSUSE guest is 192.168.1.102.

use ifconfig command to find ip address

Next, open a terminal on the host machine and type ifconfig command to find the IP address of host machine. You can see my Ubuntu host machine has the IP address of 192.168.1.101.

ifconfig

So the IP addresses of host machine and guest machine are in the same network range (192.168.1.0/24). I can ping the guest from ubuntu host.

ping virtualbox guest in bridged mode

And I can ping the host from openSUSE guest.

ping the host from virtualbox guest

In bridged networking mode, the default gateway of Virtualbox guest is your home router (If you have a home network). That means your home router allocates IP address to Virtualbox guest. Enter the following command in Virtualbox guest to find out the default gateway.

ip route show

default gateway of virtualbox guest

The IP address after default via is the IP address of default gateway.

Visit Host Local Web Site from the Guest

I have installed Nginx Web server on my Ubuntu host, I can visit Nginx Web server from my openSUSE guest. Just type the IP address of host machine in the browser address bar.

visit nginx web server from the gust

You can also install a Web server in the guest machine and visit it from host machine.

Other Devices on Your Network Can See the Guest Machine

My android phone is connected to my home network, and I can visit Web site of guest machine from my android phone. Type the IP address of guest machine in the android browser.

 

Other Devices on Your Network Can See the Guest Machine

You can browse the Internet in the guest machine, SSH into the host, and vice versa.

To wrap up, bridged networking mode exposes the guest machine to your local network. The virtual machine is like another physical machine on the network. In NAT mode the guest machine is protected under a virtual router and devices on your network can’t see it. In order to access guest machines, you have to setup port forwarding. In both networking modes, the guest machine can go out to the Internet.

Next Step

You might also want to read:

Rate this tutorial
[Total: 18 Average: 3.7]

5 Responses to “Virtualbox Bridged Networking Mode Allows VM to Connect to Your Router

  • meandeen
    6 years ago

    Thank you very much for the easy to follow explanation! I was getting frustrated trying to use both the NAT adapter and the Host-Only adapter on the VM machine. This is so much simplier – I was reluctant to try the bridged adapter, but it was no problem to use after reading your informative tutorial. Again, thank you!

  • Thanks for this!

  • Hi all, my case is as following:

    Host = Linux Mint 19 64bit with virtualbox 6, Guest= windows xp 32bit.
    my purpose is to make guest windows communicate with external PLC with static ip 192.168.0.1.
    I tried usning bridged network on virtualbox and left host network with dhcp on, the guest windows must have a static ip 192.168.0.2 and allready assignet this adresse. The PLC wont communicate with the client windows application unless it has the mentioned ip adress and this mac adress: 0007B8DC6FE9.
    I have been struggling with this issue for long time and tried almost all combinations with no luck ,whenever I ping the plc from guest wind just recieve error contacting mentioned IP adress. By the way I tried windows 7 64bit as host and it worked without any problem windows xp conneted to external PLC and application. I realized that virtualbox on windows 7 as host creates Virtual network card and assign an ip adress to it and whenever I ping the plc from guest it returns: packages sent with no loss. But I prefer Linux mint as host besides it is much quicker with less crashes in case of power interreption. I would appreciate any help and would be very greatfull for any tutorial or explanation.

  • Abdul Mateen
    4 years ago

    Hi,

    host: Virtual box on Windows 10
    guest: SUSE 11.3
    I was able to ping host from guest and visa versa, but not able to browse internet. Any suggestion ?

Leave a Comment

  • Comments with links are moderated by admin before published.
  • Your email address will not be published.
  • Use <pre> ... </pre> HTML tag to quote the output from your terminal/console.
  • Please use the community (https://community.linuxbabe.com) for questions unrelated to this article.
  • I don't have time to answer every question. Making a donation would incentivize me to spend more time answering questions.

The maximum upload file size: 2 MB. You can upload: image. Links to YouTube, Facebook, Twitter and other services inserted in the comment text will be automatically embedded. Drop file here