WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: eth0 internet network connection on virtualbox  (Read 22177 times)

Offline core

  • Newbie
  • *
  • Posts: 12
eth0 internet network connection on virtualbox
« on: May 13, 2010, 03:39:14 PM »
Hi,

I'm trying to get an internet connection with Tinycore. I have a computer with ubuntu 10.04 as host connected by a wireless usb adapter. I have Tinycore 2.11 installed in virtualbox ose. I can't seem to get a connection though. I tried lubuntu 10.04 and it could not connect wirelessly. After installing lubuntu in virtualbox, I was able to connect using the ethernet connection through the virtual machine. I was thinking that I might be able to do that with Tinycore as well, and that it would be easier than trying to get the wireless modules working. However, every time I try to connect in the App Browser, I get "Connection error, check network or mirror."

After looking through many threads here, I tried the dmesg command and found these lines:

eth0: registered as PCnet/FAST III 79C973
...
eth0: link up, 100Mbps, full-duplex


Can anyone help?  :)

Offline Kingdomcome

  • Sr. Member
  • ****
  • Posts: 286
Re: eth0 internet network connection on virtualbox
« Reply #1 on: May 13, 2010, 04:12:05 PM »
The dmesg responses look correct and indicate that the interface is up and active.  what are the results of ifconfig?

Offline core

  • Newbie
  • *
  • Posts: 12
Re: eth0 internet network connection on virtualbox
« Reply #2 on: May 13, 2010, 05:26:05 PM »
Here's the results of ifconfig. (I had to type it all; I hope it's correct.)

eth0   Link encap:Ethernet  HWaddr 08:00:27:60:C6:7A
   inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
   UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
   RX packets:2 errors:0 dropped:0 overruns:0 frame:0
   TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
   collisions:0 txqueuelen:1000
   RX bytes:1180 (1.1 KiB)  TX bytes:1180 (1.1 KiB)
   Interrupt:10 Base address:0xd0d0

lo   Link encap:Local Loopback
   inet addr:127.0.0.1  Mask:255.0.0.0
   UP LOOPBACK RUNNING  MTU:16436  Metric:1
   RX packets:0 errors:0 dropped:0 overruns:0 frame:0
   TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
   collisions:0 txqueuelen:0
   RX bytes:0 (0.0 KiB)  TX bytes:0 (0.0 KiB)

Offline Kingdomcome

  • Sr. Member
  • ****
  • Posts: 286
Re: eth0 internet network connection on virtualbox
« Reply #3 on: May 13, 2010, 06:36:30 PM »
ifconfig output looks good as well.  have you tried pinging the gateway or other boxes on the network or internet?

Offline core

  • Newbie
  • *
  • Posts: 12
Re: eth0 internet network connection on virtualbox
« Reply #4 on: May 13, 2010, 06:55:17 PM »
I looked at the network tool in the "panel" and it has no IP, Broadcast, or Gateway addresses filled in. I tried pinging www.google.com and it failed. I tried pinging the wireless router (the connection underneath the virtual machine) and it appeared to work (20 packets - 4% loss) though it just kept giving results. I had to kill it with ^C. (Is that normal? I don't have to stop the ping command on Windows XP.)


Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: eth0 internet network connection on virtualbox
« Reply #5 on: May 13, 2010, 08:05:19 PM »
@core: Don't forget that your TC system is in a VM and that your host system (and / or your router) will probably have a firewall running. It probably depends on the firewall rules what you can do from "inside" the VM.

In my case (using VBox on a XP host system) I have no problem to ping my host (i.e. ping 10.0.2.2), my router, and even 'google.com'. But when using QEMU I can't ping the router or 'google.com'. I put that down to some firewall setting somewhere but can't be bothered to look into this since that is without significance for the "real" traffic (e.g. using 'http').

So in your case we can see that your (emulated) network card was found, has received an IP address (proven by inet addr:10.0.2.15) and has had even some traffic going in and out (proven by RX bytes:1180 (1.1 KiB)  TX bytes:1180 (1.1 KiB)). So what you could do next is something like wget http://goggle.com and report back if that results in an error.

BTW in *NIX the 'ping' runs forever (or you could limit it with the '-c' option) whilst in windows it's default is to use 4 attempts (or you could use the '-t' option to let it run forever).

Offline core

  • Newbie
  • *
  • Posts: 12
Re: eth0 internet network connection on virtualbox
« Reply #6 on: May 13, 2010, 08:25:45 PM »
I'm getting these error messages:

wget http://www.google.com

wget: bad address 'www.google.com'


wget http://google.com

wget: bad address 'google.com'


wget http://distro.ibiblio.org/pub/linux/distributions/tinycorelinux/2.x/release/tinycore_2.11.iso.md5.txt

wget: bad address 'distro.ibiblio.org'


I've not used wget before, so maybe I didn't do something right?


[edit]

It appears to be a dns issue because I can ping http://74.125.47.99/ (www.google.com)
« Last Edit: May 13, 2010, 08:29:18 PM by core »

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: eth0 internet network connection on virtualbox
« Reply #7 on: May 13, 2010, 08:31:51 PM »
You need to have the nameservers in /etc/resolv.conf

nameserver 8.8.8.8

Offline core

  • Newbie
  • *
  • Posts: 12
Re: eth0 internet network connection on virtualbox
« Reply #8 on: May 13, 2010, 08:40:19 PM »
I checked /etc/resolv.conf and it has 192.168.1.254. My host ubuntu install has the same address in its /etc/resolv.conf file. Do I really need to change it to 8.8.8.8 if it's already the same as the host operating system?


[edit]

I tried the 8.8.8.8 and I was able to populate the App Browser. :) Can anyone explain why I needed a different nameserver than the host?
« Last Edit: May 13, 2010, 08:45:44 PM by core »

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: eth0 internet network connection on virtualbox
« Reply #9 on: May 13, 2010, 08:52:29 PM »
That is clearly a DNS issue, you could do a nslookup google.com in your VM and in your host. I imagine there will be a difference, even though the '/etc/resolve.conf' appears to be identical. Changing you VM's '/etc/resolve.conf' looks like a good idea to me.

