Select Page

Hi Today i am going show you how to setup virtualbox for local Development which will be useful when you are developing / deploying application inside the virtual machine and want to interact with it outside the virtual machine or from host machine,this is also helpful when you are developing for openstack you have installed openstack in vm and want to interact and test the api from host machine, before starting download & install Virtualbox.

Watch  Video Tutorial Over Here

Create Host only network adapter

Click on File -> Preference

Choose Network, Click Host-only Networks and click on plus sign

Click on Settings button of vboxnet0

Under Adapter Tab

IPv4 Address
IPv4 Network Mask

Under DHCP Server Tab
Check mark the “Enable Server option”
Server Address
Server Mask
Lower Address Bound
Upper Address Bound

Add Host only adapter to virtual machine as Network Adapter 2

Right Click on the vm and click on settings

Choose Network , Under Adapter 2, Check Enable Network Adapter

Attached To Host-only Adapter
Name: vboxnet0
Then boot the vm and run sudo vim /etc/network/interfaces
Add These two lines at end

Save the file and reboot the vm

Full Contents of /etc/network/interfaces file

once the vm is booted find the ip address given by hostonly adapter by running  ip a of enp0s8  interface
once you get that ip address you can ping,ssh,ftp or if you are running a webserver in vm you can access it from host machine
from your host machine run ping [ip address of vm] ,install webserver on vm open it on host machine.