How To Setup and Use Hyper

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 153

How to Setup and Use Hyper-V in Windows 10

for OS Virtualization
Table of contents:
1 INTRODUCTION.................................................................................................................................. 3
2 SOME VOCABULARY........................................................................................................................... 4
3 HOW TO ENABLE AND SET UP HYPER-V VIRTUALIZATION....................................................................5
4 HOW TO CREATE AND USE VIRTUAL SWITCHES TO CONNECT VIRTUAL MACHINES TO NETWORK......10
4.1 UNDERSTANDING VIRTUAL SWITCHES..........................................................................................................10
4.2 CREATE A VIRTUAL SWITCH.......................................................................................................................11
4.3 CONNECT A VIRTUAL MACHINE TO A VIRTUAL SWITCH (WINDOWS VISTA SP2 AND LATER).................................18
4.4 CONNECT A VIRTUAL MACHINE TO A VIRTUAL SWITCH (PRE WINDOWS VISTA SP2 OR LINUX)..............................19
5 CREATE A VIRTUAL MACHINE............................................................................................................ 24
5.1 CREATE A WINDOWS VIRTUAL MACHINE (WINDOWS 7 OR LATER)....................................................................24
5.2 CREATE A LEGACY WINDOWS VIRTUAL MACHINE (WINDOWS VISTA OR EARLIER).................................................31
5.3 CREATE A LINUX VIRTUAL MACHINE.............................................................................................................36
5.4 INSTALL OPENSUSE 12.1 GUEST ON HYPER-V.............................................................................................37
5.4.1.1 CREATE A VIRTUAL PRIVATE NETWORK SWITCH...................................................................................37
5.4.2 Install Ubuntu 11.10 guest on Hyper-V......................................................................................50
5.5 HOW TO CREATE AND USE HYPER-V CHECKPOINTS IN WINDOWS 10...............................................................64
5.5.1 Create a Checkpoint...................................................................................................................65
5.5.2 Apply (restore) a checkpoint......................................................................................................69
5.5.3 Checkpoint settings....................................................................................................................71
5.6 HOW TO ADD OR REMOVE A PHYSICAL HARD DISK FOR HYPER-V VIRTUAL MACHINE..........................................73
5.6.1 To Add Physical Hard Disk to Hyper-V Virtual Machine............................................................74
5.6.2 To Remove Physical Hard Disk from Hyper-V Virtual Machine.................................................79
5.7 HOW TO SEE IF HYPER-V VIRTUAL MACHINE IS GENERATION 1 OR GENERATION 2.............................................85
5.7.1 To See Generation of Hyper-V Virtual Machine in Hyper-V Manager.......................................86
5.7.2 To See Generation of All Hyper-V Virtual Machines in PowerShell...........................................88
5.8 HOW TO CREATE A HYPER-V MANAGER SHORTCUT IN WINDOWS 10...............................................................89
5.8.1 To Download a Hyper-V Manager Shortcut...............................................................................91
5.8.2 To Manually Create a Hyper-V Manager Shortcut....................................................................91
5.9 HOW TO CREATE SHORTCUT OF HYPER-V VIRTUAL MACHINE IN WINDOWS 8 AND 10........................................95
5.9.1 Create the Shortcut....................................................................................................................96
5.9.2 Elevate the Shortcut...................................................................................................................99
5.10 HOW TO CREATE A HYPER-V VIRTUAL MACHINE CONNECTION SHORTCUT IN WINDOWS 10..........................103
5.10.1 To Download a Hyper-V Virtual Machine Connection Shortcut..............................................104
5.10.2 To Manually Create a Hyper-V Virtual Machine Connection Shortcut....................................105
5.11 HOW TO IMPORT HYPER-V VIRTUAL MACHINES....................................................................................108
5.11.1 To Import Hyper-V Virtual Machine using Hyper-V Manager.................................................109
5.11.2 To Import Hyper-V Virtual Machine using PowerShell............................................................117
5.12 HOW TO EXPORT HYPER-V VIRTUAL MACHINES IN WINDOWS 10............................................................121
5.12.1 To Export Hyper-V Virtual Machine(s) using Hyper-V Manager..............................................122
5.12.2 To Export All Hyper-V Virtual Machines using PowerShell......................................................125
5.12.3 To Export a Single Hyper-V Virtual Machine using PowerShell...............................................125
5.13 HOW TO CREATE A HYPER-V "REMOTE FILE BROWSER" SHORTCUT IN WINDOWS 8 AND 8.1........................128
5.13.1 To Download a "Hyper-V Remote File Browser" Shortcut.......................................................129
5.13.2 To Manually Create a "Hyper-V Remote File Browser" Shortcut.............................................130
5.14 MIGRATING YOUR VIRTUAL MACHINES TO WINDOWS SERVER 2012 R2 HYPER-V......................................134
5.14.1 Enabling Live Migration and Migrating VMs using PowerShell..............................................139
5.14.2 Configure Constrained Delegation to Authenticate Live Migrations.......................................140
1 Introduction
   Information
Windows 10 Pro, Education and Enterprise editions come with a built-in
hypervisor client Hyper-V allowing users to create and run other operating
systems on a virtual machine. Although Hyper-V is mainly designed to run
Windows guests it can also be used to virtually install other operating systems
like various Linux versions.
In this tutorial we will enable and setup Hyper-V, create virtual switches to
allow our virtual machines to communicate with network and Internet, and
finally create some sample virtual machines.
Although starting from the basics this tutorial might give some tips to the more
advanced users, too.

   Note
Please notice:
Hyper-V is only available in Windows 10 Pro, Education, and
Enterprise editions.  It is not available in Windows 10 Home.
2 Some vocabulary
A short list of some terms worth to know.
Hypervisor
Hypervisor or virtual machine monitor (VMM) is a piece of computer software,
firmware or hardware that creates and runs virtual machines (Wikipedia)
Hyper-V
Hyper-V is a native hypervisor; it can create virtual machines on x86-64
systems. Starting with Windows 8, Hyper-V supersedes Windows Virtual PC as
the hardware virtualization component of the client editions of Windows
(Wikipedia)
Virtual Machine (vm)
A virtual machine (VM) is an emulation of a particular computer system. Virtual
machines operate based on the computer architecture and functions of a real
or hypothetical computer, and their implementations may involve specialized
hardware, software, or a combination of both (Wikipedia)
Host or Host System, Host OS
Host is the computer and operating system running the virtualization platform
(in this case Hyper-V in Windows 10 host) to host your virtual machines
(guests)
Guest or Guest System, Guest VM
A virtual machine, a guest operating system installed on a vm and stored on a
Virtual Hard Disk (vhd)
Virtual Hard Disk (vhd)
A vhd file emulates a physical hard disk. It can contain a full operating system
on a virtual machine, or it can be used to store files as any physical hard disk
Virtual Switch
A virtual switch emulates a physical network adapter. A Hyper-V vm cannot
directly connect and use the network adapters on your host, it needs a virtual
switch in between. The vm sees and treats the virtual switch as a network
adapter and uses it to communicate with the physical host network adapter,
which then forwards all communications further to network
3 How to enable and set up Hyper-V virtualization
By default the Hyper-V is disabled. To start we need to enable it as follows:

 Press WIN + X to open Start context menu, select Programs and


Features:

 Click Turn Windows features on or off:


 Select Hyper-V, click OK:

 Windows will now install the required components. You have to reboot
to let Windows finalize the installation:
After the reboot launch Hyper-V Manager:

 Press WIN + S and type Hyper-V to Start Menu search, click Hyper-V


Manager:
   Tip
If you get an error message about Hypervisor not running, open an elevated
Command Prompt by pressing WIN + X and selecting Command Prompt
(Admin) and give the following command:

bcdedit /set hypervisorlaunchtype auto

Reboot the host PC.


Hyper-V should now be able to run.

 Hyper-V should automatically connect to your host (left pane) and show
the menu on right pane:
 If the left pane shows no Hyper-V servers to connect (your local host
computer), click Connect to server on the right pane, select Local
computer in the dialog that follows and click OK:
 If you want to change the location where your virtual machines will be
