3

I have two VMs in my VirtualBox. Both are FreeBSD and should communicate between each other. I have created network with DHCP enabled and set like this:

Server Address  10.10.10.1
Server Mask 255.255.255.0
Lower Address Bound 10.10.10.100
Upper Address Bound 10.10.10.200

My VMs are pinging each other and getting right ip adress. This is what I must have and can´t change.

Now I want to access internet from one VM and I found that I must use two network cards but I don´t know how to set the second one. I am new with VirtualBox and this stuff so if you count with this in you answer I would appreciate that. And I have Windows 8 as host system if it´s matter.

Bibo
  • 211

3 Answers3

4

Make sure the second network adapter is enabled. Also check the Advanced section for the second network adapter (Attached to: NAT) to make sure it's the same Adapter Type as the first network adapter (not a requirement but this way you will know the driver is loaded for it) and that Cable Connected is checked.

Verify in the FreeBSD guest that the /etc/rc.conf file has an entry to enable the added adapter. You'll see a line such as:

ifconfig_dc0="DHCP"

for the first and make sure there's an entry for the added adapter as well, example:

ifconfig_dc1="DHCP"

(replace the dc before the 1 with the same thing the current line has before the 0) then reboot the guest OS.

2

Adding a network card is quite easy.

In the Networking section of the Virtual Machine's settings, choose an adapter tab. Tick Enable Network Adapter. For internet access, a NAT adapter is the easiest option. Then just click OK and you should be good to go!

Screenshot
Click for full size


See the VirtualBox networking documentation for detailed descriptions of what each adapter does.

Note that the GUI for VirtualBox only supports four adapters. To add more, you can use the VBoxManage modifyvm command (modifyvm networking documentation). VBoxManage list systemproperties will show the max number of network adapters available:

Maximum PIIX3 Network Adapter count:   8
Maximum ICH9 Network Adapter count:   36

PIIX3 and ICH9 are the two chipset options available on VirtualBox. PIIX3 is a very old chipset (and therefore does not support as many peripherals), but is the default for new VMs. You can change this in the System settings of the VM.

Bob
  • 63,170
0

For your guests have access the internet through "host-only", you need to have some firewall rules enabled. Full details on...

https://superuser.com/a/1238065/195840

NOTE: I did not answer completely your question here because in this way we will have a duplicate answer in the superuser.