How to set up smartphones and PCs. Informational portal
  • home
  • Windows 7, XP
  • Automatic startup and shutdown of virtual machines on the Microsoft Hyper-V platform. Starting a virtual machine and installing Windows on it

Automatic startup and shutdown of virtual machines on the Microsoft Hyper-V platform. Starting a virtual machine and installing Windows on it

Back in Windows 8, Hyper-V virtualization technology appeared, previously available only in Microsoft server operating systems. This solution looks better than the Windows Virtual PC that was included with Windows 7. Today I will tell you how to create a virtual machine in Windows using Hyper-V, as well as configure the Internet, local network and file sharing in it.

In addition to Coreinfo, you can use Intel's proprietary utility (AMD has a similar one).

You can also check the virtualization technology support matrix on your processor manufacturer's website: Intel | AMD.

Enabling the Hyper-V Feature

Hyper-V is an operating system component that is initially disabled. Advanced users can enable it with a single PowerShell command:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All

If you prefer a graphical interface, press Win + R , type OptionalFeatures and press Enter .

In the window that opens, check the Hyper-V box.

One way or another, the component will become available after the system is rebooted. Of the installation problems in Windows 8 RP, a cyclic reboot due to the fault of the USB 3.0 controller drivers has been noticed so far, which on some systems was solved by disabling USB 3.0 in the BIOS.

Create and configure a virtual machine

Press Win + R , type virtmgmt.msc and press Enter to open Hyper-V Manager. From the menu Actions select CreateVirtual machine.

The virtual machine creation wizard is extremely simple, but I will note some points for those who like detailed instructions with pictures. I will skip the network setup step for now, as I will analyze this issue in more detail.

The default location for virtual machines is a folder ProgramData, but it can be changed.

If you already have a virtual disk in VHD format, you can mount it. By the way, I did just that, using the disk created earlier for Virtual Box.

When you specify an existing VHD, the wizard skips the step that specifies the installation media.

However, you can also specify the path to the ISO later by opening the virtual machine settings in the main Hyper-V Manager window.

Starting a virtual machine and installing Windows on it

Here, too, everything is simple, but a little unusual for those who have not previously encountered Hyper-V.

In Hyper-V Manager:

  • to start the virtual machine, click "Start"
  • to interact with it, click "Connect" or double-click the thumbnail of the car

When a bootable Windows ISO image is specified in the machine parameters, you will see the familiar Press any key to boot on the screen ... Then you can handle it yourself, but if you need step-by-step installation instructions, they are on OSZone for Windows 7 and Windows 8.

If the operating system on the physical machine is newer than the one installed on the virtual one, it is recommended to update the integration components (thanks, Artem). To do this, connect in the Hyper-V manager to the virtual machine, press Ctrl + I and run setup.exe.

Setting up Internet access and local network

The instructions in this section are only necessary if you are not satisfied with the Default Switch that was introduced in Windows 10 1709, which cannot be deleted or renamed. When using the Default Switch, if the host is connected to the VPN, the virtual machine also uses the VPN. This is one of the main differences from the external switch, the creation of which I will describe next.

On the menu Actions select Configuring Virtual Switches. A window will open in which you can create a switch of one of three types. To enable your virtual machine to access the Internet, create external switch.

Now you need to set the name of the switch and select the network adapter if you have more than one. I use a wireless network at home, so I chose a Wi-Fi adapter.

It remains only to specify the created switch in the network connection settings of the virtual machine.

With Windows installed, you will now have an Internet connection and a local network between the physical and virtual machines.

In the picture above you see:

  • on the left is the result of adding a virtual switch to Hyper-V on a physical machine, i.e. network bridge and virtual adapter
  • on the right - Internet access and LAN connection on a virtual machine

As you can see, setting up the Internet and local network is not so much complicated as it is unusual for users of Microsoft client operating systems.

Sharing files between physical and virtual machines

In the course of working with a virtual machine, it regularly becomes necessary to copy files to it from a physical one, or vice versa. I will describe several ways to solve this problem.

Shared network folders

This method works in all editions of Windows 10. Since we have a local network at our disposal, we can use shared folders to share files. In fact, the instructions below boil down to the basics of creating shared folders.

Access from virtual machine to physical

A picture is worth a thousand words, as the Americans say.

