Warning: Undefined array key "titleWrapper" in /home3/jamil642r/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/schema/blocks/toc/class-block-toc.php on line 103
HomeMicrosoft Hyper-VHow to Create Hyper-V VM Template

How to Create Hyper-V VM Template

In this article, I will show you how to create Hyper-V VM template to prepare the VM after imaging and then export and import it as a template on Hyper-V 2022, with a Server 2012 Datacenter VM.

Creating a Hyper-V template to rapidly deploy new virtual machines can save time on spin-up and updating. We can establish Hyper-V templates pre-installed with Windows features and programs just as a WDS or PXE image would produce a consistent configuration for every deployment.

Create Hyper-V VM Template

First, we will create a VM template. Right-click on the Hyper-V host, choose new, and then virtual machine.

Hyper-V manager

Choose next.

New virtual machine wizard

Specify the name and location, and then choose next.

Specify name and location

Specify generation and choose next.
Additional information about virtual machine generation is located here.

Specify generation

Assign virtual machine template memory, and then click next.

New virtual machine assign memory

Assign a network and choose next.

VM template configure networking

Connect the virtual hard disk page, assign a storage size for the VM, and select Next.

Connect virtual hard disk

Configure the installation options and choose Next.

VM template installation options

Verify the new virtual machine summary, and then choose the finish.

Completing the new VM wizard

Now proceed with the installation of the operating system as you would any other server. Once OS installation is done,. Do not join the domain or activate it. This data will be cleaned during the Sysprep action we will be taking next. You can change the virtual machine name, which will also be reset.

Sysperp Preparation Tool

Once you have your apps, settings, and updates where you want them on the virtual machine, go to C:\Windows\System32\SysPrep and then run SysPrep.exe

Sysprep location

You will need to use individual experience and check the box to generalize. In the shutdown options, choose shutdown. The system will enter a generalized state, much like when purchasing a system from a retailer, and shutdown once done so we can export the template.

System preparation tool

Once your virtual machine is completely shut down, right-click on it and then choose export.

Virtual machine manager

Create Hyper-V VM Template

Select your Export Location and Click Export

Optionally, you can simply copy and paste the VM template VHD and rename it each time you start a new VM. Selecting the export option permits sharp cloning of the VM Configuration file, which might prove helpful if you plan to set up numerous virtual machines with the same hardware specs.

Create Hyper-V VM template

Now Hyper-V will go through the method of copying the VM hard drive and configuration to the target you selected. Once the copying process is done, you can move the exported directory to any other Hyper-V server running a similar version to where you created the virtual machine and import the image for use.
You can leave the VM and turn it on later to apply the updates and repeat the Sysprep method to keep an always-up-to-date Hyper-V template.
Importing the virtual machine template looks just as simple as exporting the VM, but there are a few additional items that need changing after import.
Right-click on the Hyper-V host and then choose Import Virtual Machine.

Hyper-V manager

Import a virtual machine wizard; choose next.

Import virtual machine Hyper-V

Click on the browse button to select the exported template VM.

Import VM locate folder

Select the template folder, and then choose Select Folder.

Import VM select folder

Click next.

Import VM locate folder

Select the virtual machine and choose Next.

Select the VM to import Hyper-V

Tick the box Copy the virtual machine to create a new ID and click next.

Hyper-V choose import type

Specify the directory of the VM files after the copy and the directory of the VHD. Click next

Import VM choose destination

Choose the storage folder and click next.

Import VM choose storage folder

Verify the importing VM summary, and then choose Finish.

Completing import wizard Hyper-V

Virtual Machine Settings

Do not forget to edit the virtual machine after renaming the disk and renaming the virtual disk to this new file name.

Hyper-V virtual machine settings

After that, it’s simply powering the VM on, going through the initial setup, and you have a fully updated virtual machine that’s been deployed in a few minutes.

Jamil
Jamilhttp://jamiltech.com
A Professional Technology Blog Writer | An energetic professional with more than 20+ years of rich experience in Technology, Planning, Designing, Installation, and Networking.
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments

fitspresso analysis on How to Reset Microsoft 365 Password
historical landmarks tours for history buffs on How to Add Hyper-V Server Altaro VM Backup
9780443186882 PDF download on How to Migrate Active Directory 2012 to 2022
Shaik Mohammad Jaheer on How to Enable Night Light on Windows 11