In this article I’ve described steps to install CentOS Linux Hyper-V VM.
If you have other Linux distributive, make sure it’s fully compliant with Hyper-V: https://technet.microsoft.com/en-us/windows-server-docs/compute/hyper-v/supported-linux-and-freebsd-virtual-machines-for-hyper-v-on-windows
- Download minimal ISO from CentOS website. In our case we use minimal CentOS 7 ISO – http://isoredirect.centos.org/centos/7/isos/x86_64/CentOS-7-x86_64-Minimal-1511.iso. If you are using Virtual Machines Manager, you have to download and import ISO to VMM Library first.
- Create desired VM hardware configuration. For example, 2 vcpu, 2GB RAM, 50GB HDD. Save the configuration.
- Attach CentOS ISO to VM, then start VM.
- Linux will load automatically, if you don’t have any specific requirements accept default disk partitioning, set time zone, root password and hostname.
- Wait till all packages will be installed and reboot newly installed server.
- On next step you have to download and install Linux Integration Services. You need to have this part of OS installed to fully integrate VM into Hyper-V infrastructure. You can easily find and download latest Linux Integration services (LIS) ISO by searching it on Microsoft Downloads.
- Dismount CentOS ISO and attach LIS ISO.
- In Linux console type this command: “mount /dev/cdrom /media“
- Switch to “media” folder typing this command: “cd /media“
- Type the command “./install.sh” to start installation of LIS. After completion reboot server.
- If you need to configure IP stack, run “nmtui” tool from terminal.
- Restart network with command “systemctl restart network“. Check the status of interfaces with the commands “ifconfig” or “ip addr“.
- Update packages to the latest version by typing the command “yum update”. Restart the server.
- Linux Hyper-V VM is ready to use!