

Click on OK and that will add a new entry of vboxnet0 to the list.Īt this point, if you run the command to list the interfaces in your host system, you should see an entry called vboxnet0 as below: You need to enter the following details in the dialog. This will open a new dialog and click on the “Adapter tab”. To set up a host-only network, go to File Menu -> Preferences -> Networks section and click on the “Host-only networks” tab.Ĭlick on the + icon to add a new Host-only network. This would be used in creating the static IP for the guest VM for communicating with host operating system.

Setup a host-only network ( vboxnet ) in VirtualBoxĪs a first step, we need to create a host-only network in the VirtualBox.

We will assume here that you have a VM ( Ubuntu / Centos Image ) running as VM already. There are plenty of resources available out there that provides step by step guide on how to do this.

I won’t be going through the installation or the details of setting up virtual box VM. In this post, I am going to show you how to set up the Virtualbox in a smart developer-friendly manner so that you can have a static IP that you can use in your project configurations which does not change and also another DHCP configuration that shares your host internet in the VM irrespective of the network you are on. Though this really helped in keeping my local system clean, one major issue I faced was with the IP address and internet access inside the VM’s when I switch networks. I use Virtualbox to create VMs which houses the necessary dependencies/services for each project and fire them up when I am required to work on the respective project. That’s where a virtualization solution like Virtualbox comes to rescue. If I were to run each of these services in my local system, I would be wasting resources as these are not always in need. One may require a combination of RabbitMQ and MySQL wherein the second one would be requiring Elasticsearch and Hazelcast. As a developer, I am required to work on different projects and each of them has got their own requirements for the environment and dependencies.
