Windows 8 and 8.1 Forums


Hyper-V Virtual Switch Manager

Page 1 of 2 12 LastLast
  1. #1
    Hyper-V Virtual Switch Manager

    Hyper-V Virtual Switch Manager
    How to Create and Use Hyper-V Virtual Switches
    Published by Kari is online now
    31 Jan 2013
    Default Hyper-V Virtual Switch Manager

    Hyper-V Virtual Switch 101: How to create and use Virtual Switches to connect Virtual Machines to Network

    information   Information
    I will try to make this tutorial as simple and easy to understand as possible. Therefore some examples used might seem to you fellow geeks too simple. However, I ask you to understand that my goal is to make this so easy every noob can start "switching" .

    Please response by providing your own tips, tricks, links and telling about your experiences.

    For beginners I recommend to start with Dwarf’s excellent and easy to understand tutorial Hyper-V - How to Use in Windows 8.



    Part 1: Understanding Virtual Switches

    To connect a virtual machine (hereafter vm) to network it needs a network controller (hereafter NIC) the same way as any physical computer would need. In Hyper-V virtualization this NIC is of course virtual, it does not exists physically.

    As we cannot connect a virtual NIC to a physical router we need a Virtual Switch (hereafter VS) to act like a network bridge between host NIC and vm virtual NIC. See the image below:

    Click image for larger version

    A Virtual Switch can be external, internal or private.
    • External Virtual Switch: will connect a vm to host NIC. If host NIC is connected to Internet through router, the vm is also connected to Internet. If host NIC (LAN) is not connected to router or if the router has no Internet access, the internal network will still work allowing computers (physical and vm) belonging to the same subnet and workgroup or domain to communicate with each other (file and media sharing etc.). When connecting external switch to host WLAN NIC, the vm loses all connectivity when WLAN is disabled or not connected on host.
    • Internal Virtual Switch: When a virtual NIC is connected to Internal VS it can communicate with other computers and vms on the same subnet but has no Internet access.
    • Private Virtual Switch: When a virtual NIC is connected to Private VS it can communicate with other vms on same Hyper-V server but cannot communicate with host PC nor has it Internet access. A Private vs is often needed when installing a legacy Linux or pre-XP Windows vm. After installation you need then to disable Private Switch and use Internal or External to connect to the network.


    Part 2. Create a Virtual Switch


    1. To create a VS open Hyper-V Virtual Switch Manager:
      .
      Name:  Virtual_Switch_10.png
