Guest OS doesn't get IP from DHCP

Discussions about using Linux guests in VirtualBox.
polki
Posts: 49
Joined: 17. Dec 2008, 14:58

Guest OS doesn't get IP from DHCP

Post by polki »

Hi guys!
This is my config, the host is Debian:

Code: Select all

pc:/home/user$ VBoxManage list vms
VirtualBox Command Line Management Interface Version 2.1.0
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.

Name:            freeNAS
Guest OS:        FreeBSD
...
Memory size:     128MB
...
ACPI:            on
...
NIC 1:           MAC: 080027D0FF72, Attachment: Host Interface 'eth0', Cable connected: on, Trace: off (file: none), Type: Am79C973, Reported speed: 1000 Mbps
...
The host get's its IP address from the DHCP server through eth0 without any problems. As far as I understood all guides and faqs, with this config (hostif net connected to eth0) the guest should also get its IP address from the DHCP somewhere on the LAN. But it doesn't. What's the problem here?
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

What does ifconfig say? This is normally due to changing the NIC on an existing VDI which rerandomises the MAC address and this creates a second entry in /etc/udev/rules.d/70-persistent-net.rules so the eth0 doesn't initialise properly. There are lots of topics on this. Delete the offending lines and udev will rebuild it properly at next reboot.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
polki
Posts: 49
Joined: 17. Dec 2008, 14:58

Post by polki »

TerryE wrote:This is normally due to changing the NIC on an existing VDI which rerandomises the MAC address and this creates a second entry in /etc/udev/rules.d/70-persistent-net.rules so the eth0 doesn't initialise properly. There are lots of topics on this. Delete the offending lines and udev will rebuild it properly at next reboot.
I doubt this problem since I didn't change the nic and since there is no VDI. I just tried this one with a Live-CD of FreeNAS.
TerryE wrote:What does ifconfig say?
I guess you mean ifconfig within the guest:

Code: Select all

pcn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
     inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255
     ether 08:00:27:d0:ff:72
     media: Ethernet none
     status: active
I recognized that it says "media: Ethernet none". But why?
polki
Posts: 49
Joined: 17. Dec 2008, 14:58

Post by polki »

any ideas?
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

What does the [/Devices/pcnet/0/] tree say in your VBox.log?
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
polki
Posts: 49
Joined: 17. Dec 2008, 14:58

Post by polki »

TerryE wrote:What does the [/Devices/pcnet/0/] tree say in your VBox.log?
Log looks good too...

Code: Select all