saved, click Hyper-V Settings and change the location:
4 How to create and use Virtual Switches to connect
Virtual Machines to Network
   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.

4.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.
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 if host Ethernet or WLAN connection is not
shared with it.
 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.

4.2 Create a Virtual Switch


To create a Virtual switch:

 Open Hyper-V Virtual Switch Manager:

 Select New virtual network switch, select the switch type and


click Create Virtual Switch:
.

 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:

What this means?

 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
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. Hyper-V will now create the switch.

Notice that for a VM to be able to communicate with network, it has to use a


virtual switch which in its turn must be connected to a working host network
adapter connected to network. In this example I assigned the host WiFi
adapter to the new external virtual switch. If the WiFi adapter on host is
disabled or not connected to network when the VM using this switch is
launched, the VM cannot connect to the network.
You can have a virtual switch connected to each of host's network adapters,
typically one connected to a LAN adapter and another connected to a WLAN
adapter. A host network adapter can only be connected to one virtual switch
at any given time.
Looking at your network adapters now you can see that virtual switches are
working, and that the host WiFi adapter is bridged to a virtual switch (subject
to a virtual switch with WiFi adapter assigned to it exists):
   Note
When Hyper-V is enabled and one or more external virtual switches created,
your host system uses these switches instead of host physical network
adapters to connect to the network. This is as it should be, do not remove or
disable the virtual switches!

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:
(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 N NIC’s connection to the router:
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:

Hyper-V and your Windows 10 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 business
connection would be back in
4.3 Connect a Virtual Machine to a Virtual Switch (Windows
Vista SP2 and later)

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:

You can always change the virtual switch from vm Settings:


You are now ready to start networking!

4.4 Connect a Virtual Machine to a Virtual Switch (pre


Windows Vista SP2 or Linux)
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.
When creating a new vm for Linux or older Windows versions it is important to
follow these steps in setting up network functionality:

 Select Not connected when creating vm:


 Before booting VM first time go to Settings and delete (remove) default
network driver:

 Create a new virtual Legacy Network Adapter:


 Create a Private Virtual Switch, attach it to newly created Legacy
Network Adapter:
.
 Boot and install OS
When on desktop, shut down VM before starting any other apps or
programs or changing VM settings
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
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:
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:
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:
5 Create a virtual machine
5.1 Create a Windows virtual machine (Windows 7 or later)

To install a Windows operating system to a new virtual machine do:

1. Click New > Virtual Machine on the right pane (Action):

2. Click Next:
3. Name your VM as you wish, click Next (if you want to save the VM in
other than default location, select Store the virtual machine in a different
location):
 Select the VM generation. Generation 2 (GPT / UEFI) can only be used
for 64 bit Windows 8 or later respective Windows Server 2012 or later
guest operating systems. For all other guest systems use Generation 1 
(MBR / BIOS). Click Next:

4. Assign RAM to vm, select Use Dynamic Memory for this virtual machine,
click Next:
The RAM assigned to a vm is taken from your host RAM; if you assign 1 GB
to a vm, when it's run your host is missing this 1 GB. I recommend you try
first following values if your host has 4 GB RAM or less:

Host 2GB RAM > assign max 512 MB


Host 2 to 4 GB RAM > assign max 1 GB

Selecting the Dynamic memory lets Hyper-V to be flexible, use only the
amount of RAM needed at any given moment. In Windows virtual
machines, Hyper-V uses the amount you gave it at startup of the vm but
then when it's not needed, it releases some of it back to host, getting
again more when it needs it.

5. Select an existing virtual switch to allow the vm to connect to network.


Click Next to continue:
6. Select how big the virtual hard disk can be. For Windows guests, 20 GB is
enough if you just want to test an OS and will not install any apps, but the
more you give to vhd, the more you can install apps and store files on it.
Click Next to continue:
Notice that by default Hyper-V uses a dynamically expanding vhd; even if
you create a 500 GB vhd for your vm, if only 25 GB is used after you have
installed an OS and some apps, the vhd file size on your host hard disk is
only 25 GB. In this case the 500 GB only means that the vhd has your
permission to grow to be so big if it needs more storage space. If you plan
to do some heavy work and install a lot of programs to your vm, give it a
bigger vhd.

7. Select the install media for your vm. If you install from a CD or DVD disk on
your host CD/DVD drive, select Physical CD/DVD drive and from drop
down list select the correct drive. In this example I chose to use an ISO file
containing Windows 7 Ultimate installation files. Click Next to continue:
Notice that a 2nd Generation vm can only be installed from an ISO
image, therefore if you selected 2nd Generation in step 4.4 the option to
use a DVD drive is not available.

8. Review your vm settings (highlighted yellow), if OK click Finish to create


you VM:
9. Your vm has been created. On right pane, click Connect (#1) and wait until
the vm windows has opened, then press Start (#2) to boot the vm:

10. Ready! The VM boots:


11. You can now install the operating system on your VM exactly as you would
do it on a physical computer:
5.2 Create a legacy Windows virtual machine (Windows
Vista or earlier)

To install an older Windows operating system to a new virtual machine do:

1. Follow the procedure in Create a Windows virtual machine (Windows 7 or


later) until 6, where instead of selecting a virtual switch select Not
Connected:
2. Continue setting up the vm as told in Part Four from Step 7 to Step 9.
Do not launch the vm yet
3. Right click your vm in the middle pane of the Hyper-V Manager,
select Settings:
4. Remove the NIC:

5. Select Add hardware, select Legacy Network Adapter, click Add:


6. Connect the legacy adapter to an existing external switch, click OK:

7. Now you can launch the vm as told in Step 10 in Create a Windows virtual
machine (Windows 7 or later) and start installing your OS.

5.3 Create a Linux virtual machine

   Information
Although best when running Windows guests, Windows 8 built-in Microsoft
Hyper-V can also be used to run Linux guests. Officially Hyper-V only supports
SUSE and Red Hat enterprise server distributions but with a few simple tricks
any Linux distro can be installed.
In this tutorial we will install both OpenSUSE 12.1 and Ubuntu 11.10 distros.
Please notice that I have still not found how to get sound working on Hyper-V
Linux guests. Also changing the resolution seems to be extremely tricky,
following this tutorial you can set OpenSUSE display resolution freely during
the installation procedure but it cannot be changed later on. For Ubuntu I have
only managed 800 * 600 resolution.
Forgetting the missing sound and restricted resolution, Hyper-V Linux guests
are fully functional operating systems, ideal for getting to know and practise
Linux and virtualization.
Tips from other users regarding sound and resolution issues welcome!

5.3.1 Install OpenSUSE 12.1 guest on Hyper-V


5.3.1.1 Create a virtual private network switch

For a Linux guest to work on Hyper-V it needs to use so called Legacy Network


Adapter, a private one while installing and an internal or external one when
running. Before installing OpenSUSE we need to create a private network
switch using Legacy Network Adapter.

1. Open Hyper-V Virtual Switch Manager

2. Click New virtual network switch, select Private and click Create Virtual


Switch
3. Give your Virtual Switch a name, select Private Network, click OK to apply
and save settings.
.

5.3.1.2 Create a virtual machine

Click New on Actions pane on Hyper-V Manager, select Virtual Machine


.

.
New Virtual Machine Wizard opens. Click Next
.

.
Specify the name of the virtual machine and where it should be saved. Click Next
.
.
Assign RAM. Notice that the RAM assigned to a virtual machine is taken from the total of
RAM on your host PC; to run virtual machine well you need to balance between the RAM
of your host and virtual machine. For OpenSUSE I recommend using 1 GB (1024 MB); if
less you can have issues with GUI, more does not add speed or benefit in other way.
OpenSUSE runs well with 1 GB. Click Next
.
.
In Network Configuration at this point select Connection: Not Connected. We will
add virtual switch later
.
.
Specify name, location and size of the virtual hard disk. For OpenSUSE 8 GB is enough
to install and run, here I added some more for storage space. Click Next
.
.
Specify the location of install media, an ISO file or CD/DVD. Click Next
.
.
Click Finish
.

5.3.1.3 Add Private Legacy Network Switch

Open your vm settings


.
.
Remove Network Adapter. This needs to be done for Legacy Network Adapter to
work
.
.
Click Add Hardware, select Legacy Network Adapter, click Add
.
.
Set Legacy Network Adapter to use the Private switch you created earlier
.
.
Click Apply, click OK

5.3.2 Install Ubuntu 11.10 guest on Hyper-V

For how to create a private virtual switch, create Ubuntu virtual machine and
add Private Legacy Network Adapter and making Ubuntu installation to use it,
follow the steps 1.1., 1.2. and 1.3. as described above (Install OpenSUSE on
Hyper-V).
2.1. Install Ubuntu
Connect and start vm as described above (Install OpenSUSE) on 1.4.1 and 1.4.2
For Ubuntu (and all Debian family distros) to work on Hyper-V we need to
disable Advanced Configuration and Power Interface (ACPI). When ACPI is
enabled, Ubuntu does not support Legacy Network Driver needed to install
and run it on Hyper-V. Press F6 to select installation options, select acpi=off,
press Spacebar to select it, press ESC to exit Options menu
.

.
Select Install Ubuntu, press Enter
Select the installation language
.
.
Select Install this third party software to add MPEG support, click Continue
.
.
Select Erase and Install, click Continue
.
.
Click Install Now
.

.
Select your Time Zone, click Continue
.
.
8. Select your preferred keyboard layout, click Continue
.
.
Set your user credentials
.
.
Let Ubuntu install
.
.
When installation is completed click Restart Now
.

.
When Ubuntu reboots and stops telling Please remove installation media,
click Stop to stop and close vm. This ejects the installation media
.
.
Restart vm, log in
.
.
Click an empty spot on desktop, press CTRL+ALT+t to open Terminal (about the same
as Command Prompt in Windows). To move to Root (about the same as in Windows an
elevated Command Prompt), type sudo –i and press Enter. Enter your password to
confirm, press Enter again
.

.
Now we need to edit Initramfs to add modules which offer support for Hyper-V
integration components. We need to manually add modules for bus (= traffic between
host and guest), storage and network. To do this, open Initramfs using your preferred
editor. I use Nano in this example:
Type nano /etc/initramfs-tools/modules and hit Enter to open Initramfs in Nano
editor
.

.
Add these four lines at the end of the file
hv_vmbus
hv_storvsc
hv_blkvsc
hv_netvsc
.

.
Press CTRL+X to end editing, press Y to save changes. Press Enter to finally accept old
Initramfs to be overwritten
.
.
Update Initramfs: type update-initramfs –u, press Enter
.

.
Type exit and press Enter to exit root (admin mode), type exit and press Enter to close
Terminal
.

.
Shut down vm
See step 1.4.15. (Install OpenSUSE) above to switch Legacy Network
Adapter to External Switch
Start vm, login and you are ready to go
.
.

5.4 How to Create and Use Hyper-V Checkpoints in


Windows 10

   Note
Checkpoint is a powerful Hyper-V feature to easily undo all changes on a virtual
machine. You can play with virtual machines testing apps, changing settings, editing
registry and so on as if "sandboxing" and when needed, discard all changes and restore
an earlier Checkpoint in a few clicks and seconds.
A standard checkpoint stores virtual machine state exactly as it is (see Part Three in this
tutorial for difference between a production and a standard checkpoint). Whereas a
Windows Restore Point only stores and restores the Windows system state but does not
store the app state and restore or remove user files, a standard Hyper-V checkpoint
stores and restores the complete system including app state and user files. A checkpoint
can rather be compared with a system image than a restore point although even that
comparison is not accurate. 

You can create as many Checkpoints as you want to. Creating a checkpoint only takes a
few seconds. Testing for instance sysprepping Windows 10 Technical Preview in Audit
Mode you can create a checkpoint before entering the Audit Mode after installation has
finished and Windows boots to OOBE / Welcome Mode, second checkpoint when signed
in as built-in administrator in Audit Mode and third before sysprepping with your answer
file. Now when something does not work as you'd expected, simply return to any of your
earlier checkpoints instead of starting from scratch.

In the Windows 10 Creators update you can now take checkpoints and saved states
on virtual machines that are acting as nested Hyper-V hosts.

In this tutorial we will create checkpoints and apply (restore) them.

For this tutorial you will need Hyper-V enabled and setup as told in this tutorial, and at
least one working virtual machine.

5.4.1 Create a Checkpoint

1.1) Checkpoints can be created in Hyper-V Manager from Action menu (#1) or


from context (right click) menu (#2). Select a vm first, then create a checkpoint for that
vm. The vm don't have to be running, you can create a checkpoint also when the vm is
turned off:
A checkpoint can also be created from Action menu in Virtual Machine
Connection > Action menu:
1.2) When you select Checkpoint in Action or Context menus as told in 1.1 Hyper-V
asks if you want to rename the checkpoint (default name vm_name_date&time). Name
the checkpoint as you wish, click Yes (No for default name):

1.3) The progress can be seen in status bar of Virtual Machine Connection:


1.4) When checkpoint is created click OK:

1.5) You can see all your checkpoints in Hyper-V Manager. Select a vm to see its
checkpoints, Now is the current state:
5.4.2 Apply (restore) a checkpoint

