HomeAudienceAdminRunning Linux on Windows is Easy

Running Linux on Windows is Easy

- Advertisement -

Once thought of as rivals, circumstances have made Windows and Linux come together. The introduction of Windows Subsystem for Linux (WSL) has made it easy to install Linux on Windows. This brings great benefits to developers who need to work on both Windows and Linux, and to those who have to test apps that work on both Oss.

Most Windows users have, at some point in their lives, had a friend extol the virtues of operating systems based on variants of Linux. This is of course, apart from listening to Apple fans gleefully praising the latest MacOS updates. But after the Butterfly Keyboard fiasco, followed by the ‘cheese grater’Mac Pro, there has been quiet agreement that Apple might be testing the patience of its user base a bit too much. Not too long ago, installing a new operating system to check it out required a significant bit of technical expertise relating to partitioning a hard disk, creating a bootable media device, or even running a live-boot operation which was designed to take minimal effort. However, today we’re going to take a look at the alternative that Windows users have – to try out the Linux operating system without most of this pain, given the introduction of supporting software, tools, and ecosystems on Microsoft Windows.

Microsoft has been working for some time now towards becoming more integrated with open source software. This started off around the time of the company’s GitHub acquisition and continues as it strives to add support for Linux on Windows. So what exactly is this support and how can regular users make the most of this? Let’s take a closer look at this. Running Linux virtually on Windows takes almost no effort but before we get into that, here’s a brief introduction to Linux and its variants.

- Advertisement -

The Linux kernel started out as a project by Linus Torvalds and snowballed into one of the most widely adopted operating systems in the world. As Wikipedia states, it is colloquially used to describe a family of open source UNIX-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Torvalds. Linux is typically packaged in something that is termed a Linux distribution.

Figure 1: The Windows Subsystem for Linux (Source: Microsoft)

Variations on distributions are based on combinations of the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Popular Linux distributions include Debian, Fedora and Ubuntu. Commercial distributions include Red Hat Enterprise Linux and SUSE Linux Enterprise Server. Desktop Linux distributions include a windowing system such as X11 or Wayland and a desktop environment such as GNOME or KDE Plasma 5. Distributions intended for servers may omit graphics altogether, or include a solutions stack such as LAMP (this is an acronym for the Linux operating system, the Apache HTTP server, the MySQL relational database management system, and the PHP programming language). Because Linux is freely redistributable, anyone may create a distribution for any purpose.

While Linux was originally developed to be used for personal computers based on the Intel x86 architecture, it has since been ported to more platforms than any other operating system. In fact, most mobile phones running Android and its variants are broadly based on the paradigm popularised by Linux. Notably, Linux is the leading operating system on servers and other big iron systems such as mainframe computers, and the only OS used on the Top 500 supercomputers. These facts alone underline how important it might be for developers and users to be able to install and use such a diverse platform. Finally, installing Linux on Windows is now easier than ever!

Virtual machines
Virtual machines refer to the creation of a ‘subsystem’ within your original operating system from where you are able to boot a new operating system while still working within the parent operating system. Given that a virtual machine almost fully replicates the operation of a parallel operating system, it requires a proportion of the RAM, storage and processing power when run on a machine. That said, it is one of the most full-fledged representations, causing minimal problems if processing and storage requirements are met.

Typically, installing a virtual machine is simplified by tools like Virtualbox, VMware Player, etc, which only require you to download an ISO image of an OS, as you would need to do for installation on a standard computer. The rest of the process involves just system configuration, and you are good to go!

Advice for those trying out this option would be to ensure the storage and memory limits do not severely restrain the regular operation of your system while trying to spin up a virtual machine.

Cygwin is structured to serve as a set of tools that allows Linux software to be run on Windows as long as it has been recompiled for this purpose. Much of the software available for Linux already fits this bill, but the subtle difference that needs to be highlighted is that it does not offer a Linux environment but rather a Linux-like environment for Windows. For those users who miss the Linux command line and relevant programs, this might be a viable alternative to try and replicate the feel of the Linux environment for Windows.

Note that Cygwin has an ecosystem supported by a large set of packages designed to enhance the command-line experience for Windows, but only the base packages are installed by default. Users are free to choose what additional packages should be installed within their systems.

Docker and Linux containers for Windows
The rise of Docker seriously changed the rules of the game for running most software tools in the cloud. Windows Server, one of the industry standards and a widely used operating system, released new features supporting containerised applications in coordination with Docker. In fact, the release announcement at DockerCon was extremely well received by the understandably-relieved audience comprising many developers involved in working with containerised applications. Sure, this does not technically mean Linux is running on a system; but there exist containerised images that, by this definition, can be run on Windows machines. In fact, containerised images of most Linux distributions are now widely available—albeit some comprise barebones command-line functionality.

Developers were eager to run any container, Windows or Linux, on the same machine. This feature, as the Docker Team announced, uses Hyper-V isolation to run a kernel with just enough of an OS to support running containers. The feature is not only available on Windows Server but also on Windows 10 for those interested in trying it out.

Figure 2: Dockerised versions of Linux distributions are quite popular (Source: Carbon Black)

Windows Subsystem for Linux (WSL)
The best way to run Linux on Windows 10 may just be Microsoft’s introduction of Bash and consequently the option to ‘install’ Ubuntu and some other Linux distributions via the Microsoft Store. The reasoning behind this effort was quite simple – developers using Windows also need to run Linux, and Windows not only made itself a more attractive platform for software and Web developers but also made good on its commitment to open source. Earlier, testing Web apps and software required a convoluted chain of getting tools to work in sync in order to simulate and run the tests for Linux tools on Windows machines. The introduction of WSL has dramatically reduced this workflow. It has simply added enough support to convince developers that life will be made easier eventually, and they may not always have to switch around different environments while building different tools.

The configuration of the WSL environment involves running a PowerShell command to set permissions on an optional feature, followed by a quick search and installation of the desired Linux distribution from the Microsoft Store. You can choose from Ubuntu, openSUSE, Kali Linux and Debian. It’s really that simple, so go check it out!

- Advertisement -
Swapneel Mehta
Swapneel Mehta
The author has worked at Microsoft Research, CERN and startups in AI and cyber security. He is an open source enthusiast who enjoys spending time organising software development workshops for school and college students. You can contact him at https://www.linkedin.com/in/swapneelm; https://github.com/SwapneelM


Please enter your comment!
Please enter your name here

Thought Leaders

Open Journey

- Advertisement -