Search This Blog

Saturday, January 9, 2016

Generalize a Virtual Machine

A quick recap on how to generalize a virtual machine especially before upload to Azure

Windows Virtual Machine

Execute

  1. sysprep /oobe /generalize /shutdown

The virtual machine will shutdown after generalize the vm

Linux Virtual Machine

Make sure you have install Azure Virtual Machine agent (VM agent)
On red hat distro,
# wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
# rpm -ivh epel-release-7-5.noarch.rpm
# sudo yum install WALinuxAgent
# sudo systemctl enable waagent.service 

Execute

  1. waagent -deprovision
Shutdown virtual machine and upload the virtual machine.