Running a virtual machine
As the final step in creating a virtual machine, you double-click the name of a virtual machine in Hyper-V Manager to open the machine in a Virtual Machine Connection window. You then click the Start button on the toolbar to power on the machine. This is one of two common ways to run a virtual machine.
A virtual machine running in a Virtual Machine Connection window looks (and, for the most part, acts) just like a separate physical computer, except that it's contained in a window on your desktop.
You use the toolbar at the top of the window (or the corresponding commands on the Action menu) to operate the virtual machine.
From left to right, the buttons have the following functions:
- Ctrl+Alt+Del
Because the Ctrl+Alt+Del key combination is reserved by Windows 10 on your physical computer, when you press it while you are using a virtual machine, the key combination goes to your host computer. There are two ways to mimic the effect of Ctrl+Alt+Del within a virtual machine: Press Ctrl+Alt+End or click or tap this toolbar button. - Start
This button turns on a virtual machine that is off. - Turn Off
This button turns the virtual machine off, but it does so by effectively unplugging the machine. This, of course, is not a graceful way to shut down a computer, and you'll lose any unsaved data. - Shut Down
This is equivalent to using the Shut Down command on the Start menu, and the machine goes through the usual shut-down process. Note that some (usually older) operating systems do not support Shut Down, even with Integration Services enabled. For a virtual machine without this support, use commands within the virtual machine to shut down properly. - Save
This button saves the virtual machine state and then turns it off, much like hibernation on a physical computer. When you next start the virtual machine, you return immediately to where you left off. - Pause/Resume
Pausing a virtual machine stops it temporarily but does not fully release its resources, as the Turn Off, Shut Down, and Save options do. - Reset
Resetting a virtual machine discards any changes and reboots using the last saved version. - Checkpoint
This button creates a checkpoint, which is a snapshot of the virtual machine's state and its data. - Revert
This button restores the virtual machine to its condition at the previous checkpoint and restarts the virtual machine. - Enhanced Session
On guest operating systems that support it, this button toggles the virtual machine between basic session mode and enhanced session mode.
Within the Virtual Machine Connection window, you use the virtual machine just as you would a physical computer, with only a few exceptions:
- When you run an older guest operating system, using a mouse is not as fluid as it is when your guest operating system is Windows 8 or later. That's because once you click inside the virtual machine window, the mouse becomes trapped in that window. To release it, press Ctrl+Alt+Left Arrow.
- Not all of your physical computer's hardware is available in all virtual machines.
For example, DVD drives are not available in generation 2 virtual machines. (You can, however, mount an ISO image as a DVD drive.) For generation 1 machines, only one virtual machine can use a physical DVD drive at any given time. (To release the DVD drive from one virtual machine so that you can use it in another, use commands on the DVD menu.)
USB devices, audio devices, and some other local resources work only in enhanced session mode.
Start a virtual machine automatically
By default, when you open a Virtual Machine Connection window, it opens with the machine turned off. If you want to save yourself the trouble of starting the virtual machine after you open it, you can change a setting for the virtual machine so that it starts automatically. In Hyper-V Manager, select the virtual machine; in the right pane, under the virtual machine name, click Settings; in the Settings dialog box, under Management, select Automatic Start Action and then select an option.
When you close the Virtual Machine Connection window, note that your virtual machine continues to run. By closing the window, all you're doing, in effect, is turning off the monitor. To shut down or turn off the virtual machine, you should use the appropriate buttons on the Virtual Machine Connection window. If that window is closed? You can reopen it by using Hyper-V Manager.
Using enhanced session mode
With previous versions of Hyper-V, access to your physical computer's hardware is quite limited. Your physical computer's screen, keyboard, and mouse could be redirected for use by the virtual machine, but connecting other devices is somewhere between difficult and impossible. Audio playback is not supported. In addition, capabilities for copying files between a virtual machine and its host computer are very limited in older Hyper-V versions. You could overcome some of these limitations (specifically, audio playback and file copying) by using Remote Desktop Connection to connect to a virtual machine, but that requires a working network connection to the virtual machine.
With Windows 10, Hyper-V adds enhanced session mode, which solves many of these shortcomings. With enhanced session mode, you can redirect the following resources from your physical computer to a virtual machine in a Virtual Machine Connection window:
- Audio devices
- Printers
- Plug and Play devices
- Clipboard (which allows you to copy and paste files and other information between the virtual machine and your physical computer)
Determine at a glance whether you're in enhanced session mode
Need a quick way to tell whether your machine is running in enhanced session mode? Look at the speaker icon in the notification area of your virtual machine's taskbar. If it has a red X, that's because no audio device is available, which means you're in basic session mode.
Alas, enhanced session mode comes with its own limitations. First and foremost: enhanced session mode requires a guest operating system that supports it, and there are only a few that do (Windows 8.1, Windows 10, Windows Server 2012 R2). Of less importance, you'll also discover that in enhanced session mode you can't readily change the resolution of the virtual machine's monitor. (For a workaround, see the following tip.)
If your virtual machine is running an operating system that supports enhanced session mode, you can switch between basic and enhanced session mode by clicking or tapping the rightmost button on the Virtual Machine Connection toolbar.
Change screen resolution for an enhanced mode session
Within an enhanced session mode window, using the normal Windows settings for changing screen resolution leads to this message: "The display settings can't be changed from a remote session." (Enhanced session mode, in effect, uses Remote Desktop Connection to connect to the virtual machine.)
If you need to change the screen resolution, switch to basic session mode and then close the Virtual Machine Connection window. In Hyper-V Manager, click Connect to open a new Virtual Machine Connection window, and you'll be greeted by a dialog box in which you can specify the screen resolution, as shown here.
You can enable and disable enhanced session mode on a per-server or per-user basis. To view or change either setting, in Hyper-V Manager select the server and then, under the server name in the right pane, click or tap Hyper-V Settings. In the Hyper-V Settings dialog box that appears, you'll find enhanced session mode settings under Server and User.
Get ready-to-run virtual machines
As part of its support for developers, Microsoft offers fully configured virtual machines that you can download and run. Each one has a different guest operating system with certain software installed. These virtual machines are for testing and evaluation and expire after a limited time, but instructions provided with the virtual machine files explain how to use the files after expiration.