none
Hyper-V on VPS with one NIC - Help with setup due to nothing working RRS feed

  • Question

  • Hello, This might seem like a noob-ish question to many of you but here goes anyway.

    Over the past week i have been trying to setup hyper-v on my VPS. It has one Static IP and one NIC.

    I seem to be unable to actually link the internet connection from my NIC to my VM environment.

    Is someone able to shed some light onto this for me as i have exhausted all ideas and every link on google now.

    EDIT: Further information that might help you help me: 
    I have tried sharing the internet connection from my NIC to an internal switch, Sharing via Hyper-V to a physical adaptor. So i have tried an internal and physical/external adaptor.

    I am on windows server 2016

    Kind regards

    Titch


    • Edited by Titch2000 Wednesday, June 5, 2019 12:18 PM
    Wednesday, June 5, 2019 12:15 PM

Answers

  • Hi Leslie,
    Yes my host has internet connectivity.
    I was trying to run Ubuntu Server in the VM. The host is windows server 2016.
    Unfortunately your idea / advice caused an IP conflict and did not work.

    Dave, Your idea unfortunately would only be a last resort as there are many systems setup on this windows install already. However your post did raise an idea for me. So what i did was to see if i could setup this "default switch" but in windows server.

    This has now worked using the advice from here: petri.com/create-nat-rules-hyper-v-nat-virtual-switch

    And i then followed the commands from the two links at the top of the post based on what i needed. If anyone else is trying to do what i was and hit issues with it then that link worked well for me to solve it.

    I now have internet inside my Guest VM environment (On windows VM & Ubuntu VM)

    • Marked as answer by Titch2000 Tuesday, June 11, 2019 9:58 AM
    Monday, June 10, 2019 5:55 PM

