How to prepare Ubuntu Guest OSTemplates for Hyper-V?

Question : Ubuntu Virtual Machines on Hyper-V are not creating properly via HC10 panel. What could be the reason ?
Answer : Such issue occurs if Ubuntu OSTemplate is not properly prepared. To configure the Ubuntu OSTemplate the following steps must be followed :
  • Disable Ubuntu Firewall on OSTemplate
  • Enable root User on Ubuntu OSTemplate
  • Install HC Hyper-V components on Ubuntu OSTemplate
  • Install Updated Linux Integration Services (LIS)
  • HC Panel Level Configurations for Ubuntu OSTemplates
All these steps are explained in detail below in this kb article.
Disable Ubuntu Firewall on OSTemplate : Ubuntu Firewall should be disabled on OSTemplate. To disable ufw follow the instructions given below:
sudo ufw disable
Enable root User on Ubuntu OSTemplate : To enable root user in Ubuntu , run the following commands in sequence :
  1. sudo passwd root  ( This command will prompt you to enter root user password twice in order to confirm the password is correctly entered )
  2. sudo passwd -u root ( The second command will unlock the root user )
Install HC Hyper-V components on Ubuntu OSTemplate : Follow the instructions given below in order to install HC Hyper-V Components for your Ubuntu Server.
  1. For Linux there are 2 versions of HC Hyper-V Components. Choose the one that corresponds to your operating system.

    HC Hyper-V Component for 32 bit OS :
    HC Hyper-V Component for 64 bit OS : 
  2. ‚ÄčOnce you download, extract the file using the command: tar -xvzf hcvmcomp_x64.tar.gz
  3. After this run this command : chmod 755 ./
  4. And then : ./    
Install Linux Integration Service (LIS) : if you run lsmod | grep hv_ command, it will show that these are installed properly. However, to install the latest updated LIS tools, following steps are required to be run on the OSTemplate in the following sequence :
  1. sudo apt-get install "linux-tools-$(uname -r)" "linux-cloud-tools-$(uname -r)"
  2. sudo update-initramfs -u
  3. reboot
This will update LIS updated tools on your OSTemplate.
Note: After performing all above tasks, Ubuntu OSTemplate is now ready to be used for provisioning of Virtual Machines via HC10 panel. 
HC Panel Level Configurations for Ubuntu OSTemplates : In order to configure Ubuntu Guest OSTemplate, follow the steps given below :
  1. Open HC panel as Global Admin user.
  2. Navigate to the menu : Configurations >> Virt. Module Conf. >> OSTemplates. Here click on Add OS Template button.
  3. Now specify all the details which are related to your Ubuntu OSTemplate like its Generation, Template Size, root user and password etc. A sample of Ubuntu OSTemplate is given below just for example to give you an idea about the settings. These settings will differ according to the settings of your custom created OSTemplate for Ubuntu.

Add Feedback