none
Why DHCP client did not work on Child VM in HyperV 2008

    Question

  • I've a dhcp server from ISP that is a modem.
    I've a server running in virtual machine, and i want to pick up the IP address from DHCP to this virtual machine.
    Unfortunately, this don't work.

    But, to the parent server the network card could pick up the IP address.
    Why this don't work on Child Virtual machines??

    on the parent server, i'm running Windows Server 2008 R2 SP1, and i'm running the virtual machines with HyperV.

    Let me know.
    Regards!

    Lasandro Lopez

    Tuesday, August 20, 2013 2:50 PM

Answers

  • You can create a virtual switch on the network that is connected to the ISP link providing DHCP.  Configure that virtual switch so that it is available to the host operating environment.  This will create a virtual NIC for the parent partition that will be able to accept the DHCP from the ISP's DHCP router.  Within the virtual machine, create a virtual NIC on the same virtual switch.  It should also get DHCP configuration.

    If you create a virtual switch on the second NIC of the host, and that NIC is not connected to the ISP DHCP, there is no way for a VM to communicate for DHCP configuration.


    .:|:.:|:. tim

    Tuesday, August 20, 2013 11:24 PM
  • Hi,

    If you want to get the public IP through your child vm, you must create a virtual switch bind to the physical NIC interface then connect the child vm vNIC to that virtual switch. You should not disable the physical interface which connect to the ISP link.

    Thanks.


    Alex Lv

    Friday, August 23, 2013 8:29 AM
    Moderator
  • It would help to give a little clearer explanation of your configuration.  If you are running a single VM, there is no obvious reason for 2 NICs.  On the NIC that is connected to your ISP, create a virtual switch and allow the host to have access to it.  The host will be given a new virtual NIC that is configured for DHCP, so it should just pick up the DHCP information from your ISP-provided link.

    In the VM settings, create a NIC on the virtual switch.  That NIC is automatically configured for DHCP, so it should pick up its configuration from your ISP provided link.  If it is not, we will need to know more specifics about your particular configuration.  If you are just trying to get it set up to see how it works, adding a second NIC to the equation just makes for more complexity.  If the second NIC is not plugged into any other port, it does not make any difference.


    .:|:.:|:. tim

    Friday, August 23, 2013 11:31 PM

All replies

  • did you create a virtual switch in HyperV, assign the network card that is plugged into your Cable modem, this would have to be a second network card, you should then have two virtual switches a LAN and a WAN you can and should disable the virtual network card on the Hyper V host for the WAN, then any VM's you want to use a WAN connection just define a network card for the WAN Switch. The hyperV host will not take a ip address from ISP and VM's will as long as they hand out enough ip addresses, if they limit ip addresses to one you may need to change the MAC address on the VM to whatever the MAC address was no the physical network card. 
    Tuesday, August 20, 2013 4:01 PM
  • Yes, i've created the virtual switch on the second NIC of the physical server.
    you mean, after that, to disable the NIC card on physical server that connect to ISP Cable Modem (right click to it and Disable)?

    Lasandro Lopez

    Tuesday, August 20, 2013 8:04 PM
  • You can create a virtual switch on the network that is connected to the ISP link providing DHCP.  Configure that virtual switch so that it is available to the host operating environment.  This will create a virtual NIC for the parent partition that will be able to accept the DHCP from the ISP's DHCP router.  Within the virtual machine, create a virtual NIC on the same virtual switch.  It should also get DHCP configuration.

    If you create a virtual switch on the second NIC of the host, and that NIC is not connected to the ISP DHCP, there is no way for a VM to communicate for DHCP configuration.


    .:|:.:|:. tim

    Tuesday, August 20, 2013 11:24 PM
  • But previously you suggest to disable it, right?
    I'm clear what to disable.
    On the second physical NIC on the Parent server, i've created a virtual network as in picture

    I've unchecked "Allow management...."

    So on the parent server, i've to disable this second NIC?


    Lasandro Lopez

    Wednesday, August 21, 2013 7:32 AM
  • Hi,

    If you want to get the public IP through your child vm, you must create a virtual switch bind to the physical NIC interface then connect the child vm vNIC to that virtual switch. You should not disable the physical interface which connect to the ISP link.

    Thanks.


    Alex Lv

    Friday, August 23, 2013 8:29 AM
    Moderator
  • Hi Alex.
    I've tried what you suggest, but child vm did not pick up ip address.

    Only the Parent/Physical server pickup ip address.


    Lasandro Lopez

    Friday, August 23, 2013 8:44 AM
  • It would help to give a little clearer explanation of your configuration.  If you are running a single VM, there is no obvious reason for 2 NICs.  On the NIC that is connected to your ISP, create a virtual switch and allow the host to have access to it.  The host will be given a new virtual NIC that is configured for DHCP, so it should just pick up the DHCP information from your ISP-provided link.

    In the VM settings, create a NIC on the virtual switch.  That NIC is automatically configured for DHCP, so it should pick up its configuration from your ISP provided link.  If it is not, we will need to know more specifics about your particular configuration.  If you are just trying to get it set up to see how it works, adding a second NIC to the equation just makes for more complexity.  If the second NIC is not plugged into any other port, it does not make any difference.


    .:|:.:|:. tim

    Friday, August 23, 2013 11:31 PM