Rawpixel - Fotolia
Regardless of the virtualization platform you're using, creating a VM is usually a straightforward process. Generally, it involves creating a VM object and allocating hardware resources, such as memory, virtual network adapters and virtual CPUs. As simple as the creation process might be, however, the OS that will eventually be installed onto the VM requires some consideration. For example, the VM will need to be provisioned with enough memory to run the OS. In some cases, there may be additional considerations that need to be made beyond meeting the minimum hardware requirements of the OS. This can be especially true for a Linux VM.
In most cases, there is nothing about the Linux OS itself that mandates special consideration. After all, you don't usually have to do anything special in order to install Linux onto a physical server, and a VM is really nothing more than a virtual representation of physical hardware. The fact that the OS is being installed onto virtual hardware should theoretically do nothing to change the installation experience. That being said, there are often special considerations that have to be taken into account if you plan to install Linux onto a VM due to limitations with the hypervisor.
One of the best examples of a special consideration that needs to be taken into account when creating a Linux VM has to do with VM generation. Hyper-V allows VMs to be created as either Generation 1 VMs or Generation 2 VMs. Generation 2 is usually the preferred option, but even in Windows Server 2016, there are some Linux builds that won't run on Generation 2 VMs. Some of these include Debian 7.x, Red Hat Enterprise Linux/CentOS 6.x and FreeBSD 10.1.
Linux Integration Services
When planning to install Linux on a Hyper-V VM, administrators must also consider the availability of Linux Integration Services (LIS). Hyper-V supports two different types of hardware devices: emulated devices and physical devices, which are sometimes called Hyper-V-specific devices.
Emulated devices are exactly what they sound like -- virtual representations of almost universally supported hardware. Emulated devices make it possible to run guest OSes that are obscure or not officially supported, but emulated devices don't perform nearly as well as Hyper-V-specific devices.
In order for an OS to derive the best possible performance from Hyper-V-specific devices, the OS will need to run Hyper-V Integration Services. At one time, this requirement meant that only Windows OSes could access Hyper-V-specific devices. Over time, however, a Linux equivalent was created.
LIS is included in the kernel for many of the newer Linux distributions. If you're planning on running an older distribution or a less popular distribution, however, you will likely have to download LIS.
Until somewhat recently, Hyper-V treated Linux as a second-class guest OS. It wasn't until Windows Server 2012 R2 that Microsoft started removing some of the limitations that had previously applied to Linux VMs. Prior to the release of Windows Server 2012 R2, for example, it wasn't possible to resize a VHDX-based virtual hard disk while a Linux VM was online.
Windows Server 2012 R2 Hyper-V also added support for Linux VMs to use dynamic memory. Not only can Hyper-V now dynamically allocate memory to a Linux VM but Hyper-V admins also have the ability to hot-add or hot-remove memory.
A couple of other improvements that Microsoft introduced for Linux VMs in Hyper-V 2012 R2 include better video, better mouse support and the ability to perform an online backup, which means that a Linux VM no longer has to be put into a saved state in order to be backed up.
Microsoft continues to improve its support for Linux VMs in Windows Server 2016. Generation 2 VMs running supported Linux OSes now have the ability to use the Secure Boot feature.
Running Linux within a VM is a common practice. Even so, it's important to consider any hypervisor-specific limitations prior to doing so. Newer hypervisors tend to support Linux VMs well, while older hypervisor versions sometimes impose inconvenient limitations on Linux VMs.
Boost Linux VM performance with these strategies
Back up Linux VMs running on Hyper-V
Prepare for potential problems when running Linux VMs on Hyper-V