The figure shows the virtual machine explorer (VIRTUAL-PC) from where the physical machine (VADIK-PC) is accessed. As soon as you enter the account credentials, access to his profile will be at your disposal.

You may want to share a folder located on a physical machine outside of your profile. To do this, it is enough to use standard sharing tools, but I will explain this process using the example of access to an arbitrary folder of a virtual machine.

Access from a physical machine to a virtual one

Let's say there is a folder in the root of the virtual machine's disk shared. Right click on it and select General accessindividual people(or Specific Users in Windows 7).

Now you can open a shared folder over a network in Explorer, including entering an address like \\computername\foldername.

Remote Desktop Connection of a Virtual Work Machine

In Hyper-V, files cannot be exchanged between a physical machine and a virtual machine by copy and paste. You can only paste the text copied on the physical machine with the keyboard shortcut Ctrl + V . However, once the virtual machine has started, you can connect to it via RDP instead of opening it from Hyper-V Manager. This method works in Pro editions and above.

Actions on the virtual machine

First you need to allow remote desktop connections on the virtual machine in the system properties. Press Win + R and run:

RUNDLL32.EXE shell32.dll,Control_RunDLL sysdm.cpl,5

Then allow the connection as shown in the picture.

It remains only to find out the IP address of the virtual machine with the command ipconfig

Actions on the physical machine

Press Win + R and type mstsc and expand login options.

In the window that opens:

  1. Enter the IP address of the virtual machine (required).
  2. Specify the username whose account will be logged into.
  3. Turn on remember credentials.
  4. Save your connection settings.

You can also set the Display tab to a resolution lower than what is used on the physical machine.

Now you can share files between physical and virtual machines with the familiar keyboard shortcuts Ctrl + C and Ctrl + V .

Finally, I would like to virtualize some of Denis Diaghilev's recommendations for working with Hyper-V.

Use RDP to connect to virtual machines.

This will not only allow you to share files between a physical and virtual machine by copying and pasting, but will also save system resources that vmconnect consumes when connecting to a virtual machine in Hyper-V Manager or from the command line.

If you plan to regularly use RDP to connect to various virtual machines, pin the program to the taskbar. Then the list of machines will be stored in the jump list.

Be careful with pictures

With Hyper-V, you can take snapshots of a virtual machine using differential disk technology. However, the logic of how the images work is practically the opposite of what a person who has never stepped on a rake expects from her.

Alexander Kosivchenko (Virtualization MVP) described in detail, albeit somewhat chaotically, the principle of Hyper-V snapshots on Habré.

Use virtual machine import if needed

Import will be of more interest to IT professionals, but I happened to use this feature by accident. After creating the virtual machine, I renamed the drive letter where it was stored, after which the Hyper-V manager lost it.

Looking around in the snap, I saw the import option and instantly restored the machine.

And I didn’t even suspect that the actions I performed became possible only due to the appearance of a new feature in Hyper-V :)

Hyper-V vs. virtual box

While tinkering with Hyper-V, I unwittingly compared Microsoft's client operating system solution to Oracle's VirtualBox.

From the point of view of typical tasks of home users (testing the installation of the system, getting acquainted with it, checking the operation of applications), these solutions practically do not differ from each other. But VirtualBox can be used on home editions of Windows 10, while Hyper-V is not available on them.

VirtualBox doesn't have such strict hardware requirements, and its graphical capabilities are even better, since it supports 3D hardware acceleration (although I've never used it).

As for the graphical interface, this is purely a matter of taste. Probably, the hypervisor that came from the server OS looks more ascetic, but the parameters and settings of virtual machines are generally very similar.

The presence of Hyper-V in Windows will primarily please IT professionals who are accustomed to this technology. For home users, this is a good opportunity to take advantage of the system's built-in tools and expand their horizons by joining Microsoft server technologies.

Survey

I was introduced to virtual machines in 2004 when I started autoinstalling Windows. Since then, they have become an integral part of my daily work, including testing system settings, programs, and so on.

In comments tell us what virtualization solution you use and for what purpose!

I want to thank Denis Diaghilev for his help in preparing this material. One of the benefits of the MVP program is exposure to top Microsoft technology experts. This means that in private you can get competent advice on any issue;)

Denis also kindly offered his help in leading the discussion. So if you have any technical questions about this article, you can count on qualified answers.

I want to specifically emphasize that

