Book Image

Learning Hyper-V

Book Image

Learning Hyper-V

Overview of this book

Table of Contents (19 chapters)
Learning Hyper-V
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Connecting a VM to a Virtual Switch


Now that the Virtual Switch is created, we can connect the VM to it so that the VM can communicate with other VMs and with the network. The easiest and most common way to connect a VM to the Virtual Switch is when you're creating a new VM. The process of creating a new VM will be detailed in Chapter 6, Virtual Machines and Virtual Machine Templates, so for now, keep in mind that a part of the process of creating a new VM includes the connection to a Virtual Switch. If you're creating a new VM through the GUI, you can either specify to connect the virtual network of the VM to a Virtual Switch or keep the VM not connected to a Virtual Switch.

If the VM is already created, you'll have to open the VM Settings... on Hyper-V Manager, select the Network Adapter you want to configure, and choose the Virtual switch that the virtual network should be connected to, as shown in the following screenshot:

In PowerShell, you can use the following cmdlet to create a VM...