Virtualbox - setup your host-only adapter

There are many blog, post on net about how to setup your host only adapter, but none of them are complete. So I'm writing step by step guide.


In VirtualBox > Preferences > Network, set up a host-only network.
Mine is called vboxnet0, it is manually configured:
ip 192.168.56.1
netmask 255.255.255.0
no dhcp

Then, in the network settings for the virtual machine, set up two adapters:
Adapter 1
host only, vboxnet0
Adapter2
NAT
Boot the virtual machine and log in through the console VirtualBox provides.
Run this to see your adapters:
ls /sys/class/net


In my case the adapters were named eth1 and eth2 (and lo, the loopback interface).
Then, edit your network configuration.
sudo joe /etc/network/interfaces





# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface host-only adapter
auto eth0
allow-hotplug eth0
iface eth0 inet static
address 192.168.56.100
netmask 255.255.255.0


auto eth1
iface eth1 inet dhcp
and then


sudo reboot

Comments

Popular Posts