2

I’m attemtping to host my own development web server in a VirtualBox guest virtual machine running Ubuntu Server. I would like this virtual machine to be accessible from not only my home network, but outside the LAN as well.

As such, I’ve set up a static IP so I can later forward ports to this static IP. My VirtualBox settings have this virtual machine only using one adapter in bridged mode.

Here’s what my /etc/network/interfaces looks like:

iface eth0 inet static
address 10.0.1.203 /*this is outside the DHCP range*/
netmask 255.255.255.0
gateway 10.0.1.1
network 10.0.1.0
broadcast 10.0.1.255
dns-nameservers: 8.8.8.8 8.8.8.4

Here’s what the output of ifconfig looks like:

enter image description here

Here’s ifconfig -a:

enter image description here

Here’s the output of lspci:

enter image description here

And here’s my VirtualBox settings:

enter image description here

My host system is a Mac Mini, running Mac OS X 10.7.

From within the guest OS, if I ping google.com:

$ ping google.com
# outputs 'ping: unknown host google.com' immediately

Why am I unable to access the web?

6
  • 2
    Please update your post with these outputs: ifconfig and lspci. This will tell us if your guest vm detects the virtual network device. Also tell us if you have installed the VB guest additions.
    – invert
    Commented Sep 7, 2012 at 7:10
  • [Obvious question] Have you checked the results of ping 10.0.1.1 and ping 8.8.8.8/ping 8.8.8.4 to ensure you are reaching the gateway and the nameserver(s)? The immediate unknown host response indicates that your VM isn't resolving 'google.com'.
    – StarNamer
    Commented Sep 7, 2012 at 17:07
  • says 'connect: Network is unreachable' when i Ping 10.0.1.1 I'm positive this is my router's address though. I'm looking at in my Mac host's network settings
    – jshawl
    Commented Sep 7, 2012 at 17:08
  • @jessh in your ifconfig screenshots -- your eth0 interface is down. Have you tried ifconfig eth0 up?
    – Sean C.
    Commented Sep 7, 2012 at 17:37
  • @jessh in addition, after looking at your /etc/network/interfaces you're missing the auto eth0 statement that brings the interface online at boot, so I suspect that the interface is just down and ifconfig eth0 up will fix it. See: wiki.debian.org/…
    – Sean C.
    Commented Sep 7, 2012 at 17:43

2 Answers 2

1

Based on the information provided, it looks as though the eth0 interface is offline. Per the Debian wiki on /etc/network/interfaces you need to add:

auto eth0

to the top of your configuration in order to bring the card online at boot.

To bring the interface online after boot time, you can issue the command:

ifconfig eth0 up

If you happen to prefer iproute2 to the standard tools, you can use the command:

ip link set eth0 up

During discussions with @jessh a bug with MAC OS and bridging Wifi was found posted at VirtualBox. This may be what was causing the issue, but it's unconfirmed thus far.

8
  • hmm. still not working: dl.dropbox.com/u/2241201/locker/…
    – jshawl
    Commented Sep 7, 2012 at 17:54
  • Does ifconfig eth0 show that the connection is up?
    – Sean C.
    Commented Sep 7, 2012 at 17:55
  • I don't think so.. (no ip address) dl.dropbox.com/u/2241201/locker/…
    – jshawl
    Commented Sep 7, 2012 at 18:03
  • @jessh monitor the kernel log tail -f /var/log/syslog then toggle the virtual interface between disconnected and bridged, or off and bridged. Watch for a message in the log which indicates eth0 NIC Link is Up. I suspect there may be an issue with getting a carrier on the interface. You tried using ifconfig eth0 up already I assume?
    – Sean C.
    Commented Sep 7, 2012 at 18:08
  • Yep I tried the last thing you said. Unfortunately, I won't be able to tail the kernel log, as the vm must be off for me to make network changes. Here's an alternative idea. If i set the network mode to NAT, will it show up as a nother PC on my LAN?
    – jshawl
    Commented Sep 7, 2012 at 18:13
0

There's a few things I see which could be the cause of your issue. The first is that your dns-nameservers: 8.8.8.8 8.8.8.4 line has a colon in it, and that could be causing an issue. Second, 8.8.8.4 is not a valid Google DNS server, (it should be 8.8.4.4 as per this), but that shouldn't matter if the 8.8.8.8 address is working. Next, I don't see anywhere in your logs where you restarted the networking on your Ubuntu machine after changing the IP address, so the changes may not be taking hold yet. Lastly, if you're using one of the newer versions of Ubuntu, your dns-nameservers line may be depreciated in favor of the resolv.conf file. You can read up how to fix this issue, here.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .