In the previous article i blogged about installing Ubuntu 18.04.02 LTS and can be found here – Installing Ubuntu 18.04.02 LTS on Hyper-V
This is the follow on blog post about getting the integration services tools installed and configured for the virtual machine which we just created.
According to the Microsoft Docs for Ubuntu Virtual Machine Link, they state that the LIS package is built into the OS.
However, when you look at the Networking tab Virtual Machine under Hyper-V Manager you can see that the IP Address field is blank.
Now to resolve this, in the past, I had to spend a couple of minutes trying to find the official article from Microsoft (Link) which provided the solution. to save time I took the contents of the article and turned it into a dead simple install script
#!/bin/bash # Microsoft Hyper-V Intergration Services (Ubuntu/Debian Install Script) # Author: Simon Lee # Script Revision: 1.0 # Description: Install linux-virtual kernal for Ubuntu/Debian Server # Clear Current Screen clear # Check Session Status if [[ $EUID -ne 0 ]]; then echo "This script must be run as root" exit 1 elif [[ $EUID -eq 0 ]]; then echo -e "Session Running as \e[36mROOT\e[0m" fi # Update Local System Packages apt update && apt -y upgrade # Add hv_modules to /etc/initramfs-tools/modules echo 'hv_vmbus' >> /etc/initramfs-tools/modules echo 'hv_storvsc' >> /etc/initramfs-tools/modules echo 'hv_blkvsc' >> /etc/initramfs-tools/modules echo 'hv_netvsc' >> /etc/initramfs-tools/modules # Replace Out of Box Kernal with linux-virtual apt -y install linux-virtual linux-cloud-tools-virtual linux-tools-virtual # Update Initramfs update-initramfs -u # Reboot Server reboot
If you want to run this direct on your virtual machine you can execute:
cd /tmp && wget https://raw.githubusercontent.com/hypervlab/hypervlab-resources/master/hyper-v/linux/setup_ubuntulis.sh && sudo bash setup_ubuntulis.sh
Once the server has rebooted and we refresh the Hyper-V Manger console and look at the Networking tab we now get an IP Address.