After I installed Ubuntu this network setting from VirtualBox worked, but now it doesn't work anymore. It appears that Ubuntu doesn't have Internet. I think it's because in the meantime I switched my host connection from wireless to cable (PPPOE).
If I select NAT and restart, then it works, but I can't access Ubuntu from the host through a public IP :(
How can I have Internet in the Ubuntu VM, regardless of my connection settings in the host, and also be able to access Ubuntu from the host through a public IP like
126.96.36.199 or whatever?
With the "Host-only adapter" I get a public IP. Can I also get the Internet to work with it?
I did it!!0
If anyone is interested, here's how:
- set Adapter 1 to NAT
- set Adapter 2 to Host-only Adapter
In File -> Preferences -> Network edit the Host-only Adapter and change the IPV4 address to 192.168.56.1.
In ubuntu, edit this file:
sudo nano /etc/network/interfaces
Add at the end:
# The host-only network interface auto eth1 iface eth1 inet static address 192.168.56.101 netmask 255.255.255.0 network 192.168.56.0 broadcast 192.168.56.255
Restart, and now the server should be accessible from the host @
Found the info here: http://christophermaier.name/blog/2010/09/01/host-only-networking-with-virtualbox
Didn't test it with a wireless connection because I have no access to one yet, but it should work because NAT is set as the Internet source