Generally speaking, process of making Linux VM template is quite the same like making Windows VM template, but you have to install VMM agent.
- Deploy original Linux VM as it described in this article – Install CentOS Linux on Hyper-V Virtual Machine
- Prepare VM to become it as template – install VMM agent on it. You can find VMM agents in the folder of VMM installation: “c:\Program Files\Microsoft System Center 2012 R2\Agents”.
- If you know how to use CIFS protocol and access Windows share from Linux, use this way to download agent. I’ve used the tool to create ISO with VMM agent binary.
- Attach VMM agent ISO to VM and mount it on the server : “mount /dev/cdrom /media”
- Most probably you will failed, because you have Linux Integration services installed with his own IDE driver. You have to load Linux IDE driver manually by run this command: “insmod /lib/modules/$(uname -r)/kernel/drivers/ata/ata_piix.ko” (for more details have a look this KB https://support.microsoft.com/en-us/kb/2600152). Try again previous step.
- Switch to “/media” folder by typing “cd /media“.
- Run installation “./install (latest VMM agent + your OS platform)“
- Shutdown VM (shutdown -h now)
- Copy VHDX file to VMM library server. Refresh VMM library console.
- Select VHDX file, right-click, select “create VM template”
- Configure desired hardware configuration
- Under “Guest OS Profile” select “Create new Linux operating system customization settings”. Set your OS.
- In Identity information put: name, domain name
- Root credentials: specify the password of the root account
- Click Create.
- Linux VM template is ready!
2 Comments