2.1) To revert (restore) to last checkpoint created directly from Virtual Machine


Connection, select Action > Revert:
2.2) Confirm the operation:

2.3) To apply any existing checkpoint, select your vm in Hyper-V Manager and double
click a checkpoint, alternatively right click a checkpoint and select Apply:
2.4) The selected checkpoint will now be applied and vm turned off. Hyper-V notifies
you of success (#1), start (boot) the vm to checkpoint you had selected by clicking
the Start button (#2):
5.4.3 Checkpoint settings

3.1) In vm settings you can select what type of checkpoints you will use:
Production checkpoints
A Production Checkpoint stores the machine state but considers all apps being closed; if
you have let's say an Excel workbook open but you have not saved your work, applying
this checkpoint will restore the state of the vm as it was when you had saved your work
last time. When a production checkpoint is applied Windows boots as in cold boot, to
Welcome screen and empty desktop after sign in with no running apps.
Standard checkpoints
A Standard Checkpoint stores the machine state with app state; all open apps and
unsaved work will be saved in checkpoint, if you have PowerPoint with an unsaved
presentation open when checkpoint is created, it will be open and and your unsaved
work there when the checkpoint is applied. This causes a minor security risk, though: as
a standard checkpoint when applied bypasses Welcome / Sign In and enters directly to
desktop as it was when checkpoint was saved, anyone having access to your vm can
see your files and use your access rights.

3.2) The location of checkpoints (highlighted in above screenshot) can only be changed


when the vm in question has no checkpoints. When the first checkpoint is created and
saved, you can no longer change the location of checkpoints of that vm.

That's about it! Do not hesitate to post your questions and concerns in this thread.

Kari

5.5 How to Add or Remove a Physical Hard Disk for Hyper-V


Virtual Machine

   Information
Hyper-V enables running virtualized computer systems on top of a physical host. These
virtualized systems (aka: guests) can be used and managed just as if they were physical
computer systems, however they exist in a virtualized and isolated environment.

Your Hyper-V virtual machines can also be connected to physical hard disks from the
host computer—not just to virtual hard disks. (This is sometimes referred to as having a
“pass-through” disk connected to a virtual machine.) 

This tutorial will show you how to add and remove physical hard disks to access from
a Hyper-V virtual machine in Windows 8 and Windows 10.

   Note
Hyper-V is only available in the Window 8 Pro, Windows 8 Enterprise, Windows 10 Pro,
Windows 10 Enterprise, and Windows 10 Education editions.

You can add hard drives (ex: HDD and SSD) and removable USB hard drives, but you
will not be able to add removable media (ex: USB flash drive) to a Hyper-V virtual
machine.

While you have a physical hard disk added to a Hyper-V virtual machine, you will not be
able to create a checkpoint for the virtual machine. 
CONTENTS:

