Run Linux on Windows

0
11686
Run Linux on Windows

working-on-windows

One of the many reasons to run Linux on Windows would be to get the best of both worlds. There are several methods for running Linux on Windows. The authors recommend Linux Integration Services, which has been made available by Microsoft. Read on to learn how to use LIS.

Recent releases from Microsoft —‘Windows Server 2012 R2′ and ‘System Centre 2012 R2’—comes with the ability to effectively host Linux and associated open source applications, along with great management capabilities. Some of the improvements in Windows Server 2012 R2 include faster live migration, dynamic memory support that can be used depending on workload, as well as the capability to dynamically resize VHDs and VHDXs. On the other hand, System Centre provides a single interface for managing Windows, ESXi and Linux operating systems. Microsoft’s new feature from Windows Server 2012 R2 and System Center 2012 R2 called Data Centre Abstraction Layer (DAL), based on CIM and WS-Man standards, has common management abstracts for managing all the resources of a data centre (this includes the physical and virtual environments). To support DAL, Microsoft has contributed Open Management Infrastructure (OMI) along with other providers to effectively manage Linux. OMI is well known for its smaller disk footprint.

This article will tell you how to use Windows Server 2012 R2 Hyper-V and Windows Hyper-V Server 2012 R2, and why installing Linux Integration Services is a best practice while running Linux as a guest OS.

Different ways of running Linux on Windows
Linux can be run on Windows in the following ways.
Virtual machines: Virtual machines are some of the best ways of running any operating system. The advantages of a VM include better hardware utilisation, the ability to run multiple OSs and to install and run any application. On a Windows machine, one can install third party virtualisation software like Virtual Box, VMware Player or Windows Hyper-V. Note that one can’t install multiple virtualisation software on the same system.

The dual boot option: The dual boot option allows more than one operating system to reside on a single computer. In a dual boot, the Windows OS is stored on one volume/disk and the Linux OS on another volume/disk (assuming it is rarely used). The best use case would be to test a new OS without switching to it completely. This method is not the recommended way of running Linux alongside Windows, as the latter facilitates only partition-specific installation or on a logical partition (within an extended partition). The Microsoft recommendation is to install Windows on a primary partition. In order to dual boot a Windows machine, please refer to the link https://help.ubuntu.com/community/Installation/FromUSBStick  
Live USB and live CDs: A live USB is a USB flash drive or USB external hard drive containing the full operating system. It is the preferred way of running Linux when compared to a live CD, as data contained in the booting device can be changed and additional data can be stored in the USB. Refer to the link https://help.ubuntu.com/community/Installation/FromUSBStick to boot from a live USB.

Install Ubuntu via Wubi: Windows-based Ubuntu Installer (Wubi) is a software installer for Ubuntu. Wubi creates a special file on your Windows partition and uses that file as your Ubuntu drive without the need for a separate partition. This means that you can install Ubuntu and use it without any partitioning, and you can uninstall Ubuntu from the Windows Control Panel when your job is complete. Follow the link http://www.howtogeek.com/howto/9142/easily-install-ubuntu-linux-with-windows-using-the-wubi-installer/ to install Ubuntu using Wubi.
Cygwin: Cygwin is a collection of tools that offer a Linux-like shell environment on Windows, but it’s not a method of running a full Linux distro. Follow the link http://x.cygwin.com/docs/ug/setup-cygwin-x-installing.html for download and installation instructions for Cygwin.
Installing Hyper-V role on Windows: To install Hyper-V role on Windows, you first need to take the following steps.
Preparing the hardware: Before you get started with enabling Hyper-V on Windows, make sure virtualisation technology is enabled via BIOS—>Processor Settings—> Virtualization technology.
Preparing the platform: In our example, let’s use Windows Server 2012 R2 Datacentre SKU on the host machine.
On Windows Server 2012 R2, go to ‘Start’, type Powershell ISE, and then type the following commands:

PS C:\Windows\system32> Import-Module ServerManager  
PS C:\Windows\system32> Get-WindowsFeature
PS C:\Windows\system32> Install-WindowsFeature Hyper-V -Restart

However, the best practice for running Linux on Windows is to use Linux Integration Services.
Linux Integration Services
Microsoft developers have built drivers for Linux OSs and have released them through a package called Linux Integration Services (LISs), which are synthetic drivers for the network and disk that enhance I/O and networking performance.
To ensure compliance with the Linux community, the drivers have been reviewed by community and forum members, and have been checked into the main Linux kernel code base. Linux distribution vendors can now pull the drivers from the main Linux kernel and incorporate them into their respective distributions.

Microsoft made LIS open source so that anyone can build from source and make changes to the code. The main Github page for Linux Integration Services is https://github.com/LIS and the latest LIS package is 3.5. The code (https://github.com/LIS/LIS3.5) for this has been released under the GNU Public License v2.

For more information on supported guest OSs on Windows OSs, please refer to the link http://technet.microsoft.com/en-US/library/dn531026.aspx  
The following are some of the new features of LIS being introduced with Windows Server 2012 R2:

  • Kdump/Kexec: Just like physical machines running the Linux OS, Linux guests can also get crash dumps.
  • Dynamic memory: Based on the Linux guest OS’ needs, memory can be automatically increased or decreased.
  • Linux Synthetic Frame Buffer Drivers: Provides enhanced graphics performance for Linux desktop users.

You can refer to the following link for a detailed LIS feature list from Microsoft’s Virtualization blog http://blogs.technet.com/b/virtualization/archive/2013/07/24/enabling-linux-support-on-windows-server-2012-r2-hyper-v.aspx  

The following example will show you how to install LIS 3.5 for RHEL 6.3 running on Windows Server 2012 R2.

Final 1
Figure 1 : Run install.sh file

 

Figure 2
Figure 2 : The LIS version for hv_vmbus after installing LIS 3.5

Installing Linux Integration Services (LIS)

  • Create a Generation 1 virtual machine and install RHEL 6.3. Download LIS from http://www.microsoft.com/en-us/download/details.aspx?id=41554
  • Connect to the virtual machine, and from the menu go to Media —> DVD Drive —> Insert Disk and attach LIS3.5 ISO.
  • Open a terminal in the virtual machine running RHEL 6.3, and run the following commands as the root user to mount the ISO and navigate to the directory relevant distribution (in this case, it is RHEL 6.3):
[root@localhost ~]# mount /dev/cdrom /media/
[root@localhost ~]# cd /media/
[root@localhost ~]# ls
[root@localhost ~]# cd RHEL63

Locate the install.sh file, in our case /media/RHEL63/, and run install.sh as shown in Figure 1. It should show the ‘Install successful’ message. To check whether LIS is installed properly, run the following commands from a terminal:

[root@localhost ~]# /sbin/modinfo hv_vmbus
[root@localhost ~]# /sbin/modinfo hv_netvsc
[root@localhost ~]# /sbin/modinfo hv_storvsc
[root@localhost ~]# /sbin/modinfo hv_blkvsc
[root@localhost ~]# /sbin/modinfo hv_util

Figure 2 shows the LIS version for ‘hv_vmbus’ after installing LIS 3.5.

References
http://blogs.technet.com/b/virtualization/archive/2014/01/02/linux-integration-services-3-5-announcement.aspx

LEAVE A REPLY

Please enter your comment!
Please enter your name here