All replies

  • Hi,

    Have you checked the following check boxes on your VPS's network adapter settings?

    • Allow other network users to connect through this computer's Internet connection

    What is the IP configuration of your VPS and your virtual machine?

    Best regards,
    Leon


    Blog: https://thesystemcenterblog.com LinkedIn:

    Wednesday, June 5, 2019 12:31 PM
  • Hello, Yes i have made sure the check box was checked, unfortunately no luck.

    My ip setup for the virtual network can be anything i do not mind as long as it works. The physical NIC that i have is running a static IP address with no chance of DHCP for the VM's so a DHCP server was installed on the host to handle this though static for internal would be fine too.
    Wednesday, June 5, 2019 5:06 PM
  • Assign your Hyper-V Virtual Ethernet Adapter a static IP address and a subnet mask.

    Then on your Hyper-V virtual machine, assign a static IP address and use the same subnet as you have in your Hyper-V Virtual Ethernet Adapter.

    You can also use a virtual switch with External network and check the "Allow management operating system to share this network adapter" (Guide)


    Blog: https://thesystemcenterblog.com LinkedIn:

    Wednesday, June 5, 2019 8:41 PM
  • Thank you for your reply. I have just tried this using the ip 95.217.32.211 (Created for the purposes of this message) which is the hosts static, 95.217.32.212, as the virtual Ethernet which is shared to from physical Ethernet and then 95.217.32.213 set for the virtual Ethernet inside the guest / virtual machine.

    I can ping the virtual adaptor IP set in windows but i cannot ping the physical adaptor from the guest.

    Any ideas?
    • Edited by Titch2000 Wednesday, June 5, 2019 10:09 PM
    Wednesday, June 5, 2019 10:05 PM
  • Try setting the IP address of your Virtual Ethernet Adapter as the gateway in your virtual machine.

    Try enabling/disabling the virtual machine's network adapter afterwards and then try.

    Also do you have any firewalls enabled?


    Blog: https://thesystemcenterblog.com LinkedIn:

    Wednesday, June 5, 2019 10:24 PM
  • Since a single network adapter you'll need to create an external vSwitch with checkbox checked for Allow management operating system to share this network adapter

    What is this host plugged into? Assuming a NAT internet router, you should be using an address in the same subnet range the router uses (likely 192.168.0.xxx or similar) Assign an address on same subnet, use router ip address as gateway and ISPs or any public DNS such as 8.8.8.8 on the host vEthernet adapter.

    For the guest same thing use an address in the same subnet range the router uses (likely 192.168.0.xxx or similar) Assign an address on same subnet, use router ip address as gateway and ISPs or any public DNS such as 8.8.8.8 on the host VMs vEthernet adapter.

    Sorry, missed the vps. If only a single adapter on host your options are limited.

    • Try working with ICS
    • or installing RRAS role (not really recommended but out of options)
    • Scrap Server 2016 on host and install Windows 10 and make use of default switch.



     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Wednesday, June 5, 2019 10:34 PM
  • Just tried that, along with a VM restart too to help flush anything lingering around in the settings, if it helps the VM is running Ubuntu. Yes there is the standard windows firewall running on the host and then what ever is set with default Ubuntu installation, this is a freshly installed VM so no settings that could have been accidentally set. Still no internet connection or ability to ping host physical Ethernet adaptor (From guest). The issue seems to be somewhere between the virtual and physical adaptors.


    • Edited by Titch2000 Wednesday, June 5, 2019 10:39 PM
    Wednesday, June 5, 2019 10:38 PM
  • Hello, Sorry for delay in response. I have now tried both of these links provided, the askubuntu one resulted in no internet on my device at all due to it removing the IP on my physical NIC so this had to be removed and set back up. So unfortunately neither of these have worked. I have also installed windows on a VM now just in case it is a linux issue so we are dealing with just windows for host and guest now.
    Thursday, June 6, 2019 9:38 PM
  • due to it removing the IP on my physical NIC so this had to be removed and set back up. 

    This is expected behavior. When you create an external vSwitch the internet protocols are removed from the physical interface and the Hyper-V extensible virtual switch protocols are added. A new vEthernet is also added to host (assuming you chose "allow management operating system to share") you can then setup the vEthernet in the same manner as if it were a physical network adapter connected to the new vSwitch.

    So you may want to delete / recreate the external vSwitch again and assign the host an address on the vEthernet

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.



    Thursday, June 6, 2019 9:52 PM
  • Thank you for your reply Dave. I have now tried this and the VM reports that it has no IP address.
    Assigning an ip address manually to it be it the same as the host, a 192.168.X.X ip or a second IP that i own for my VPS, the result is the same. Still no network connectivity. This was tested in the Windows 10 guest VM.
    Friday, June 7, 2019 10:02 AM
  • Thank you for your reply Dave. I have now tried this and the VM reports that it has no IP address.
    Assigning an ip address manually to it be it the same as the host, a 192.168.X.X ip or a second IP that i own for my VPS, the result is the same. Still no network connectivity. This was tested in the Windows 10 guest VM.

    Please post an unedited ipconfig /all of problem one and a working one on same network.

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Friday, June 7, 2019 12:03 PM
  • Unfortunately this forum wont let me upload images, as soon as i can do that i will happily post the requested information.
    Saturday, June 8, 2019 10:32 AM
  • Unfortunately this forum wont let me upload images, as soon as i can do that i will happily post the requested information.
    • ipconfig /all > C:\problem1.txt
    • ipconfig /all > C:\problem2.txt
    • etc.You can put text files up on OneDrive and share the text of link here (no images please).

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.


    Saturday, June 8, 2019 12:15 PM
  • Okay, So i took your advice but instead uploaded screenshots to onedrive.
    Here is the Guest: universityoflincoln-my.sharepoint.com/:i:/g/personal/16610086_students_lincoln_ac_uk/Ef4vtqutlupBjL05ryInyXwBfuB_BJBio1LksNtbw6ryyg?e=ynnDK4
    And Host: universityoflincoln-my.sharepoint.com/:i:/g/personal/16610086_students_lincoln_ac_uk/ETO0_AL4dHZOnqa-Hq_PgToB8pXFv_t-Awedq5ESAGN5kA?e=GwvznZ
    Saturday, June 8, 2019 6:17 PM
  • Okay, So i took your advice but instead uploaded screenshots to onedrive.
    Here is the Guest: universityoflincoln-my.sharepoint.com/:i:/g/personal/16610086_students_lincoln_ac_uk/Ef4vtqutlupBjL05ryInyXwBfuB_BJBio1LksNtbw6ryyg?e=ynnDK4
    And Host: universityoflincoln-my.sharepoint.com/:i:/g/personal/16610086_students_lincoln_ac_uk/ETO0_AL4dHZOnqa-Hq_PgToB8pXFv_t-Awedq5ESAGN5kA?e=GwvznZ

    Ok, I'm not sure what problem you're trying to troubleshoot. For the host also try;

    tracert 8.8.8.8

    to test internet connectivity.

    for the guest there is no default gateway hence nowhere to route traffic. For the guest internet connectivity since you only have a single adapter on host, your options are limited.

    • Try working with ICS
    • or installing RRAS role on host (not really recommended but out of options)
    • instead of Server 2016 on host install Windows 10 and make use of default switch (similar to ICS).

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Saturday, June 8, 2019 6:34 PM
  • Apologies i was away over the weekend. Okay so, I had tried using RRAS and ICS previously with no luck but will happily try again with your guidance if you will hopefully work.

    For ICS will it be: 
    Create Internal Adaptor on host within hyper-v, Then go to networks and share the hosts connection using ICS. 
    This will then result in the guest and host not having an internet connection so re-enable the IPv4 on hosts adapter and redefine the connection settings. 
    Where would i go from here as the virtual adaptor will not get connectivity still so i feel i am missing something.
    Monday, June 10, 2019 10:13 AM
  • Hi,

    Question:  Does the host have Internet access?

    What version Ubuntu are you using - desktop/server?

    Your host is on a public network, and your guest VM is on a private network.  The VM will thus have no internet access unless their is a natting router.

    As your setup does not mention this, you need to set the guest vm with a public IP address.

    Connect your guest Eth to your External switch.

    and then try creating your ubuntu guest as follows:

    Static IP: (obviously if it does not conflict) 95.216.35.232

    Subnet mask 255.255.255.192 (or /26)

    Default Gateway: 95.216.35.193

    Regards,

    Leslie



    Monday, June 10, 2019 11:00 AM
  • Where would i go from here 

    Might want to try installing windows 10, add hyper-v role and try using the default switch.

    The switch named “Default Switch” allows virtual machines to share the host’s network connection using NAT (Network Address Translation).

    https://docs.microsoft.com/en-us/virtualization/community/team-blog/2017/20171113-what-s-new-in-hyper-v-for-windows-10-fall-creators-update

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Monday, June 10, 2019 12:35 PM
  • Hi Leslie,
    Yes my host has internet connectivity.
    I was trying to run Ubuntu Server in the VM. The host is windows server 2016.
    Unfortunately your idea / advice caused an IP conflict and did not work.

    Dave, Your idea unfortunately would only be a last resort as there are many systems setup on this windows install already. However your post did raise an idea for me. So what i did was to see if i could setup this "default switch" but in windows server.

    This has now worked using the advice from here: petri.com/create-nat-rules-hyper-v-nat-virtual-switch

    And i then followed the commands from the two links at the top of the post based on what i needed. If anyone else is trying to do what i was and hit issues with it then that link worked well for me to solve it.

    I now have internet inside my Guest VM environment (On windows VM & Ubuntu VM)

    • Marked as answer by Titch2000 Tuesday, June 11, 2019 9:58 AM
    Monday, June 10, 2019 5:55 PM
  • Glad to hear you solved it!

    (Please don't forget to vote as helpful and mark as answer the replies that helped)


    Blog: https://thesystemcenterblog.com LinkedIn:

    Monday, June 10, 2019 6:30 PM
  • Hi,

    You can use any IP address for the Ubuntu server that is not is use from your current public range.

    I.E. You can choose a IP that is not used from your range - 95.216.35.193 - 95.216.35.254

    Regards,

    Leslie

    Tuesday, June 11, 2019 12:58 PM
  • Interesting article - now I have also learnt something new :)
    Tuesday, June 11, 2019 1:01 PM
  • I'm glad you did, it was an adventure for me too. Thanks everyone!
    Thursday, June 13, 2019 10:02 PM