Good afternoon. Thanks to my site, I constantly tinker with the operating system and, of course, over time I began to look for a way so that I could write instructions, but at the same time make fewer changes to the operating system of my work computer ... The solution came elementary - a virtual machine. This is an emulation of a fully (or almost fully) working operating system that runs on your operating system. I tried VirtualBox, VMware Workstation and Hyper-V… VirtualBox is free and not as user-friendly as the other two. VMware Workstation - excellent in all respects, but paid. Hyper-V is a well-balanced virtual machine that migrated from server operating systems to Windows 8 and just needs to be turned on for access. Therefore, the choice fell on the latter: simple, free and tasteful. By the way, I have Windows 10 Professional licensed, but I got it for free thanks to the Windows Insider program (six months of suffering with bugs and a license in my pocket)).

I will probably immediately warn you that when you enable Hyper-V components, you will not be able to use other virtual machines. So, let's begin:

Right-click on the "Start" corner and select "Programs and Features".

In the left pane, select "Turn Windows features on or off"

Now open the Start menu → All Programs → look for the “Administrative Tools” directory and find “Hyper-V Manager” in it.

Running it, we will see the virtual machine management console, I already have one created machine, which hosts the music bot for my TeamSpeak server. But now we are creating another machine to show how this is done. But first, let's immediately create a "Virtual Network" so that our VM has the Internet. To do this, click on the computer name in the left column, and in the right column select "Virtual Switch Manager".

I add this paragraph two months after writing the article. This is because, below, I described an easier way to connect a virtual machine to the Internet, but I myself use a slightly different one. The difference between them is that in the method described here, the VM gets the main access, and the computer works after it, and this is not correct, but it is easier to configure. If you use the computer not only for running virtual machines, select "Internal" → "Create a virtual switch" and check the box "Allow identification". Internet access is configured using .

On the left, select "Create a virtual network switch", on the right "External" and click "Create a virtual switch".

Enter a name for the network, in the "External network" section, select your network adapter and click OK.

Now let's create a virtual machine. Click "Create" - "Virtual Machine".

Opens " Virtual Machine Creation Wizard“, on the first window, just click “Next”.

Specify a name for the future virtual machine. If desired, you can also change the storage location of the virtual machine, I have changed the location in the settings so as not to clog the SSD and all virtual machines are stored on one of the hard drives. Click "Next".

Everything is simple here, we read what is written, if you have a motherboard without UEFI support or you are going to install a 32-bit system, then select the first item, if the conditions for using the second generation match your capabilities, select the second generation. I want to install 32bit Ubuntu, for one of the following articles, so I choose the first generation of Hyper-V. Click next.

The amount of virtual memory. In the case of Windows, 2-3GB is desirable for 32-bit systems and 3-4 GB for 64-bit systems. More does not make sense for a virtual machine, and less can affect the operation of the system. You can also use "Dynamic Memory", in this case, the VM will be allocated as much memory as it needs.

On the last page, it remains to check our settings and click the "Finish" button.

Look like that's it. I hope this article was useful to you, click one of the buttons below to tell your friends about it. Also subscribe to site updates by entering your e-mail in the field on the right or by subscribing to a group on Vkontakte and a YouTube channel.

Issue: How to Disable Hyper-V in Windows 10?

hello all. Do you have any ideas why Windows does not allow me to uninstall Hyper-V? When I try to do so, I get an error saying: “The changes couldn't be completed. Please reboot your computer and try again. Error Code: 0x800F0831.” I've tried many things, including bcedit option, powershell scripts, DISM, and some other things, but none of them worked. Have you any ideas?

Hyper-V is not a tool for inexperienced PC users. It's a utility, which replaces Microsoft Virtual PC and allows running multiple operating systems on a single device. Hyper-V simplifies the lives of software developers, professional IT workers or tech-savvy people who opt for working or experimenting with multiple OS, including various Linux releases, FreeBSD, and Windows. When using the tool, there's no need for physical hardware injected into machines. Hyper-V turns different OS into virtual machines (“guest”), which run in tandem on a single computer (“host”).

While the tool is useful for many PC enthusiasts and experts, many of them find it lacking for some features, for example, live migration of virtual machines from one host to another, Hyper-V Replica, Virtual Fiber Channel, virtualizing GPUs using RemoteFX, and so on. Due to this or other reasons, they decide to switch to other virtualization products. The problem is that sometimes Hyper-V removal fails and returns errors like “The changes couldn't be completed. Please reboot your computer and try again. Error Code: 0x800F0831.” There were some instances when .Net Framework 3.5 were missing or damaged, which is why the removal process could not be completed. If you are experiencing this same problem, the following methods may help you:

