Question about connect internet in vitualbox

Discussions related to using VirtualBox on Linux hosts.
Post Reply
scubindu
Posts: 12
Joined: 26. Jan 2016, 10:15
Primary OS: MS Windows 7
VBox Version: OSE Debian
Guest OSses: 5
Contact:

Question about connect internet in vitualbox

Post by scubindu »

Dear all member!

I'm setting up a VM that runs on Ubuntu Server 14.04.2 via virtualbox 5.0 on a desktop running on windows 7 Pro. The host machine is set to a static IP address and its Internet connection is working.
I can run a command "dig" on the VM and it replied with success. At this stage, its IP address was still assigned by DHCP. I believe, it's set to NAT by default under "Network" configuration in VirtualBox.

Then, the internet stopped working after changing from dhcp to static in virtual network adapter on the Ubuntu VM.

Code: Select all

auto eth0
    iface eth0 inet static

    address 10.0.2.100
    netmask 255.255.255.0
    network 10.0.2.0
    broadcast 10.0.2.255
    gateway 10.0.2.1
    dns-servers 8.8.8.8 8.8.4.4
When I run the command "dig http://www.google.com", I received "connection timed out; no servers could be reached".
When I looked into Network settings for the Ubuntu VM, it's set to NAT. I tried both Bridged Adapter and Host-only Adapter but to no avail.
If I switched it back from static to dhcp in the VM network interfaces settings, I got replies and the internet is working fine.
Just wondering if I have missed out on any steps here.

Thank you very much!


[Spam content removed]
Last edited by scubindu on 14. Apr 2016, 09:57, edited 1 time in total.
Have a nice day.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Question about connect internet in vitualbox

Post by socratis »

1) Why do you need a static, manually configured IP? On a NAT network?
2) You can't use whatever address you want in a Bridged network. It has to be within your router's IP range and not already taken.
3) Host-only will not get you anywhere but your host. It says it right there in the name.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply