Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm attemtping to host my own development web server in a virtual box guest, 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 virtual box settings have this vm 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: https://dl.dropbox.com/u/2241201/locker/ubuntu.png

Here's ifconfig -a https://dl.dropbox.com/u/2241201/locker/Screen%20Shot%202012-09-07%20at%2012.20.32%20PM.png

Here's the output of lspci: https://dl.dropbox.com/u/2241201/locker/Screen%20Shot%202012-09-07%20at%2012.25.23%20PM.png

and Here's my virtualbox settings: https://dl.dropbox.com/u/2241201/locker/Screen%20Shot%202012-09-07%20at%2012.21.16%20PM.png

My Host is a mac mini, running OS X 10.7.

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

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

Why am I unable to access the web?

share|improve this question
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 Sep 7 '12 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 Sep 7 '12 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 –  jessh Sep 7 '12 at 17:08
    
@jessh in your ifconfig screenshots -- your eth0 interface is down. Have you tried ifconfig eth0 up? –  Sean C. Sep 7 '12 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. Sep 7 '12 at 17:43

1 Answer 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.

share|improve this answer
    
hmm. still not working: dl.dropbox.com/u/2241201/locker/… –  jessh Sep 7 '12 at 17:54
    
Does ifconfig eth0 show that the connection is up? –  Sean C. Sep 7 '12 at 17:55
    
I don't think so.. (no ip address) dl.dropbox.com/u/2241201/locker/… –  jessh Sep 7 '12 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. Sep 7 '12 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? –  jessh Sep 7 '12 at 18:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.