This video has all the information required:

Disable Hyper-V Hypervisor

  • Press Windows key + X and select Apps and Features.
  • Scroll down to the bottom and click Programs and Features link.
  • Then click the Turn Windows features on or off link on the left pane.

  • Locate Hyper-V option and unmark it.
  • Click OK save the changes and reboot.

NOTE: this option will not uninstall Hyper-V, but disable the feature temporarily. It will be enabled automatically after the installation of crucial Windows Updates.

Disable Hyper-V via Command Prompt and PowerShell environments

  • right click on windows key and select Command Prompt (Admin).
  • Copy and paste the Dism /Online /Cleanup-Image /RestoreHealth. Press Enter.

  • Then run the Dism.exe /online /Cleanup-Image /StartComponentCleanup command and hit Enter.
  • Now type the sfc /scannow and press Enter again.
  • Close Command Prompt and open Windows PowerShell(with administrative privileges).
  • type PowerShell in Windows search, right-click it, and select Run as administrator.
  • Copy and paste the Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All.

  • Close PowerShell and reboot the PC.

Reinstall .NET Framework

Download the latest version of the .NET Framework. If it has been damaged or removed due to virus infection or other reasons, follow these simple steps:

  • Navigate to this website.
  • Find .NET Framework and download it.
  • Run the setup file and confirm the installation. Don't worry if the process lasts up to 10 minutes.
  • Once installed, try to Uninstall/Disable Hyper-V.

Optimize your system and make it work more efficiently

Optimize your system now! If you don't want to inspect your computer manually and struggle with trying to find issues that are slowing it down, you can use the optimization software listed below.. To optimize your computer with only one click, select one of these tools:

Compatible with Microsoft Windows Compatible with OS X Did your problem remain?
If you are not satisfied with Reimage and think that it failed to improve your computer, feel free to contact us! Please, give us all details related to your issue.

Reimage - a patented specialized Windows repair program. It will diagnose your damaged PC. It will scan all System Files, DLLs and Registry Keys that have been damaged by security threats.Reimage - a patented specialized Mac OS X repair program. It will diagnose your damaged computer. It will scan all System Files and Registry Keys that have been damaged by security threats.
This patented repair process uses a database of 25 million components that can replace any damaged or missing file on user's computer.
To repair damaged system, you have to purchase the licensed version of malware removal tool.


A virtualization server is a physical computer that has the necessary resources to run virtual machines. With Hyper-V Manager, you can create, configure, and manage virtual machines on a virtualization server.

With virtual machines, you can perform various tasks. Each virtual machine runs in an isolated runtime environment, allowing you to run different operating systems and applications on your computer.

This article will tell you how to enable Hyper-V virtualization in Windows 10. First of all, let's look at how to check the Hyper-V system requirements, and only then enable Hyper-V and configure the virtual machine.

So, if we talk about the system requirements for the operating system on which the hypervisor called Hyper-V will be deployed, then the Windows 10 Enterprise, Professional and Education editions will do. There must be a 64-bit version of the Windows 10 operating system, since 32-bit versions do not have the ability to use Hyper-V.

In addition, you will need a 64-bit processor that supports virtualization technologies such as VM Monitor Mode Extension and Second Level Address Translation support. It is recommended to use at least 4 GB of RAM, but if you run it on a smaller amount, then the virtual machine will not get anything.

And it will also be necessary to enable these same virtualization technologies, as well as enable Hardware Enforced Data Execution Prevention (DEP). Without this technology, you will not run virtual machines. There are a number of features associated with a specific BIOS or UEFI model. Some technologies may compete with virtualization and therefore prevent virtual machines from running.

The Windows 10 operating system has a tool to check the compatibility of hardware with a Hyper-V installation, which is useful for beginners. Using the systeminfo.exe utility, we will see the parameters according to the requirements for Hyper-V.

At the bottom of the window we find the Hyper-V requirements item and check whether the installation of a virtual machine is supported on your computer. If you find the following value parameters, then you will have no problems installing Hyper-V on this machine:

  • VM Monitor Mode Extensions: Yes
  • Virtualization Enabled in Firmware: Yes
  • Second Level Address Translation: Yes
  • Data Execution Prevention Available: Yes

