3. Using a Hyper-V virtual machine
After a virtual machine is created and running, you can install an
operating system as long as valid physical or virtual media are
provided to the virtual machine. When the virtual machine starts, it
goes through a boot sequence much like that of a physical PC. The
virtual machine attempts to start from a CD or DVD or a network boot
(if configured) and then from the virtual disk drive (VHD or VHDX).
Many virtual
machines are installed directly from CD/DVD ISO files, and with
Hyper-V, this is a straightforward experience. Because of the broad
list of supported operating systems for Hyper-V, a computer running
Windows 8 with the Hyper-V feature enabled can easily have Windows
Server 2012, Windows 7, Linux VMs, and more running directly as virtual
machines on a capable computer.
Note
MAKE GOOD USE OF THE OPERATING SYSTEM SUPPORT
This can be a great test environment for critical updates,
application compatibility on newer (or older) operating systems, and
consolidating multiple computers at a desk for power users.
When you turn on a virtual
machine, a number of checks are performed. These include ensuring that
enough memory is available on the computer running Windows 8 with the
Hyper-V feature enabled for the virtual
machine, that the VHDX or VHD files can be locked appropriately by the
hypervisor, that any networking components (such as a virtual switch)
are available and have enough virtual
ports, and, last, that the user issuing the start request has adequate
permissions to start a Hyper-V virtual machine on that computer.
When you make a virtual machine connection, you are accessing the virtual console. The virtual console
is an important concept. Because the virtual machine has a virtual
hardware inventory, a virtual monitor or console is connected to it in
the Virtual Machine
Connection view. This view of the console allows the operating system
to be installed on the virtual machine and enables you to view the
virtual machine if any problems (such as an error message on the
console) occur later in the life of the virtual machine.
The process for installing
an operating system in the virtual machine is similar to installing
Windows (or other operating systems) on a physical PC:
-
Press and hold or right-click a virtual machine on the Start screen to turn it on.
A series of checks is performed in the background.
-
When the virtual machine has started, open the Virtual Machine Connection window shown in Figure 9 to view the virtual console of the virtual machine.
Several critical tasks are available on the Virtual Machine Connection screen:
-
With the virtual media options, you can change the current mapping to the local media or disconnect it altogether.
-
One of the more helpful options is the ability to send a
Ctrl+Alt+Delete keyboard sequence to sign in interactively on the
console.
-
The Power Off option is different from the Shut Down option. The Power Off task effectively removes the power to the virtual
machine. The Shut Down option uses Integration Services to send a
proper shutdown command to the virtual machine, and the Windows system
shuts down.
-
Virtual machine snapshots can be taken from the Virtual Machine Connection screen. This is a handy technique to mark progress on a virtual machine right where you need it.
A virtual machine snapshot
is a point-in-time view of that virtual machine, which can be reverted
to that point in time if something changes on the virtual machine. Snapshots
are a great way to mark progress when testing certain situations, but
they can quickly be forgotten and just consume endless amounts of drive
space. Further, a snapshot by itself is not a backup, so if critical
data elements are in play, ensure that none are at risk on Windows 8 virtual machines versus data directly on the Windows 8 file system running Hyper-V.
When you are finished with the virtual machine, just shut it down as
you would shut down any other computer or use the action tools in the
Hyper-V Manager console.
The following state-changing tasks are available for Hyper-V virtual machines on the Virtual Machine Connection screen:
-
Turn Off
Virtual power-off of the virtual machine.
-
Shut Down Sends a shutdown command to Windows, executed through Integration Services, and is a clean shutdown in most situations.
-
Reset
A hard restart of the VM; for example, if it has stopped responding.
-
Pause
A way to suspend
the VM’s running state. The memory allocated on the computer running
Windows 8 with the Hyper-V feature enabled will not be released.
Conversely, this makes the resume task very quick on the VM.
Migrating a virtual machine to another storage resource
Another powerful feature with Hyper-V on Windows 8 is the ability to
migrate a VM to a different storage resource, either while it is
running or if it is turned off. The Live Migration technology can place
the virtual machine’s VHDX and VHD files and other configuration
components on a different storage system.
For example, to get started with Hyper-V, you might put all the virtual machines on the C drive in the default path. You have limited drive space because you are using
an SSD. The Move VM Wizard is a migration tool in Hyper-V that you can
use to migrate the VMs from the C drive to a new drive that you add to
the computer, such as a USB removable storage device.
The Move VM Wizard picks up a VM and moves it partially or entirely
to different resources on your Windows 8–based computer. It is
important to note that Hyper-V virtual machines don’t exist only on
disk. They also have components in the Windows registry and in .xml
files and other components. You should use the Move VM Wizard rather
than try to add a VM manually to the Hyper-V Manager by virtual disk
files alone.
To move your virtual machine storage to another location, complete the following steps:
-
Press and hold or right-click a virtual machine and select Move to launch the Move VM Wizard.
-
On the Choose Move Type page, shown in Figure 10, select Move The Virtual Machine’s Storage and tap or click Next.
-
On the Choose Options For Moving Storage page, shown in Figure 11,
select one of the options: to move storage to a single location, to
move specific items to specific locations, or to move only the virtual
hard disks. Tap or click Next.
Virtual machines can be split to multiple locations if multiple VHDX or VHD files are in use.
Note
PLANNING VIRTUALIZATION IS ALL ABOUT CHANGING YOUR MIND
Virtualization with Hyper-V is a flexible and agile platform. Virtual
machines can be moved and reconfigured quickly. There are no tedious
tasks involved to make new virtual machines or to reconfigure existing
virtual machines for more virtual hardware. The easy-to-use,
wizard-driven interface makes quick work of this feature-rich
virtualization platform, available in a client-computer environment.