Edit: I can't offer an explanation since my VBox VM works fine with the same DNS server as my host (both are using my router). I guess your router (which I assume is meant with 192.168.1.254) does not "like" your VM. You could still change the DNS server back to your router and do the "nslookup test".
« Last Edit: May 13, 2010, 09:00:02 PM by maro »

Offline core

  • Newbie
  • *
  • Posts: 12
Re: eth0 internet network connection on virtualbox
« Reply #10 on: May 13, 2010, 09:06:11 PM »
192.168.1.254 is not my router's address; I thought it was the nameserver's address? Are you saying I should change /etc/resolv.conf to my routers address? I don't understand.  ???

Offline Kingdomcome

  • Sr. Member
  • ****
  • Posts: 286
Re: eth0 internet network connection on virtualbox
« Reply #11 on: May 13, 2010, 09:09:24 PM »
/etc/resolv.conf needs to point to your router or and public dns server (ie: google's 8.8.8.8) unless you are running another dns server on your network.

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: eth0 internet network connection on virtualbox
« Reply #12 on: May 13, 2010, 09:25:15 PM »
Well, kingdomecome does assume in his last comment (and so did I) that your router is also running a DNS service for all attached systems.

That is pretty much the default for all routers I have come accross. The IP address is slightly suspicious as it ends with '.254' instead of '.1' (what most routers do). Nevertheless it is entirely possible that your router (let's assume for a moment that it's '192.168.1.1') has also a DNS server running (on '192.168.1.254'). At the DHCP request of your host (which I assume your router responds to) it also receives back the DNS server information. This information would most likely be used by Vbox to respond to the DHCP request of the guest (your TC system in this case).

Anyway, you seemed to have resolved your immediate issue, so have some fun with TC.

Offline core

  • Newbie
  • *
  • Posts: 12
Re: eth0 internet network connection on virtualbox
« Reply #13 on: May 13, 2010, 09:43:47 PM »
Actually, the router is 192.168.2.1. Anyway, I have internet access now. :) Thanks for the help Kingdomcome, gerald_clark, maro, and anyone else if I missed someone.

[edit]
I decided to start a new thread for the persistence issue instead of trying to squeeze it in here.
« Last Edit: May 13, 2010, 10:21:32 PM by core »

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: eth0 internet network connection on virtualbox
« Reply #14 on: May 13, 2010, 10:27:00 PM »
Well, you have multiple options and they all kind off reflect what you'd do in the "non-VM" case:

(1) You could create a (virtual) hard disk (i.e. an image file on your host) and use this for persistence. In this case you'd still use your ISO to boot from (which contains the boot loader, kernel and the initrd).  Then you've got the choice  to use backup/restore or persistent "home" and "opt" (in addition to your extension storage) to enable your setup to "survive" the next re-boot.

(2) Or you could create a (virtual) hard disk and follow the installation instructions. In this case you won't need to keep the ISO around for the boot process.

You could even simulate a USB pen drive, but this might be a bit too much for you to set up and is more or less a variation of above. Please have a careful read of the FAQ, and the Wiki. I'm pretty sure that most (if not all) the questions you might have right now have already been answered in this forum. So use the search function and don't forget to ask questions the smart way.