Option One: To Add Physical Hard Disk to Hyper-V Virtual Machine


Option Two: To Remove Physical Hard Disk from Hyper-V Virtual Machine

5.5.1 To Add Physical Hard Disk to Hyper-V Virtual Machine

1. Open Disk Management (diskmgmt.msc).

2. Right click on the online disk (ex: Disk 3 - "Internal HDD") you want to add to the
VM, and click/tap on Offline. (see screenshot below)
   Note

It's required that the physical hard disk be in an offline state on the host computer to be
able to add to the VM.
3. Once the disk is offline, you can close Disk Management if you like.

4. Open the settings of the Hyper-V virtual machine you want to add the disk to. (see
screenshots below)
   Note

It doesn't matter if you currently have the virtual machine off or running.
5. In the VM's settings, click/tap on SCSI Controller in the left navigation pane,
select Hard Drive on the right side, and click/tap on the Add button. (see screenshot
below)
6. Select (dot) Physical hard disk on the right side, select the disk you want to add in
the drop down menu, and click/tap on OK. (see screenshot below)
7. The disk will now be available to access in the virtual machine. (see screenshot
below)
5.5.2 To Remove Physical Hard Disk from Hyper-V Virtual Machine
1. Open the settings of the Hyper-V virtual machine you want to remove the disk from.
(see screenshots below)
   Note

It doesn't matter if you currently have the virtual machine off or running.

2. In the VM's settings, select the disk you want to remove under SCSI Controller in
the left navigation pane, and click/tap on the Remove button on the right side. (see
screenshot below)

3. click/tap on OK. (see screenshot below)


4. The disk will now be removed from the virtual machine. (see screenshot below)
5. Open Disk Management (diskmgmt.msc).

6. Right click on the offline disk (ex: Disk 3 - "Internal HDD") you removed from the VM,
and click/tap on Online. (see screenshot below)
   Note

You will need to set the disk back to an online state to be able to access it from your
host computer again.
7. Once the disk is back online, you can close Disk Management if you like.

That's it,
Shawn
5.6 How to See if Hyper-V Virtual Machine is Generation 1
or Generation 2

   Information
Hyper-V enables running virtualized computer systems on top of a physical host. These
virtualized systems (aka: guests) can be used and managed just as if they were physical
computer systems, however they exist in a virtualized and isolated environment.

When you create a new virtual machine (VM) in Hyper-V, you must choose the
generation of this VM to be either generation 1 or generation 2.

 Generation 1 (MBR / Legacy BIOS) = This virtual machine generation supports


32-bit and 64-bit guest operating systems and provides virtual hardware which has
been available in all previous versions of Hyper-V.

 Generation 2 (GPT / UEFI) = This virtual machine generation provides support


for newer virtualization features listed below, and requires 64-bit guest operating
system.
PXE boot by using a standard network adapter
Boot from a SCSI virtual hard disk
Boot from a SCSI virtual DVD
Secure Boot (enabled by default)
UEFI firmware support

Once a virtual machine has been created, you cannot change its generation.

This tutorial will show you how to quickly see if your Hyper-V virtual machines are
generation 1 or generation 2.

CONTENTS:

Option One: To See Generation of a Hyper-V Virtual Machine in Hyper-V Manager


Option Two: To See Generation of All Hyper-V Virtual Machines in PowerShell

EXAMPLE: Generation 1 or Generation 2 for New Hyper-V Virtual Machine


5.6.1 To See Generation of Hyper-V Virtual Machine in Hyper-V
Manager

1. Open Hyper-V Manager.

2. Select a Hyper-V virtual machine at the top of the middle pane you want to see what
generation it is. (see screenshots below)
   Note

If doesn't matter if the virtual machine is off or running.

3. You will now see what generation this Hyper-V virtual machine is at the bottom of
the middle pane.
5.6.2 To See Generation of All Hyper-V Virtual Machines in
PowerShell

1. Open an elevated PowerShell.

2. Copy and paste the command below into the elevated PowerShell, and press Enter.
(see screenshot below)

 get-vm | format-list Name,Generation


3. You will now see all your Hyper-V virtual machines listed by name with what
generation they are.

That's it,
Shawn

5.7 How to Create a Hyper-V Manager shortcut in Windows


10

   Information
The Windows 10 Pro, Enterprise, and Education editions include the Hyper-
V virtualization technology. Hyper-V enables running virtualized computer systems on
top of a physical host. These virtualized systems can be used and managed just as if
they were physical computer systems, however they exist in virtualized and isolated
environment. Special software called a hypervisor manages access between the virtual
systems and the physical hardware resources. Virtualization enables quick deployment
of computer systems, a way to quickly restore systems to a previously known good
state, and the ability to migrate systems between physical hosts.

Hyper-V Manager is an in-box tool for diagnosing and managing your local Hyper-V
host and a small number of remote hosts. Hyper-V Manager is available
through Programs and Features as Hyper-V Management Tools on any Windows
OS with Hyper-V included. Hyper-V Platform does not need to be enabled in order to
manage remote hosts.

This tutorial will show you how to create or download a Hyper-V Manager shortcut
in Windows 10.

CONTENTS:

Option One: To Download a Hyper-V Manager Shortcut


Option Two: To Manually Create a Hyper-V Manager Shortcut

EXAMPLE: Hyper-V Manager
 OPTION ONE 
5.7.1 To Download a Hyper-V Manager Shortcut

1. Click/tap on the Download button below to download the .zip file below.

Hyper-V_Manager_shortcut.zip

2. Save the .zip file to your desktop.

3. Unblock the .zip file..

4. Open the .zip file, and extract (drag and drop) the shortcut to your desktop.

5. You can Pin to Taskbar, Pin to Start, add to All apps, add to Quick


Launch, assign a keyboard shortcut to, or move this shortcut to where you like for
easy use.

6. When finished, you can delete the downloaded .zip file if you like.

5.7.2 To Manually Create a Hyper-V Manager Shortcut

1. Right click or press and hold on an empty area on your desktop, and click/tap
on New and Shortcut. 

2. Copy and paste the location below into the location area, and click/tap on Next. (see
screenshot below)

%windir%\System32\mmc.exe virtmgmt.msc
3. Type Hyper-V Manager for the name, and click/tap on the Finish button. (see
screenshot below)
NOTE: You could name this shortcut anything you would like though.
4. Right click or press and hold on the new Hyper-V Manager shortcut, and click/tap
on Properties.

5. Click/tap on the Shortcut tab, then click/tap on the Change Icon button. (see


screenshot below)
6. In the line under "Look for icons in this file", copy and paste the location below, and
press Enter. (see screenshot below)

%ProgramFiles%\Hyper-V\SnapInAbout.dll
7. Select the icon highlighted in blue above, and click/tap on OK. (see screenshot
above)
NOTE: You could use any icon that you would like instead though .

8. Click/tap on OK. (see screenshot below step 5)

9. You can Pin to Taskbar, Pin to Start, add to All apps, add to Quick


Launch, assign a keyboard shortcut to, or move this shortcut to where you like for
easy use.

That's it,
Shawn
5.8 How to Create Shortcut of Hyper-V Virtual Machine in
Windows 8 and 10

   Note

There's nothing wrong in running the Hyper-V Manager and launch your virtual
machines from there. However, creating a shortcut for each vm you have you can start
them fast simply by double clicking a shortcut on Desktop. 

If you want you can even set a vm to start every time you sign in to Windows. This
tutorial will show you step by step how to do this.

Video from Ten Forums Videos thread:

5.8.1 Create the Shortcut

1.1) Right click Desktop, select New > Shortcut:


1.2) Click Browse, find and select the standalone Virtual Machine Connection
executable vmconnect.exe in folder C:\Windows\System32\, click OK:

1.3) Add parameters to shortcut target path, in this case localhost (your Hyper-V host)


followed by the name of the vm in quotes. In this example I create a shortcut for a
Linux vm I have named as Cent OS 7 so I have to add localhost "Cent OS 7".
Click Next:
1.4) Name the shortcut as you wish, click Finish:
5.8.2 Elevate the Shortcut