How to enable Hyper-V in Windows 10

Control Panel


The installation of components will take place quickly enough and the system will request a system reboot. During the reboot process, the user will also see work with updates.

Windows PowerShell

Installing and configuring Hyper-V

The wizard will help you create a virtual machine. Virtual machines can be used instead of physical computers for various purposes. You can configure the virtual machine using a wizard or using Hyper-V Manager.

Before creating a virtual machine in Hyper-V, you must download an operating system image. Can be easily.

  1. We open the Hyper-V Manager, which appeared in the system after enabling the Hyper-V hypervisor component.
  2. Right-click on your device in the Hyper-V Manager and select the item in the context menu New > Virtual Machine…
  3. In the window that opens the virtual machine creation wizard, click the button Further to create a virtual machine with specific configuration options.
  4. Specify a name and location for this virtual machine and click Further(the values ​​of the current window can be left by default if you have enough memory on the system disk).
  5. Depending on the bitness of the operating system that we will install on the virtual machine, select the generation (the generation of the virtual machine you have chosen cannot be changed after creation).
  6. Next, specify how much RAM you need to allocate for this virtual machine (when deciding on the amount of memory allocated to a virtual machine, you should consider for what purposes it will be used).
  7. Select a virtual switch from the available connections, or leave the virtual machine's network adapter unconnected.
  8. Now let's create a virtual hard disk by specifying its name, location and size (we recommend that you free up memory on your hard disk in advance).
  9. Next, in the installation options, select the item Install operating system from boot image file and specify the desired operating system image.
  10. The last step in creating a virtual machine will be to check all the above parameters in the tab Summary and pressing a button Ready.
  11. Now in the Hyper-V manager, it is enough to start the created virtual machine by selecting the item Start in the context menu and connect to it by selecting the item To plug.

After connecting to a new virtual machine, a new window will open with the image that was selected earlier. Then it is enough to manage and follow the steps to install the operating system.
Conclusion

You can enable Hyper-V virtualization on Windows 10 using the virtual machine creation wizard in Hyper-V Manager. But before turning it on, make sure that your computer meets the Hyper-V system requirements. Only then is it recommended to turn on, install and configure the virtual machine in Hyper-V.

In the event that your virtual machine running on Hyper-V for some reason freezes, stops responding, and does not respond to the on/off/reboot buttons of the virtual machine in the Hyper-V console, the only quick way to force stop such a machine is "shoot" the process on the host OS responsible for this VM. Let's show how to do it on Hyper-V running on Windows Server 2016.

So, let's assume that one of the VMs on Hyper-V hangs, the guest OS stops responding, and the "Turn Off", "Shut Down" and "Reset" buttons in the Hyper-V Manager console become unavailable or return an error when pressed:

Failed to change state

To forcibly stop / restart such a VM without rebooting the entire host server, you need to end the process of this VM. To do this, you need to find out the GUID of the virtual machine.

You can determine the GUID of the VM by opening it in the management console HyperV manager server settings ( HyperV Settings). The Server section contains the location of the VM configuration files (in our example, D:\VMStore).

Navigate to this directory and find the directory with the name of your virtual machine. We need to remember the GUID, which is specified in the name of the VM configuration files.

Now you need to launch the task manager ( task manager) and switch to the tab Details. All virtual machines run under their own process instance vmwp.exe. To determine which process is responsible for which VM, we need the previously obtained GUID of the hung VM. Find the vmwp.exe process, in the column user name which the received GUID is specified. End this process End Task).


The virtual machine will be stopped. Now you can do whatever you want with it.
But! It's much easier to find and end a hung VM process using PowerShell. In this case, we only need her name.

Get the GUID for the VM named SVM-GUARDEDHOST1:

$VMGUID = (Get-VM "SVM-GUARDEDHOST1").ID

Find the process ID ‘vmwp.exe’ for the given VMGUID:

$VMWMProc = (Get-WmiObject Win32_Process | ? ($_.Name -match "VMWP" -and $_.CommandLine -match $VMGUID))

And with the help of Stop-Process we will forcibly end this process:

Stop-Process($VMWMProc.ProcessId) –Force

This is how you can easily force quit the worker process of a hung Hyper-V virtual machine.

Top Related Articles