Views: 51996
Size:  15.8 KB
      .
    2. Select New virtual network switch, select the switch type and click Create Virtual Switch:
      .
      Click image for larger version
      .
    3. Name the switch as you wish, select which of host NICs it will be connected to. Please check that the option Allow management operating system to share this network adapter is selected, otherwise you might lose all connectivity:
      .
      Click image for larger version
      .

    - What this means, to put it very simple, is that when sharing is not enabled the virtual machines using a non-shared external switch can communicate with each other and outside world, but they will not share the connection with host. In this case you need to use another NIC and connection to connect host to the Internet
    .
    - Notice that this is also a practical way to use two totally different Internet connections with two independent routers and subscriber lines thus getting two different public IPs. An external virtual switch in this case takes total control of NIC it is connected to leaving host without connection if it can not use another NIC
    .
    - Also important to notice that to get two separate public IPs the external switch must not be shared, and host needs to be connected not only with another NIC but with another router and subscriber line. If both NICS belong to the same subnet and are using the same router / line they always share the public IP
    .
    4. Before clicking OK to save new switch you just created check that you have no active network connections used to anything important at the moment, for instance unfinished downloads or backups to a network location; when you click Apply or OK the network connection of your host is disconnected shortly before a new connection is created.

    By default all virtual switches get the name vEthernet followed by the name you selected when you created it within parenthesis. Here's how system named for instance my external switch connected to LAN NIC on my host: vEthernet (AGMnet External LAN).

    Screenshot below shows typical available network connections when all types of virtual switches have been created:

    Click image for larger version
    (Physical host NICS highlighted with yellow, virtual switches with red.)

    Notice that external virtual switch connected to host WLAN (vEthernet (AGMnet External WLAN) in this example) is not connected, showing red X. This is because of the WLAN NIC of host is disconnected (greyed out in screenshot); a virtual machine using this virtual switch would have no connectivity at the moment.

    You might have also noticed that although the virtual switch vEthernet (AGMnet External WLAN) is connected to (is using) host’s WLAN NIC it is however showing an Ethernet LAN symbol (connector of a LAN cable) and presented under LAN connections. This has a simple explanation: all Hyper-V network connections are Ethernet (LAN) connections; Hyper-V does not support WiFi so even when a virtual switch is connected to a wireless NIC, Hyper-V presents it as Ethernet connection to the virtual machine i.e. the virtual NIC on vm “thinks” it is connected with an Ethernet cable.

    This also means that when we are using an external virtual switch connected to a WLAN NIC, we need an extra network bridge on the host. The virtual NIC connects to a virtual switch, virtual switch in its turn connects to a host network bridge which creates (as its name says) a bridge between our virtual Ethernet connection and host WLAN NIC’s connection to the router:

    Click image for larger version

    A "real life" situation from my computer. Virtual machine sees the connection as an Ethernet connection, connecting its Virtual NIC to External Virtual Switch, which in its turn is connected to a Network Bridge on host and further to WLAN NIC on host. Sounds complicated, is simple:

    Click image for larger version

    Don’t worry be happy
    , Hyper-V and your Windows 8 host are together taking care of creating bridges when needed. See the screenshot below, I have just enabled and connected my host’s WiFi NIC. When enabled it noticed that there’s a Hyper-V external virtual switch which wants to use it so it created a Network Bridge, which then told external virtual WLAN switch “it’s OK now, we are online” .

    Red X disappeared, a vm using this connection would be back in business:

    Click image for larger version


    Part 3: Connect a Virtual Machine to a Virtual Switch (vm with Windows Vista SP2 or later Windows OS )

    When creating a new vm select the correct virtual switch for your purposes. To connect vm to other computers and to Internet select an external switch which is connected to a host NIC currently enabled, connected, and online:

    Click image for larger version

    You can always change the virtual switch from vm Settings:

    Click image for larger version

    You are now ready to start networking!

    Part 4: Connect a Virtual Machine to a Virtual Switch (vm with pre Windows Vista SP2 or Linux / Unix OS )

    As you already know the expression “Not supported” does not always mean it wont work. Several Linux distros as well as early versions of Windows run very nicely on Hyper-V although officially it only supports XP and later Windows versions. Read for instance this tutorial to see how you can install Open SUSE or Ubuntu Linux on a Hyper-V vm: Hyper-V – Create Linux Virtual Machine in Windows 8.

    When creating a new vm for Linux or older Windows versions it is important to follow these steps in setting up network functionality:
    1. Select Not connected when creating vm:
      .
      Click image for larger version
      .
    2. Before booting vm first time go to Settings and delete (remove) default network driver:
      .
      Click image for larger version
      .
    3. Create a new virtual Legacy Network Adapter:
      .
      Click image for larger version
      .
    4. Create a Private Virtual Switch, attach it to newly created Legacy Network Adapter:
      .
      Click image for larger version
      .
    5. Boot and install OS
    6. When on desktop, shut down vm before starting any other apps or programs or changing vm settings
    7. When vm is shut down, go to virtual machine's Settings and connect the Legacy Network Adapter to an External Virtual Switch with network connectivity
    8. Boot the vm and you are ready to go online!



    A few more words

    After you have created an external virtual switch, your Windows host computer starts using it, too. No reason to change this, as long as your external virtual switch is online everything will be OK:

    Click image for larger version

    Remember, Hyper-V and windows are taking care of the bridges when needed. Host Network Bridge does exist only when host WLAN is enabled, and is appearing offline when WLAN is not connected:

    Click image for larger version

    If a vm cannot connect to network, check first that it is using a correct external virtual switch and that the said switch is connected to a NIC which is enabled and connected:

    Click image for larger version

    That's it. Please do tell if you find errors. All input is wanted and appreciated.


    Kari


    Published by


    Kari's Avatar
    Old geek, new tricks



    Join Date: Jul 2009
    Location: A Finnish ex-pat in Leipzig, Germany
    Posts: 1,038


    Tutorial Tools


  2. #1
    Brink's Avatar

    Administrator



    Join Date : Jul 2009
    Posts : 16,654
    64-bit Windows 8.1 Enterprise (RTM)
    USA us texas


    Great job Kari.
      My System SpecsSystem Spec

  3. #2
    Kari's Avatar

    Old geek, new tricks




    Join Date : Jul 2009
    A Finnish ex-pat in Leipzig, Germany
    Posts : 1,038
    Windows 8.1 Pro with Media Center
    Finland de saxony


    Thanks Shawn. Noticed yesterday evening several threads with Hyper-V virtual switch and / or connectivity issues, thought this could be useful.

    I was also thinking those members wanting to use Hyper-V to older Windows versions or Linux virtual machines, this tutorial tells how to make those communicate with outside world.

    Kari
    Last edited by Kari; 01 Feb 2013 at 04:15 AM.
      My System SpecsSystem Spec

  4. #3
    Dave76's Avatar

    Team Member




    Join Date : Oct 2009
    Tropical Island Pair a Dice
    Posts : 3,030
    Windows 8.1 Pro x64/ Windows 7 Ult x64


    Nicely done Kari.
      My System SpecsSystem Spec

  5. #4
    Kari's Avatar

    Old geek, new tricks




    Join Date : Jul 2009
    A Finnish ex-pat in Leipzig, Germany
    Posts : 1,038
    Windows 8.1 Pro with Media Center
    Finland de saxony


    Thanks Dave.
      My System SpecsSystem Spec

  6.   

  7. #5



    Member

    Join Date : Sep 2012
    Posts : 163
    eight


    hi i install windows xp in windows 6 hyper v.but do not know how can i transfer file from window 8 to xp?
      My System SpecsSystem Spec

  8. #6
    Kari's Avatar

    Old geek, new tricks




    Join Date : Jul 2009
    A Finnish ex-pat in Leipzig, Germany
    Posts : 1,038
    Windows 8.1 Pro with Media Center
    Finland de saxony


    Quote Originally Posted by muiacir View Post
    hi i install windows xp in windows 6 hyper v.but do not know how can i transfer file from window 8 to xp?
    What is Windows 6?

    Make a remote desktop connection to your XP virtual machine, then you can copy and paste as you wish, from and to remote XP machine.

    Kari
      My System SpecsSystem Spec

  9. #7



    Member

    Join Date : Sep 2012
    Posts : 163
    eight


    sorry i mean windows 8
    how can i exactlly create remote desktop in win xp?
    and how can i full screen that?i use full screnn but it is not full screen exactlly
      My System SpecsSystem Spec

  10. #8



    Member


    Join Date : Sep 2011
    Redmond
    Posts : 571
    Windows 8.1 x64
    USA us washington


    If your machines are all connected to the same network (using the external switch type), you can simply use a file share to copy files just as you would between two physical windows machines on the same network. Kari is correct though - you must use RDP (mstsc.exe) to connect to the virtual machine, and not the hyper-v connection manager (vmconnect.exe) if you want to copy/paste files directly to the virtual machine that way.
      My System SpecsSystem Spec

  11. #9
    Kari's Avatar

    Old geek, new tricks




    Join Date : Jul 2009
    A Finnish ex-pat in Leipzig, Germany
    Posts : 1,038
    Windows 8.1 Pro with Media Center
    Finland de saxony


    Cluberti is of course right, you can share files exactly as if the virtual machine were a normal physical computer in your network.

    Follow instructions on this tutorial to allow remote connections to your virtual machine: Remote Desktop Connection (RDC) - Network - Windows 7 Help Forums

    Open Run dialog (Win + R), start Remote Desktop Connection by typing or copy / pasting this to Run dialog and pressing Enter: %windir%\system32\mstsc.exe

    Click Show Options button bottom left on Remote Desktop window, select Display tab, set the display size to full screen.

    Now connect to your virtual machine and it will open on full screen.

    Kari
      My System SpecsSystem Spec

Page 1 of 2 12 LastLast
Hyper-V Virtual Switch Manager
Similar Threads
Tutorial Forum
Hyper-V – Create Linux Virtual Machine in Windows 8 Tutorials
hyper-v - error in creating external virtual switch Virtualization
Weird Hyper-V virtual switch behavior Virtualization
Hyper-V Error Adding Virtual Switch - Ethernet Port Bind Failed Virtualization
Run Win8 Hyper-V image on Win7 Virtual PC Virtualization

Eight Forums Android App Eight Forums IOS App Follow us on Facebook