00:00:00.103 [/Devices/pcnet/0/] (level 3)
00:00:00.103   Trusted       <integer> = 0x0000000000000001 (1)
00:00:00.103   PCIDeviceNo   <integer> = 0x0000000000000003 (3)
00:00:00.103   PCIFunctionNo <integer> = 0x0000000000000000 (0)
00:00:00.103
00:00:00.103 [/Devices/pcnet/0/Config/] (level 4)
00:00:00.103   Am79C973       <integer> = 0x0000000000000001 (1)
00:00:00.103   MAC            <bytes>   = "08 00 27 d0 ff 72" (cb=6)
00:00:00.103   CableConnected <integer> = 0x0000000000000001 (1)
00:00:00.103   LineSpeed      <integer> = 0x00000000000f4240 (1000000)
00:00:00.103
00:00:00.103 [/Devices/pcnet/0/LUN#999/] (level 4)
00:00:00.103   Driver <string>  = "MainStatus" (cch=11)
00:00:00.103
00:00:00.103 [/Devices/pcnet/0/LUN#999/Config/] (level 5)
00:00:00.103   papLeds <integer> = 0x0000000008074124 (134693156)
00:00:00.103
00:00:00.103 [/Devices/pcnet/0/LUN#0/] (level 4)
00:00:00.103   Driver <string>  = "IntNet" (cch=7)
00:00:00.103
00:00:00.103 [/Devices/pcnet/0/LUN#0/Config/] (level 5)
00:00:00.103   Trunk     <string>  = "eth0" (cch=5)
00:00:00.103   TrunkType <integer> = 0x0000000000000003 (3)
00:00:00.103   Network   <string>  = "HostInterfaceNetworking-eth0" (cch=29)
polki
Posts: 49
Joined: 17. Dec 2008, 14:58

Post by polki »

Can nobody help me with this problem? :?
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

I am not sure what is going on here.

For a VM using a NAT I/F I get this in the VBox.log

Code: Select all

00:00:01.487 [/Devices/pcnet/0/] (level 3)
00:00:01.487   Trusted       <integer> = 0x0000000000000001 (1)
00:00:01.487   PCIDeviceNo   <integer> = 0x0000000000000003 (3)
00:00:01.487   PCIFunctionNo <integer> = 0x0000000000000000 (0)
00:00:01.487
00:00:01.487 [/Devices/pcnet/0/Config/] (level 4)
00:00:01.487   Am79C973       <integer> = 0x0000000000000001 (1)
00:00:01.487   MAC            <bytes>   = "08 00 27 17 d6 e4" (cb=6)
00:00:01.487   CableConnected <integer> = 0x0000000000000001 (1)
00:00:01.487   LineSpeed      <integer> = 0x0000000000000000 (0)
00:00:01.487
00:00:01.487 [/Devices/pcnet/0/LUN#999/] (level 4)
00:00:01.487   Driver <string>  = "MainStatus" (cch=11)
00:00:01.487
00:00:01.487 [/Devices/pcnet/0/LUN#999/Config/] (level 5)
00:00:01.487   papLeds <integer> = 0x0000000000875ec0 (8871616)
00:00:01.487
00:00:01.487 [/Devices/pcnet/0/LUN#0/] (level 4)
00:00:01.487   Driver <string>  = "NAT" (cch=4)
00:00:01.487
00:00:01.487 [/Devices/pcnet/0/LUN#0/Config/] (level 5)
00:00:01.487   TFTPPrefix <string>  = "/home/terry/.VirtualBox/TFTP" (cch=29)
00:00:01.487   BootFile   <string>  = "forumLAMP.pxe" (cch=14)
00:00:01.487
00:00:01.487 [/Devices/pcnet/0/LUN#0/Config/guestssh/] (level 6)
00:00:01.487   Protocol  <string>  = "TCP" (cch=4)
00:00:01.487   GuestPort <integer> = 0x0000000000000016 (22)
00:00:01.487   HostPort  <integer> = 0x00000000000008ad (2221)
00:00:01.487
00:00:01.487 [/Devices/pcnet/0/LUN#0/Config/guestwww/] (level 6)
00:00:01.487   Protocol  <string>  = "TCP" (cch=4)
00:00:01.487   GuestPort <integer> = 0x0000000000000050 (80)
00:00:01.487   HostPort  <integer> = 0x0000000000001f91 (8081)
and this in the ifconfig

Code: Select all

eth0      Link encap:Ethernet  HWaddr 08:00:27:17:d6:e4
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe17:d6e4/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:35625 errors:0 dropped:0 overruns:0 frame:0
          TX packets:54845 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2557718 (2.4 MB)  TX bytes:65089546 (62.0 MB)
          Interrupt:11 Base address:0xc020

lo         ...
For a VM using a Host I/F I get this in the VBox.log

Code: Select all

00:00:02.425 [/Devices/pcnet/0/] (level 3)
00:00:02.425   Trusted       <integer> = 0x0000000000000001 (1)
00:00:02.425   PCIDeviceNo   <integer> = 0x0000000000000003 (3)
00:00:02.425   PCIFunctionNo <integer> = 0x0000000000000000 (0)
00:00:02.425
00:00:02.425 [/Devices/pcnet/0/Config/] (level 4)
00:00:02.425   Am79C973       <integer> = 0x0000000000000001 (1)
00:00:02.425   MAC            <bytes>   = "08 00 27 eb 73 6a" (cb=6)
00:00:02.425   CableConnected <integer> = 0x0000000000000001 (1)
00:00:02.425   LineSpeed      <integer> = 0x0000000000000000 (0)
00:00:02.425
00:00:02.425 [/Devices/pcnet/0/LUN#999/] (level 4)
00:00:02.425   Driver <string>  = "MainStatus" (cch=11)
00:00:02.425
00:00:02.425 [/Devices/pcnet/0/LUN#999/Config/] (level 5)
00:00:02.425   papLeds <integer> = 0x0000000000875e20 (8871456)
00:00:02.425
00:00:02.425 [/Devices/pcnet/0/LUN#0/] (level 4)
00:00:02.425   Driver <string>  = "IntNet" (cch=7)
00:00:02.425
00:00:02.425 [/Devices/pcnet/0/LUN#0/Config/] (level 5)
00:00:02.425   Trunk     <string>  = "eth0" (cch=5)
00:00:02.425   TrunkType <integer> = 0x0000000000000003 (3)
00:00:02.425   Network   <string>  = "HostInterfaceNetworking-eth0" (cch=29)
and this in the ifconfig

Code: Select all

eth0      Link encap:Ethernet  HWaddr 08:00:27:eb:73:6a
          inet addr:192.168.1.77  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:feeb:736a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:49642 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1531 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4973081 (4.7 MB)  TX bytes:82384 (80.4 KB)
          Interrupt:11 Base address:0xc020

lo        ...
So everything is as expected for me. I just wonder if the FreeNAS LiveCD doesn't support the Am79C973. I don't know why ifconfig is reporting pcn0 instead of eth0. Have you tried the FreeNAS forum?
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
polki
Posts: 49
Joined: 17. Dec 2008, 14:58

Post by polki »

TerryE wrote:I just wonder if the FreeNAS LiveCD doesn't support the Am79C973. I don't know why ifconfig is reporting pcn0 instead of eth0. Have you tried the FreeNAS forum?
Well, I guess it does support the Am79C973, otherwise there wouldn't even be any interface in ifconfig, I guess.

The different name is simply the result of FreeNAS having FreeBSD as its base.

I will try the following things as soon a I got some minutes and post the outcome here. Perhaps this helps solve the problem...
  • - Try different ethernet cards with FreeNAS
    - Install a standard Debian and Windows XP within VirtualBox
polki
Posts: 49
Joined: 17. Dec 2008, 14:58

Post by polki »

polki wrote:Try different ethernet cards with FreeNAS
Am79C970A is recognized as lcn0, same problem here.
polki wrote: Install a standard Debian and Windows XP within VirtualBox
Am79C973 is recognized as eth0 within Debian, same problem here too.

So it seems like it's whether a problem of FreeNAS, nor a problem of unsupported interfaces. It has to be somewhere within VirtualBox...
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

Sorry, but "it seems like it's neither a problem of FreeNAS, nor a problem of unsupported interfaces. It has to be somewhere within VirtualBox." is a bit of flawed logic: I can't find a problem in A therefore it's in B. An alternative explanation is: I can't find a problem in A, therefore I've missed one.

I just created a diskless VM (using a host IF NIC) and tried it with two ISOs: an Ubuntu 8.04 386 distro and a systemrescuex86-1.0.4 ISO, booting both in LiveCD mode. ifconfig showed eth0 to be configured fine (though I had to do a net-setup eth0 first on the system rescue CD). In both cases the VM guest OS picked up my IP address through DHCP and I was able to connect to a local NAS device using FTP.

Therefore I just suspect that you are missing something in the FreeNAS configuration. Sorry.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
polki
Posts: 49
Joined: 17. Dec 2008, 14:58

Post by polki »

TerryE wrote:Sorry, but "it seems like it's neither a problem of FreeNAS, nor a problem of unsupported interfaces. It has to be somewhere within VirtualBox." is a bit of flawed logic: I can't find a problem in A therefore it's in B. An alternative explanation is: I can't find a problem in A, therefore I've missed one.
I agree with you, that might also be possible. Nevertheless I posted my config here and it was approved as right by you. Don't understand me wrong, I don't want to make any judgements or blame it on anyone/anything. But although my knowledges of the topic aren't worst, I just don't know how to continue anymore. I don't know how to solve this problem. That's why I posted here. Not to blame anyone...
If you got me any tip for the "therefore I've missed one", I would really really appreciate that too!
TerryE wrote:Therefore I just suspect that you are missing something in the FreeNAS configuration. Sorry.
But why do I have the same problem with a normal Debian installation within VirtualBox? That's why I tried Debian. If the problem exists here too, it can't be anything about FreeNAS...

Is there any possibility to check whether the packets sent by the guest OS ever leave the virtual machine?
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

OK, so I downloaded FreeNAS-i386-LiveCD-0.69.4276.iso stuck it on my VM and booted it, "out of the box, with no mods".

pcn0 came up as 192.168.1.250 and seemed to work fine. I don't know what your problems are, but it works fine on VB 2.1.0 for me. Sorry, but I don't think that you can blame VBox for this one.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
polki
Posts: 49
Joined: 17. Dec 2008, 14:58

Post by polki »

So you got no other idea for me anymore? :(
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

I would recreate your VM from scratch just in case you've done something daft in the VM settings. Don't select FreeBSD. (I just select a generic Linux 2.6).
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
Post Reply