2.1) The standalone Virtual Machine Connection must be run elevated, with built-


in administrator rights. To do this right click your new shortcut and select Properties:
2.2) Select Shortcut tab, click Advanced:
2.3) Select Run as administrator, click OK, save Shortcut Properties by clicking OK:
2.4) Repeating this procedure for each of your virtual machines you can launch any of
them simply by double clicking respective shortcut:

2.5) When you have launched the vm, start (boot) it from the Start button:
   Tip

For advanced users:

Because the shortcut is run with elevated admin rights, you get the UAC prompt every
time you launch a vm from its shortcut:

To bypass UAC, see this tutorial on our sister site for creating an elevated task shortcut
which runs the vm without UAC prompt: How to Create an Elevated Program
Shortcut without a UAC Prompt in Windows.

Kari

5.9 How to Create a Hyper-V Virtual Machine Connection


shortcut in Windows 10

   Information
The Windows 10 Pro, Enterprise, and Education editions include the Hyper-
V virtualization technology. Hyper-V enables running virtualized computer systems on
top of a physical host. These virtualized systems can be used and managed just as if
they were physical computer systems, however they exist in virtualized and isolated
environment. Special software called a hypervisor manages access between the virtual
systems and the physical hardware resources. Virtualization enables quick deployment
of computer systems, a way to quickly restore systems to a previously known good
state, and the ability to migrate systems between physical hosts.

You can use Virtual Machine Connection to connect to a Hyper-V virtual machine


(guest) on a host server (ex: your PC). The hosts and virtual machines that are available
in Hyper-V Manager are the same ones available in Virtual Machine Connection.

This tutorial will show you how to create or download a Hyper-V Virtual Machine
Connection shortcut in Windows 10.

You must be signed in as an administrator to be able to use this shortcut.

CONTENTS:
Option One: To Download a Hyper-V Virtual Machine Connection Shortcut
Option Two: To Manually Create a Hyper-V Virtual Machine Connection Shortcut

EXAMPLE: Hyper-V Virtual Machine Connection

5.9.1 To Download a Hyper-V Virtual Machine Connection Shortcut

1. Click/tap on the Download button below to download the .zip file below.

Hyper-V_VM_Connection_shortcut.zip
2. Save the .zip file to your desktop.

3. Unblock the .zip file..

4. Open the .zip file, and extract (drag and drop) the shortcut to your desktop.

5. Go to step 4 in OPTION TWO below.

5.9.2 To Manually Create a Hyper-V Virtual Machine Connection


Shortcut

1. Right click or press and hold on an empty area on your desktop, and click/tap
on New and Shortcut. 

2. Type vmconnect into the location area, and click/tap on Next. (see screenshot


below)
3. Type Hyper-V VM Connection for the name, and click/tap on the Finish button.
(see screenshot below)
   Note

You could name this shortcut anything you would like though. 
4. Right click or press and hold on the new Hyper-V VM Connection shortcut, and
click/tap on Properties.

5. Click/tap on the Shortcut tab, then click/tap on the Advanced button. (see


screenshot below)
6. Check the Run as administrator box, and click/tap on OK. (see screenshot below)
7. Click/tap on OK. (see screenshot below step 5)

8. You can Pin to taskbar, Pin to Start, add to All apps, add to Quick


Launch, assign a keyboard shortcut to, or move this shortcut to where you like for
easy use.

5.10 How to Import Hyper-V Virtual Machines

   Information
Hyper-V enables running virtualized computer systems on top of a physical host. These
virtualized systems (aka: guests) can be used and managed just as if they were physical
computer systems, however they exist in a virtualized and isolated environment.

You can use Hyper-V's export and import functionality to quickly duplicate virtual


machines. Exported virtual machines can be used for backup or as a way to move a
virtual machine between Hyper-V hosts. 

Import allows you to restore virtual machines. You don't need to export a virtual
machine to be able to import it. Import will try to recreate the virtual machine from
whatever is available. Importing a virtual machine registers the virtual machine with the
Hyper-V host. A virtual machine export can be imported back into the host from which it
was derived or new host. 

This tutorial will show you how to import a Hyper-V virtual machine (guest) on
your Windows 10 PC (host).

You must be signed in as an administrator to be able to import a Hyper-V virtual


machine.

   Note
Hyper-V is only available in the Windows 10 Pro, Windows 10 Enterprise, and Windows
10 Education editions.

CONTENTS:

Option One: To Import Hyper-V Virtual Machine using Hyper-V Manager


Option Two: To Import Hyper-V Virtual Machine using PowerShell

 
5.10.1 To Import Hyper-V Virtual Machine using Hyper-V
Manager

1. Open Hyper-V Manager.

2. Select the Hyper-V host (ex: "BRINK-DESKTOP") in the left pane you want to import
a virtual machine to, and click/tap on Import Virtual Machine in the
right Actions pane. (see screenshot below)

3. Click/tap on Next on the "Before you Begin" screen. (see screenshot below)
4. Click/tap on Browse, navigate to and select the folder (ex: "Windows 7 Ultimate")
that contains the virtual machine (.vmcx file) you want to import, click/tap Select
Folder, and click/tap on Next. (see screenshots below)
5. Select the virtual machine (ex: "Windows 7 Ultimate") you want to import, and
click/tap on Next. (see screenshots below)
6. Select (dot) an import type you want to perform, click/tap on Next, and go to step
7 or step 8 below depending on what import type you selected. (see screenshot below)

Import Type Description

Register the The current location of the Export files is where the virtual machine will be run fr
virtual machine virtual machine has the same ID as it did at the time of export. Because of this, If the
in-place registered with Hyper-V it needs to be deleted before the import will work. When the
export files become the running state files and cannot be removed.

Restore the You are given an option to store the VM files in a specific location or use the locat
virtual machine This import type creates a copy of the exported file and moves them to the selected loc
virtual machine has the same ID as it did at the time of export. Because of this, if the
running in Hyper-V it needs to be deleted before the import can be completed. When
the exported files remain untouched and can be removed and / or imported again.

Copy the virtual This import type is similar to the Restore type in that you select a location for the V
machine that when imported the virtual machine has a new unique ID. This allows for the Virtua
into the same host multiple time.
 7. If you selected to "Register the virtual machine in-place"

A) Click/tap on Finish on the "Summary" screen, and go to step 9 below. (see


screenshot below)
 8. If you selected to "Restore the virtual machine" or "Copy the virtual
machine"

A) If you like, you can specify new or use existing folders to store the virtual machine
files. When finished, click/tap on Next. (see screenshot below)
B) Browse to and select the folder where you want to store the imported virtual hard
disks (.vhdx file) for this virtual machine, and click/tap on Next. (see screenshot below)
C) Click/tap on Finish on the "Summary" screen, and go to step 9 below. (see
screenshot below)
   Note

This may take a while to finish copying the virtual machine files and hard disk to the
selected folder location(s).
9. The Hyper-V virtual machine (ex: "Windows 7 Ultimate") has now been imported to
the selected Hyper-V host (ex: "BRINK-DESKTOP"). (see screenshot below)
10. When finished, you can close Hyper-V Manager if you like.

5.10.2 To Import Hyper-V Virtual Machine using PowerShell

   Note

For more details about the Import-VM command used in this option, see: Import-VM

1. Open an elevated PowerShell.

2. Do step 3 (in-place), step 4 (in-place) (restore) or step 5 (copy) below for the


import type you want to perform.

 3. To "Register the virtual machine in-place (use the existing unique ID)"

   Note
The current location of the Export files is where the virtual machine will be run from.
When imported, the virtual machine has the same ID as it did at the time of export.
Because of this, If the virtual machine is already registered with Hyper-V it needs to be
deleted before the import will work. When the import has completed, the export files
become the running state files and cannot be removed.

A) Type the command below into the elevated PowerShell, press Enter, and go to step
6 below. (see screenshot below)

 Import-VM -Path 'Full path of virtual machine .vmcx file'


   Note

Substitute Full path of virtual machine .vmcx file in the command above with the
actual full path of where the virtual machine .vmcx file you want to import is located.

