No DNS entries and can't route when using NAT adapter w/ Virtualbox 4.1.8 with Android 3.2RC2 image?

1,294 views
Skip to first unread message

Ken

unread,
Dec 29, 2011, 11:33:11 AM12/29/11
to Android-x86
Could one of you guys running the 3.2 image in Virtualbox post the
results of these commands from your busybox?

#netcfg
lo UP 127.0.0.1/8 0x00000049 00:00:00:00:00:00
eth0 UP 10.0.2.15/1 0x00001043 08:00:27:44:a1:96

#netstat -r
tcp 0 0 127.0.0.1:5037 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:5555 0.0.0.0:* LISTEN

#ifconfig eth0
eth0: ip 10.0.2.15 mask 128.0.0.0 flags [up broadcast running
multicast]

#nslookup www.news.com 8.8.8.8
Server: 8.8.8.8
Address 1: 8.8.8.8

I'm using NAT mode on the PCNet FAST III network adapter in
VirtualBox. I don't have a DHCP server on the network, so I haven't
tried Bridged mode yet.
I can't figure out why I can't get out to the Internet. Looks like
Virtualbox assigned the IP correctly (I did have to go into busybox
and run "netcfg dhcp" then "netcfg eth0 up" to bring up eth0), but it
doesn't know how to route packets since I can't even ping Google's
8.8.8.8 DNS server...

Ken

unread,
Dec 29, 2011, 1:34:49 PM12/29/11
to Android-x86
I've gone through as many permutations as I can think of following
these two:
http://adrian.sutantio.info/2009/05/virtualbox-default-ip-address-for-nat.html
http://code.google.com/p/live-android/wiki/networkhowto
but still can't do a simple name lookup of www.news.com w/ the Android
3.2 RC2 ISO.
I basically set the DNS to 10.0.2.3 ("setprop net.eth0.dns1
10.0.2.3"), gateway to 10.0.2.2 ("route add default gw 10.0.2.2 dev
eth0"), and netmask to 255.255.255.0 (it grabbed a netmask of 0.0.0.0
from the 10.0.2.15 IP address that VirtualBox gave it).

Still can't do a simple traceroute to 8.8.8.8 :-P

Anyone have networking working w/ the 3.2 RC2 ISO?

Ken

unread,
Dec 29, 2011, 5:53:33 PM12/29/11
to Android-x86
FYI, eeepc 2.3RC1's networking works fine following bruno's
instructions...

Ken

unread,
Dec 30, 2011, 4:53:42 PM12/30/11
to Android-x86


On Dec 29, 5:53 pm, Ken <kenk...@gmail.com> wrote:
> FYI, eeepc 2.3RC1's networking works fine following bruno's
> instructions...

Forgot to mention that installing to hard disk in virtualbox still
doesn't work w/ 2.3RC1 (nor does it work w/ 3.2RC2 or 4.0-devel...they
all boot up into a grub prompt (not the menu).
Guess 2.3RC1 can be used for debugging network code...would be nice to
debug it on honeycomb too

Ken

unread,
Jan 1, 2012, 1:15:07 PM1/1/12
to Android-x86
Just for yucks, I tried setting up 3.2RC2 in Virtualbox using a
Bridged PC-Net III adapter instead of NAT adapter (set up a DHCP
server on the network as well.

eth0 received the assigned DHCP IP address properly, but the netmask
is 0.0.0.0 which prevented me from pinging the DHCP server.
I changed the netmask by doing this:
ifconfig eth0 192.168.1.220 netmask 255.255.255.0

And then I can ping the DHCP server (which is also the router).

I added a default route by doing this:
route add default gw 192.168.1.1 dev eth0
but doing a traceroute gives a "Network is unreachable" error.

This is similar behavior to what I saw w/ the NAT adapter, so my
conclusion is that this is a bug. I'll log this as a new issue in the
bug tracker.

p.s., to set the DNS, it's "setprop net.dns1 8.8.8.8"...net.eth0.dns1
has been deprecated.
Message has been deleted

Phil

unread,
Jan 5, 2012, 11:13:04 AM1/5/12
to Android-x86
Try doing the following: Open the terminal with ctrl+f1 and type:

dhcpcd
setprop net.dns1 8.8.8.8

You should have an ethernet connection now. Keep in mind that the
OS still sees you as disconnected, but you should be able to use
the browser and other apps as long as they are not checking the
network state explicitly.

chaucy zhang

unread,
Feb 9, 2012, 11:09:28 PM2/9/12
to Android-x86
I can use bridged adapter pcnet-pci II to connect to the internet
first,
ifconfig eth0 192.168.1.85 netmask 255.255.255.0
and then
route add default gw 192.168.1.254 dev eth0

then i can ping my dhcp ip address, but not any website like www.google.com
at last use phil's way to set
dhcpcd
setprop net.dns1 8.8.8
then the i can ping google and use web browser.
Reply all
Reply to author
Forward
0 new messages