Jump to content


anyweb

How can you share your hyper-v lab network with physical devices ?

Recommended Posts

Introduction

I occasionally want to connect real physical computers directly within one of my hyper-v based virtual labs  to test various functionality within that lab which may require real hardware. A good example of that is testing MBAM Bitlocker management via Microsoft Endpoint Configuration Manager version 1910. This post will show you one way of connecting physical hardware to your internal hyper-v lab easily.

Note: There are other ways of doing this, but this is really easy and quick and I thought i'd share it with you.

Requirements

To get the job done, you'll need some equipment, here's a small list.

  • A hyperv host
  • A working lab
  • A physical computer to connect to your lab
  • 2 USB network cards
  • 1 network cable
  • Optional: a DHCP scope inside your lab to share IP addresses to the real physical computer
  • Optional: a Switch or hub if you want to connect more than one physical device

Step 1. Connect the physical computer to the hyper-v host

Here, I simply connect the network cable above to the 2 USB network cards, and plug one USB nic into the physical computers' USB port, and the other USB Nic into a free USB port on the Hyper-v host. the hyper-v host in this photo is the amazing Lenovo P1 laptop on the left of the picture, the 'physical computer' is the old Surface Pro computer.

image.png

Step 2. Identify your labs virtual switch

In Hyper-v, locate the lab you want to use. In the screenshot below, I'm going to use lab #11 for this as it's my main Microsoft Endpoint Configuration Manager (Current Branch) lab for testing MBAM functionality.

image.png

In the right pane of the Hyper-v management console, click on Virtual Switch Manager to see your configured switches. Here you can see the virtual switch which I'm using for the #11 lab, it's called #11 and it's a private network.

image.png

Note: If the USB nic used for this external access is already in use on your hyper-v host on another network switch, such as mine is, on the External Honeypot, you should first remove it from that network switch before trying to assign it to another network switch.

Step 3. Change the network connection type

Now that you've identified the target network switch, you can now switch the network connection type temporarily for the period of your test. I like to keep my labs on a private network unless otherwise called for, such as for this test.

Set the connection type to External Network and next, select the USB nic from the list of available network cards, that is physically connected to your hyper-v host.

image.png

Once done, de-select the option to Allow management operating system to share this network adapter.

image.png

Click Apply when done.

Step 4. Utilize the lab network on a physical computer

Now that you've connected a physical computer to the internal hyper-v host lab, you can do whatever testing you hoped to carry out. In the below screenshot I have used RDP to connect to the physical computer from inside of the #11 lab and from there I can now join it to the internal lab domain for further testing. I could of course re-image the device but as it's a shared device (aka the kids) I won't be doing that this time.

image.png

and after the reboot you can login as a user that has Remote Desktop access and do whatever testing you wanted to carry out on real physical hardware.

image.png

Install the ConfigMgr client...

image.png

 

image.png

Step 5. Once done testing, set your lab back to Private Network

Now that you are done testing, don't forget to set your labs network connection back to Private Network. This will avoid problems with networks getting crossed or devices talking to each other that shouldn't be.

image.png

And don't forget to click Apply

that's it, until next time,

cheers

niall.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.