For example:
Code:
Import-VM -Path 'D:\Vitual Machines\Windows 7 Ultimate\Virtual Machines\7BEDECF9-
E91F-4115-9E86-BBFEE136D881.vmcx'
 4. To "Restore the virtual machine (use the existing unique ID)"

   Note
You have the option to store the VM files in a specific location or use the locations
default to Hyper-V. This import type creates a copy of the exported file and moves
them to the selected location. When imported, the virtual machine has the same ID as it
did at the time of export. Because of this, if the virtual machine is already running in
Hyper-V it needs to be deleted before the import can be completed. When the import
has completed the exported files remain untouched and can be removed and / or
imported again.

A) Type the command below you want to use into the elevated PowerShell, press Enter,
and go to step 6 below. (see screenshot below)

(To use default Hyper-V folders to import and copy virtual machine .vmcx and virtual
hard disk .vhdx files)
 Import-VM -Path 'Full path of .vmcx file' -Copy

OR

(To specify Hyper-V folders to import and copy virtual machine .vmcx and virtual hard
disk .vhdx files)
Code:
Import-VM -Path 'Full path of .vmcx file' -Copy -VhdDestinationPath 'Full path of
folder to copy .vhdx file' -VirtualMachinePath 'Full path of folder to copy .vmcx
file'

   Note

Substitute Full path of .vmcx file in the commands above with the actual full path of
where the virtual machine .vmcx file you want to import is located.

Substitute Full path of folder to copy .vhdx file in the second command above with
the actual folder path where you want to copy the virtual hard disk .vhdx file of the
virtual machine you want to import.

Substitute Full path of folder to copy .vhdx file in the second command above with
the actual folder path where you want to copy the virtual machine .vmcx file of the
virtual machine you want to import.

For example:
Code:
Import-VM -Path 'D:\Vitual Machines\Windows 7 Ultimate\Virtual Machines\7BEDECF9-
E91F-4115-9E86-BBFEE136D881.vmcx' -Copy -VhdDestinationPath 'D:\Vitual
Machines\Windows 7 Ultimate - Copy' -VirtualMachinePath 'D:\Vitual Machines\Windows
7 Ultimate - Copy'

 5. To "Copy the virtual machine (create a new unique ID)"

   Note

This import type is similar to the Restore type in that you select a location for the VM
files. The difference is that when imported the virtual machine has a new unique ID.
This allows for the Virtual Machine to be imported into the same host multiple time.

A) Type the command below you want to use into the elevated PowerShell, press Enter,
and go to step 6 below. (see screenshot below)

(To use default Hyper-V folders to import and copy virtual machine .vmcx and virtual
hard disk .vhdx files)
 Import-VM -Path 'Full path of .vmcx file' -Copy -GenerateNewId

OR

(To specify Hyper-V folders to import and copy virtual machine .vmcx and virtual hard
disk .vhdx files)
Code:
Import-VM -Path 'Full path of .vmcx file' -Copy -VhdDestinationPath 'Full path of
folder to copy .vhdx file' -VirtualMachinePath 'Full path of folder to copy .vmcx
file' -GenerateNewId

   Note

Substitute Full path of .vmcx file in the commands above with the actual full path of
where the virtual machine .vmcx file you want to import is located.

Substitute Full path of folder to copy .vhdx file in the second command above with
the actual folder path where you want to copy the virtual hard disk .vhdx file of the
virtual machine you want to import.

Substitute Full path of folder to copy .vhdx file in the second command above with
the actual folder path where you want to copy the virtual machine .vmcx file of the
virtual machine you want to import.

For example:
Code:
Import-VM -Path 'D:\Vitual Machines\Windows 7 Ultimate\Virtual Machines\7BEDECF9-
E91F-4115-9E86-BBFEE136D881.vmcx' -Copy -VhdDestinationPath 'D:\Vitual
Machines\Windows 7 Ultimate - Copy' -VirtualMachinePath 'D:\Vitual Machines\Windows
7 Ultimate - Copy' -GenerateNewId

6. When finished, you can close PowerShell.


   Note

This may take a while to finish copying the virtual machine files and hard disk to the
selected folder location(s).

That's it,
Shawn

5.11 How to Export Hyper-V Virtual Machines in Windows 10

   Information
Hyper-V enables running virtualized computer systems on top of a physical host. These
virtualized systems (aka: guests) can be used and managed just as if they were physical
computer systems, however they exist in a virtualized and isolated environment.

You can use Hyper-V's export and import functionality to quickly duplicate virtual


machines. Exported virtual machines can be used for backup or as a way to move a
virtual machine between Hyper-V hosts. 

Import allows you to restore virtual machines. You don't need to export a virtual
machine to be able to import it.

When creating an export of a virtual machine, all associated files are bundled in the
export. This includes configuration files, hard drive files, and any existing checkpoint
files. 
This tutorial will show you how to export a single or all Hyper-V virtual machines
(guests) on your Windows 10 PC (host).

You must be signed in as an administrator to be able to export a Hyper-V virtual


machine.

5.11.1 To Export Hyper-V Virtual Machine(s) using Hyper-V


Manager

1. Open Hyper-V Manager.

2. Select the Hyper-V host (ex: "BRINK-DESKTOP") in the left pane you want to export
a virtual machine from, select one or more virtual machine(s) in the middle pane to
export, and click/tap on Export in the right Actions pane. (see screenshot below)
   Note

You can press and hold the Ctrl key and click/tap on any virtual machine(s) to select
them to export, then release the Ctrl key when finished selecting.
3. Click/tap on Browse, navigate to and select the folder (ex: "My Virtual Machines")
that you want to export to, click/tap Select Folder, and click/tap on Export. (see
screenshots below)
4. The virtual machine(s) will now be exported. It may take a while to finish. (see
screenshots below)
5. When finished, you can close Hyper-V Manager if you like.

5.11.2 To Export All Hyper-V Virtual Machines using PowerShell

   Note
For more details about the Export-VM command used in this option, see: Export-VM

1. Open an elevated PowerShell.

2. Copy and paste the command below into the elevated PowerShell, and press Enter.

 Get-VM | Export-VM –Path 'Full path of folder to export to'

   Note
Substitute Full path of folder to export to in the command above with the actual full
path of the folder location you want to export the virtual machines' files to.

3. When finished, you can close PowerShell if you like.


   Note
This may take a while to finish exporting the virtual machine(s) to the specified folder
location.

5.11.3 To Export a Single Hyper-V Virtual Machine using


PowerShell

   Note
For more details about the Export-VM command used in this option, see: Export-VM

1. Open an elevated PowerShell.

2. Type the command below into the elevated PowerShell, press Enter, and make note
of the name (ex: "w10 build 14379") of the virtual machine you want to export. (see
screenshot below)
 get-vm

3. Type the command below into the elevated PowerShell, and press Enter. (see
screenshot below)

 Export-VM -Name 'Name of virtual machine' –Path 'Full path of folder to


export to'
   Note

Substitute Name of virtual machine in the command above with the name of the
virtual machine from step 2 above.

Substitute Full path of folder to export to in the command above with the actual full
path of the folder you want to export the virtual machine to.

For example: Export-VM -Name 'w10 build 14379' –Path 'D:\My Virtual


Machines'

4. The virtual machine will now be exported. It may take a while to finish. (see
screenshots below)
5. When finished, you can close PowerShell if you like.
5.12 How to Create a Hyper-V "Remote File Browser"
Shortcut in Windows 8 and 8.1

   Information
Hyper-V Remote File Browsing is a shell namespace extension implemented
by Hyper-V that provides a way to browse the folders/files on a remote Hyper-V server
without requiring the server to open an extra shell over the network you are managing.
The benefit of the "Remote File Browsing" is you don't have to use the normal network
share to access any location on that Hyper-V server. If you want to create a new folder,
you may need to add the folder name at the end of the export path.

This tutorial will show how to create or download a "Hyper-V Remote File
Browser" shortcut in Windows 8.

EXAMPLE: Hyper-V "Remote File Browser" in Windows 8


