We explain what steps you must follow to connect a virtual machine created with VirtualBox to the Internet.
Virtual machines are very useful. In fact, there are at least five reasons to use them on your team . For example, it allows you to test old or incompatible software , avoid breaking your system by experimenting, or clone an OS on another computer. Review the guide on how to create a virtual machine in VirtualBox if you start in this world. Now, if your question is how to connect a virtual machine to the Internet , then stay here.
In this article we explain all the possibilities that exist when connecting a virtual machine to the Internet . We quote the indications that must be followed if what you want is to visit websites and download with the virtualized equipment . As a reference we will use VirtualBox, a well-known software that can be downloaded for free. However, most of the indications are valid for other similar platforms, such as Vmware or Hyper-V .
Index of contents
- Connect a virtual machine to the Internet without doing anything
- Problems connecting a virtual machine to the Internet
- Check the operating system settings
- Install the VirtualBox Guest Additions
- Make sure the network is on
- Modify advanced settings
Connect a virtual machine to the Internet without doing anything
Before we begin, it is good that we make a clarification. In no case are we talking about establishing a connection between two virtual machines . Rather, the goal of this post is to show you how to fix issues that prevent you from accessing web pages or downloading files in a virtualization.
Bearing this in mind, we must tell you that, in the vast majority of cases, the default configuration of VirtualBox will allow you to connect the virtualized computer to the Internet. After several tests and installing Windows and Linux systems , we have seen that, without making any changes to the virtual machine’s parameters, it already had Internet access.
Of course, this statement does not mean that sometimes virtual machines do not have the ability to access the Internet . In that case, what can you do? Next, we analyze certain configurations that can help you restore access to the outside from your virtual machine.
Problems connecting a virtual machine to the Internet
In the event that, once you have finished installing the operating system, you do not have Internet access , there are some solutions that you should try to try to re-establish the connection.
Check the operating system settings
Any Windows or Linux you install inside VirtualBox behaves identically to how it would on a PC. This means that a misconfiguration on the hosted system could limit or prevent the connection to the Internet.
Verify that the network adapter is not disabled or that external connections have not been turned off. It is also good that you take a look at the assignment of the IP address and the DNS . It is recommended that you tell the virtualized system that it should obtain them automatically.
Install the VirtualBox Guest Additions
The VirtualBox Guest Additions package includes a number of drivers to make the operating system work better inside the virtual machine. As we have mentioned before, the usual thing is that the Internet access works from the first moment. So, you generally won’t need to install Guest Additions .
However, if you’re having trouble connecting, it doesn’t hurt to do so. In this way you make sure that the OS is perfectly understood with the installed hardware. As can be seen in the image above, just click on Devices and then on Insert Guest Additions CD image . So, go to explorer and run the software located inside the virtual CD drive.
Make sure the network is on
As if it were a real computer, VirtualBox supports the connection and disconnection of hardware components in the virtual machine. If you can’t connect to the network, maybe for some reason the network adapter is disabled. If this happens, it is as if there was no network card connected to the equipment. Consequently, the operating system will not be able to access the Internet.
We recommend that you first shut down the virtual machine and then visit the Network section of the settings. In the Adapter 1 section , check that the Enable Network Adapter box is checked. We are using a beta version of VirtualBox, so probably in your case this message will be displayed in Spanish. When you’re done activating the network adapter, save your changes and start your virtual machine. Now there is a good chance that you have an Internet connection.
Modify advanced settings
It is strange that you have come this far. With the solutions proposed up to now, the usual thing is that the problems to connect a virtual machine to the Internet have vanished. However, if that hasn’t happened, try applying changes to the advanced network settings.
You should know that there are different connection modes in VirtualBox. These are the most important:
- NAT. In this mode, the guest provides the IP address to the virtual machine. It is recommended to select this option if what you want is to have access to the Internet in the virtualized operating system.
- Internal network. Generates a private network to communicate virtual machines between them. But beware! If you select this option you will not have an Internet connection in the virtual machine.
- NAT network. It is an intermediate system between the NAT and the internal network. It allows virtual machines to be connected to each other, at the same time that all of them have an Internet connection.
- Bridge adapter. Simulates a direct connection between the virtual machine and the router. In this way, the virtual machine obtains its own IP address and obtains the same connection possibilities as any other physical computer. This includes the Internet connection.
As you have seen, the type of connectivity chosen for the virtual machine influences whether it has Internet access or not. Check out the Ways to Network Two Virtual Machines VirtualBox guide for all the details.