But it works on my PC!

The random thoughts of Richard Fennell on technology and software development

DHCP does not seem to work on Ubuntu for wireless based Hyper-V virtual switches

If running an Ubuntu guest VM on Windows 8 Hyper-V you have a problem if you want to make use of a wireless network on the host machine. DHCP does not seem to work.

Firstly you have to create a virtual switch in Hyper-V

image

and connect it to your wireless card

image

you can then connect a Network Adaptor on the Ubuntu guest VM to the new switch.

image

Now for most operating systems this is all you need to do. The guest VM would use DHCP to pickup an IP address and all is good. However on Ubuntu 12.04 (and other versions judging from other posts), if you are using a virtual switch connected to a wireless card, DHCP does not work. The problem appears to lie in the way Windows/Hyper-V does the bridging to the Wifi.

You have manually set the networking settings. You need to track down the correct network using the MAC address. Remember that as the system is having network problems you might need to enable the connection (with the slider top right of the dialog if using the UI) before you can set the options

image

Once this is all set you should have a working network.

Now some posts suggest that you can avoid this problem if you use a ‘legacy network adaptor’ when you create the VM in Hyper-V, but this did not work for me. In fact even manually setting the IP address did not help on the legacy adaptor.

Comments (5) -

  • Todd

    7/15/2013 5:38:55 AM |

    I'm on the last step here [Marked by the last picture inlaid in your post]. However, I'm not sure what you mean by needing to "manually set the network settings."

    How do I complete this step?

    Thanks!

  • richard

    7/15/2013 7:28:09 PM |

    When I say manually set the IP address I had assumed reader would know a bit about configuring IP addresses, hence my brevity

    You press the option button on the bottom right of the dialog in the graphic . This shows the configuration screen. You need to set the IP address, gateway and DNS IP addresses on the IPV4 tab. You do need a bit of IP knowledge to work out what these should be from your local router.

    Hope that helps

  • Todd

    7/16/2013 11:24:43 PM |

    Richard,

    Thanks for the help. I ran ipconfig /all to find all the info I needed to put in manually. Now it works.

    -Todd

  • Todd

    7/17/2013 8:08:11 PM |

    Richard,

    I spoke too soon. While the icon in the top right corner shows that I'm connected, I cannot access and webpages. I think this is because I did not put in the correct addresses. If it's not too much of a bother for you, can you tell me where to find the correct addressing information?

    Thanks,

    Todd

  • richard

    7/17/2013 8:19:00 PM |

    Sounds like you have the wrong DNS setting so it cannot resolve web addresses.

    For my home router I need to enter the DNS as the local router, same as my default gateway, but your router might be different, some don't provide a local DHS

    I would suggest checking on a working PC/VM and use nslookup to see what DNS server is used

Pingbacks and trackbacks (1)+

Comments are closed