5.12.1

To Download a "Hyper-V Remote File Browser" Shortcut

1. Click/tap on the Download button below to download the ZIP file below.

Hyper-V_Remote_File_Browser_Shortcut.zip

2. Save the .zip file to the desktop.
3. Open the .zip file and extract (drag and drop) the Hyper-V Remote File
Browser shortcut to the desktop.

4. Unblock the extracted Hyper-V Remote File Browser shortcut. 

5. If you like, you can Pin to Taskbar on desktop, Pin to Start screen, add to Quick
Launch, assign a keyboard shortcut to it, or move this shortcut to where you like for
easy use.

6. When finished, you can delete the downloaded .zip file on the desktop if you like, or
save it to use again.

5.12.2 To Manually Create a "Hyper-V Remote File Browser"


Shortcut

1. Right click or press and hold on a empty area of the desktop, and click/tap
on New and Shortcut. 

2. Copy and paste the command below into the location area, and click/tap on
the Next button. (see screenshot below)

%windir%\explorer.exe shell:::{0907616E-F5E6-48D8-9D61-A91C3D28106D}
3. Type Hyper-V Remote File Browser for the name, and click/tap on
the Finish button. (see screenshot below)
NOTE: You can name this shortcut anything you would like though.
4. Right click or press and hold on the new Hyper-V Remote File Browser shortcut,
and click/tap on Properties.

5. Click/tap on the Shortcut tab, then click/tap on the Change Icon button. (see


screenshot below)
6. In the line under "Look for icons in this file", copy and paste the location below and
press Enter. (see screenshot below)

RemoteFileBrowse.dll
7. Select the icon highlighted in blue above, and click/tap on OK. (see screenshot
above)
NOTE: You can use any icon that you would like instead though.

8. Click/tap on OK. (see screenshot below step 5)

9. If you like, you can Pin to Taskbar on desktop, Pin to Start screen, add to Quick
Launch, assign a keyboard shortcut to it, or move this shortcut to where you like for
easy use.

5.13 Migrating Your Virtual Machines to Windows Server


2012 R2 Hyper-V
06/01/2015 LEAVE A COMMENT

 
And then comes the time to migrate your old servers with Windows Server 2012 to Windows Server 2012 R2
Hyper-V with all the joys and headaches of upgrading your old servers. In most environments nowadays, the only
physical servers are the virtualization hosts, which makes the migration very important. Microsoft made the
migration much easier in the new Hyper-V version, where we can simply move virtual machines from a Windows
Server 2012 host to a Windows Server 2012 R2, without any downtime and as simple as a normal Live Migration
of virtual machines. Actually, that’s how the migration can be done, by simple doing a Shared Nothing Live
Migration in your virtual machines to the new host.
There are other options to migrate VMs in offline mode by exporting them. Another interesting feature available in
Windows Server 2012 R2 is the option to export a running VM. Given the VM is still running during the exporting
process and being changed, this is not an option for migration, but it’s perfect if you want to duplicate your virtual
servers or troubleshoot a problem.
In this recipe you will see how to migrate your virtual machines without downtime to a new Windows Server 2012
R2 using Live Migration and the offline migration exporting VMs to the new server.
To migrate your virtual machines using Shared Nothing Live Migration, make sure the source and destination
servers are on the same network. You will also improve the migration if you create a dedicated network to be
used for migrations only.
To export and import your virtual machines, you will need available storage on the local server or a shared folder
on the network.
You will now see how to migrate a virtual machine using Shared Nothing Live Migration from Windows Server
2012 to Windows Server 2012 R2 and how to export and import a virtual machine.
1. To enable Live Migrations on the destination server with Windows Server 2012 R2, open Hyper-V
Manager and click on Hyper-V Settings on the right column.
2. In Hyper-V Settings, click on Live Migrations and select the Enable incoming and outgoing live
migrations checkbox.
3. Under Simultaneous live migrations, specify the number of concurrent live migrations that will be allowed.
4. In Incoming live migrations, specify a particular network for live migration by selecting Use these IP
addresses for live migration or select Use any available network for live migration to use any local network
adapter available to move the VMs. The following screenshot shows an example of the existing options
described in the previous steps. When finished, click OK.

5. Expand Live Migrations in the left pane and click on Advanced Features.


6. Under Authentication protocol, select Use Credential Security Support Provider (CredSSP) or Use
Kerberos.
7. Under Performance options, select between TCP/IP, Compression or SMB and click OK, as shown in the
next screenshot.
8.  To move your virtual machine using Shared Nothing Live Migration, from the Windows Server 2012 host,
open Hyper-V Manager, right click on the VM you want to move and select Move.
9. In the Before You Begin page, click on Next.
10. In the Choose Move Type window, select Move the Virtual Machine, as shown in the following screenshot
and click Next.

11. In Specify Destination Computer, type the Windows Server 2012 R2 host that you want to move your VM
and click Next.
12. In Choose Move Options, select Move the virtual machine’s data to a single location to move all
configuration files and virtual disks to the same location, Move the virtual machine’s data by selecting where
to move the items to select the location of each item to be moved or Move only the virtual machine to move
the VM only and keep the VHD files on the same location and click Next, as shown in the following screenshot.
13. In Choose a new location for virtual machine, select the destination folder where the VM will be moved
and click Next.
14. In the Summary page, verify the selected options and click Finish to start the moving process. Wait until the
completion and check the virtual machine on the destination host.
15. The other option to migrate VMs is the Export feature. To export a virtual machine to another server, open
the Start screen, and select Hyper-V Manager.
16. Select the virtual machines you want to export, right click on them, and select Export, as you can see in the
following screenshot:

17. In the Export Virtual Machine window, enter the path you want to export the virtual machines to and click
on Export.
18. Copy the exported virtual machine files to the destination host.
Note: You can also import and export VMs using the PowerShell commands Import-VM and Export-
VM respectively. For more information, open PowerShell and type Help Import-VM for import and Help Export-
VM for export.
19. Open Hyper-V Manager on the destination host and select Import Virtual Machine from the right pane.
20. In the Before You Begin screen click on Next.
21. In the Locate Folder screen, specify the folder with the virtual machine files you want to import and
click Next.
22. In the Select Virtual Machine window, select the virtual machines to be imported and click Next.
23. In the Choose Import Type window, select the type of import, as shown in the next screenshot, and
click Next.

24. If the source virtual machine has different virtual switches attached to it or different configuration that the
destination host will not support, new windows can be displayed asking you to address the problem. The next
screenshot shows an example of a VM with a different virtual switch name. Address all problems or conflicts that
the VM may have and click Next.

