VirtualBox guest using Bridged networking unable to obtain DHCP address

12,263

I have observed the same on VirtualBox: Sometimes DHCP does not work at all, sometimes it takes some time until the DHCP-request "goes through". Try to emulate a different network card.

Share:
12,263

Related videos on Youtube

Adam Trhon
Author by

Adam Trhon

Updated on September 18, 2022

Comments

  • Adam Trhon
    Adam Trhon over 1 year

    I have a computer, called Loki, that works as a virtual machine host and DHCP server. The DHCP daemon is listening on port eth0. Part of /etc/dhcp.conf:

    subnet 192.168.13.0 netmask 255.255.255.0 {
        range 192.168.13.140 192.168.13.140;
    }
    
    host Windows7VM {
        hardware ethernet 08:00:27:57:C9:69;
        fixed-address 192.168.13.150;
        option subnet-mask 255.255.255.0;
        option broadcast-address 192.168.13.255;
        option routers 192.168.13.1;
    }
    
    host TerminalAdam {
        hardware ethernet ...;
        fixed-address 192.168.13.151;
        option subnet-mask 255.255.255.0;
        option broadcast-address 192.168.13.255;
        option routers 192.168.13.1;
    }
    

    eth0 is configured like this:

    ifconfig eth0 192.168.13.1 netmask 255.255.255.0
    

    There is another computer, called TerminalAdam. The DHCP client configuration of TerminalAdam works fine. Now I need to connect Windows7 virtual machine to this network, so that both TerminalAdam and Windows7VM DHCP clients are configured by Loki's DHCP server.

    In VirtualBox VM network settings I choose bridge, device eth0. When I turn on the VM, I get this in /var/log/messages.log several times:

    Apr 27 14:36:41 localhost dhcpd: DHCPDISCOVER from 08:00:27:57:c9:69 via eth0
    Apr 27 14:36:41 localhost dhcpd: DHCPOFFER on 192.168.13.150 to 08:00:27:57:c9:69 via eth0
    

    But in Windows I have "connection to network is not available" in the network adapter status and I cannot connect.

    • George M
      George M about 12 years
      Are you running the VirtualBox VM guest on the same host that is acting as DHCP server?
    • George M
      George M about 12 years
      Additionally, is TerminalAdam also a VM guest?
    • Adam Trhon
      Adam Trhon about 12 years
      @uther TerminalAdam is a separate computer, and both VBVM guest and DHCP server run on the same machine.
    • George M
      George M about 12 years
      For completeness, would you edit your question with that information? It will help you get a higher quality answer.
    • Adam Trhon
      Adam Trhon about 12 years
      @uther Yes, I added that information just after your edit
    • Beginner
      Beginner almost 10 years
      hi guys sorry for interrupt, I need a help on dhcp server. Could you check this one unix.stackexchange.com/questions/140387/…