25. If prompted, specify the folders to store the virtual machine files and disks and click Next.
26. Click on Finish when it is done and you will see the imported virtual machine in the Hyper-V console.

 
As described during the steps, there are two options to migrate your virtual machines to a new server. The first
one, which is using Shared Nothing Live Migration, allows you to move your VM without any downtime, but it
requires the source host to be Windows Server 2012. With the second option, you can move VMs from any
Hyper-V version, but it’s an offline method.
Starting with the Export/Import option, the process to export the Virtual Machine collects its entire configuration
file, snapshots, the Virtual Hard Drive and puts all of them together within a new folder with the virtual machine
name in the specified path during the export process. It’s also possible to select more than one virtual machine
and export in just one go in case you are migrating from old Hyper-V versions.
Note: Since Windows Server 2012 a VM can be imported without requiring the export process. You can copy all
the virtual machine files to a new host and during the importation, you just need to select the VM configuration file
(xml) and continue the steps as shown above.
Windows Server 2012 R2 also introduces a new option to export VMs that are running, but this option is not
recommended for migration purpose, given the VM is still being updated during the export process, however it’s
very handy to copy your VMs into a lab or just for troubleshooting.
During the wizard, you specify the folders where the virtual machine files sit. It doesn’t matter if the virtual
machines were exported or not. You can simply copy and paste the VM files and the result will be the same.
After that, the wizard shows a list of virtual machines you want to import. The good news here is that Hyper-V list
the VMs per name and not using the Global Unique Identifier (GUID) as previous versions. It makes the process
even easier.
The wizard provides three different types of import. The first one Register the virtual machine in-place (use
the existing unique ID) assumes that all files of the imported VM are in a single place and just register the VM.
It can be used to register VMs in a new host using the same VM path. The second one, Restore the virtual
machine (use the existing unique ID) is almost the same as the previous option, but it allows you to specify the
VM files path and it copy the files to the new destination path. The last option Copy the virtual machine (create
a new unique ID) create new VMs with new IDs and can be very helpful when you just want to use the VM files
as a template to create new VMs.
Another problem from previous versions of Hyper-V is when the VM has different configurations in the source
host. For example, if the VM has a different virtual switch or a hardware setting that is not present in the
destination host the import process would fail. Now the import is clever enough to identify whether the VM has
conflicted or different settings. Memory, processor, disk, networks and file paths are checked and in case of
problems the wizard will prompt you to changed based on the destination limits and configuration.
When finished, your virtual machine will be ready to be started on the new server, making your migration much
simpler.
The first option used in this recipe was Shared Nothing Live Migration that has an easy and intuitive wizard to
move your VMs across your host servers. Although the article described how to move a VM from a single host
with Windows Server 2012 to a new host with Windows Server 2012 R2, you can still do the same process within
a cluster as well.
Different of Storage Migration, by default live migrations are disabled on Hyper-V. To enable it you must specify
some options such as authentication protocol, simultaneous live migration and incoming live migration.
The first configuration, authentication protocol, let you choose two options to specify the way Hyper-V will
authenticate to start the live migrations. By selecting Credential Security Support Provider (CredSSP) you can
live migrate virtual machines only if you are logged on to the source computer to start it so that CredSSP can be
used to authenticate the migration. This option doesn’t require any pre-requisites, but you will not be allowed to
perform a live migration using other remote management tools like Hyper-V Manager from another server or
PowerShell sessions. The migration will be initiated only when you are logged on the source server.
If you also want to start live migrations using these remote management tools you can select to use
Kerberos for authentication. When starting a live migration, either locally on the server or remotely, a
constrained delegation will be used to authenticate and start the migration. This is the best option due the
flexibility to start the migration also from remote tools, but it requires pre-configuration in Active Directory.
Kerberos authentication will be demonstrated at the end of the article.
The next option provides a field to specify the number of simultaneous live migrations that Hyper-V will support.
In this option the only limit is the hardware and the network connection between the servers.
The Incoming live migrations option allows you to configure which network will be used for live migrations. For
better performance and resilience is recommended to use a specific network for live migration, but if you have
only one network adapter on the host computer or doesn’t have a particular adapter for live migration you can
also use any available network. After enabling live migrations and setting up these three options you are ready to
move your VMs.
Under Performance options, there are three new options available. TCP/IP will move the VM memory over a
TCP/IP Connection, Compression can compress the VM memory before copying the VM to the new server
using TCP/IP connection and SMB copies the VM memory through a SMB connection, which can use Remote
Direct memory Access (RDMA) if both servers support it.
The wizard is launched with a simple right click on the VM. Shared Nothing Live Migration and Storage Migration
use the same wizard, which improves the user experience and reduce the number of windows and options on
Hyper-V. The first window, Choose Move Type, has the Shared Nothing Live Migration option (Move the
virtual Machine) and the Storage Migration option (Move the virtual machine’s storage). After selecting to
move the VM and specifying the destination server where the VM will be moved, you can select one of the three
move options to move VMs to a single location, select different locations per VM item or move only the VM. The
option to move only the VM works when you are storing the VM in a shared folder on the network or any other
type of shared storage.
When the migration starts, Hyper-V authenticates the connection on the destination host and starts the process
by migrating the VM disks. After moving all disk data, it migrates the virtual machine memory.
When finished, your VM will be up and running on the destination host and all the migration process happens
with no downtime.

5.13.1 Enabling Live Migration and Migrating VMs using


PowerShell
The PowerShell commandlet to move a VM can be considered one of the easiest one on Hyper-V due all
process that happens with just one line of command. The whole configuration and migration process described in
this article can be automated using PowerShell.
To enable live migrations of virtual machines, type the following command line:
Enable-VMMigration | Set-VMMigrationNetwork Any | Set-VMHost –
VirtualMachineMigrationAuthenticationType CredSSP
You can also change the migration network from any to a specific network by adding the IP address or the
authentication type by changing CredSSP to Kerberos.
After enabled, to move VMs, type the following commandlet. On this example, a VM called SYD-FS1 will be
moved to de server HVHost02 and the storage will be located on D:\Hyper-V. For more information about Move-
VM, type Help Move-VM.
Move-VM SYD-FS1 HVHost02 –IncludeStorage –DestinationStoragePath D:\Hyper-V\

5.13.2 Configure Constrained Delegation to Authenticate Live


Migrations
Constrained delegation allows live migrations to be started using any remote management tool and might help,
providing more flexibility to move your VMs.
To enable it, open Active Directory Users and Computers from one of the Domain Controllers where the host
servers sit, right click on the host computer account and click Properties. In the Properties window, click on
the Delegation tab, select Trust this computer for delegation to the specified services only and select Use
Kerberos, as shown in the next screenshot.
Click Add and then Users or Computers. In the Select Users or Computers box, type the destination host
server name and click OK.
In the Add Services dialog box, select cifs and Microsoft Virtual System Migration Service and click OK. The
two services will be listed in the service type as shown in the next screenshot as well.

Click Ok to close the computer properties window and repeat the same process on the destination server
computer account.
After that you can change the live migration authentication type to use Kerberos.
That’s all guys, hope this help in some way.
Leandro Carvalho 

6 How to share files between a Hyper-V host and its


virtual machines
Here is how you can share files between a Hyper-V host and any virtual
machines running on that host.
If you've used Microsoft Virtual PC or Microsoft Virtual Server, you'll have
enjoyed the fact that you can copy and paste between a virtual machine and
those platforms. This doesn’t work with Hyper-V however—you can't
copy/paste between a VM and the Hyper-V host.
The workaround is to do the following:

1. On your Hyper-V host, create a shared folder and assign Change


permission to Everyone.
2. On the virtual machine running on the host, open the Network and
Sharing Center and enable File and Printer Sharing.
3. On the virtual machine, click Start and type \\host_name\share_name
where host_name is the name of your Hyper-V host and share_name is
the name of the share you created.
4. Press ENTER and an Explorer window will open in the VM showing the
contents of the shared folder on the host.
5. You can now copy files from the VM to the host and vice versa as
needed.
7 Hyper-V: Create shared folder between host and guest with
internal network

Set up:
Host: Windows 10 Enterprise
Guest: Windows 10 Professional
Hypervisor: Hyper-V

Aim:
Create a shared folder between Host and Guest via an internal network to
exchange files
The workaround is to do the following:

Open Hyper-V Manager


Create a new internal virtual switch (e.g. "Internal Network Connection")
Go to your Virtual Machine and create a new Network Adapter -> choose
"Internal Network Connection" as virtual switch
Start the VM
Assign both your host as well as guest an IP address as well as a Subnet mask
(IP4, e.g. 192.168.1.1 (host) / 192.168.1.2 (guest) and 255.255.255.0)
Open cmd both on host and guest and check via "ping" if host and guest can
reach each other (if this does not work disable/enable the network adapter
via the network settings in the control panel, restart...)
If successfull create a folder in the VM (e.g. "VMShare"), right-click on it ->
Properties -> Sharing -> Advanced Sharing -> checkmark "Share this folder"
-> Permissions -> Allow "Full Control" -> Apply
Now you should be able to reach the folder via the host -> to do so: open
Windows Explorer -> enter the path to the guest (\192.168.1.xx...) in the
address line -> enter the credentials of the guest (Choose "Other User" - it
can be necessary to change the domain therefore enter ".\"[username] and
[password])
There is also an easy way for copying via the clipboard:
If you start your VM and go to "View" you can enable "Enhanced Session". If
you do it is not possible to drag and drop but to copy and paste.
Enhanced Session

You might also like