Skip to content

Advice on camera and microphone in WSL2 Ubuntu

At the time of writing these lines, almost everything we connect to our devices is through the so-called Universal Serial Bus (USB): cameras, microphones, external storage… It’s the fastest and safest way to synchronize and backup information between our mobile phone and computer! But what does all this have to do with the Windows Subsystem for Linux (WSL2 Ubuntu)? Let’s have a look.

Study in WSL2 with Ubuntu: proprietary and free software

To begin with, I will leave you a link to an article published in this blog, in order to facilitate knowledge of the technology I will be discussing. I will add more of them throughout the text. We have quite a bit to go through, so I recommend a nice, steaming cup of black coffee in your hands before we start.

*The Last tests I have carried out have been on virtual machines (VirtualBox®: they may be created, erased, modified, etc. on Solid State Drive).

Brief retrospective

I always say that “in order to know where we are going, we need to know where we come from.” Since 1989, I have worked with the products sold by the Microsoft Corporation: first the MS-DOS operating system and its only form of command-line interaction, and then Microsoft Windows, which also uses the graphical environment. Yes, I am well aware, MS-DOS® as such was eliminated, but its commands remain. It was replaced with Powershell®, which we have already talked about, and it is important for today’s topic.

At the end of 2016, Microsoft surprised us with the news that its SQL Server® could be run on GNU/Linux. For me, who for many years worked installing and maintaining data servers for my clients, this was shocking news. But wait, there’s more, on my journey, I discovered that   BASHware can affect a Windows system via WSL. Which brings us to today’s article, where we’ll go into handling USB devices, with particular attention to microphones and webcams, under WSL2 with Ubuntu 20.04.

WSL and WSL2

I recommend, again, the excellent article on WSL2. Although time has passed and there are some significant changes. At that time, WSL2 was installed by means of commands. Now, and I want to emphasize it, I notice that by MS Windows Control Panel, “Programs and Features”, we can add the two key components that are Virtual Machine Platform and obviously Windows Subsystem for Linux in the section of “Turn Windows features on or off”:

After this, the operating system must be restarted, this is already an idiosyncrasy of the house of Redmond! (There will be many more resets later that I will leave out. They will be implied.)

Another aspect that was added in July 2021 is the possibility of adding the Linux distributions that one wishes, directly, through the command line in Powershell (depending on the version and type of MS Windows that you have installed).

To see the available distributions:

wsl --list --online

To install Ubuntu 20.04:

wsl --install -d Ubuntu-20.04

After some time, depending on your Internet download speed, it will ask for username and password. It will immediately display the status of updates for Ubuntu.

To set WSL2 as default:

wsl --set-default-version 2

The option to download and use from the Microsoft Store is still valid and available, for Ubuntu 20.04 it takes almost half a gigabyte of space.

The fundamental difference between WSL and WSL2 is that the latest download is a complete Linux kernel, but not just any kernel, it is one specially designed to be coupled with the Windows kernel. This means that applications running on WSL2 will always have to be “passed through” -but not interpreted, as it was in WSL- before interacting with any hardware, USB included.

The only thing WSL does better than WSL2 is file sharing between the two operating systems. Apart from that, WSL2 offers many more advantages and improvements in WSL2.

Podman in WSL2

To give you an idea of how useful it is to include a full Linux kernel in MS Windows, the Podman software (Docker’s successor) can be run on WSL2. If you still don’t know what Podman is, make more coffee and read another of our articles.

Developer mode

A feature that Powershell offers that you may use to your advantage, once you have installed and configured WSL2, is the developer mode. It is accessed by pressing the Windows start key, typing “Powershell” and choosing the developer settings. The first thing is to activate the developer mode and wait for the necessary software to finish installing.

This consists of two main components: 

  • Device Portal.
  • Device Discovery.

The Device Portal will open port 50080 (remember to properly configure the Windows Defender Firewall), and from any web browser you may enter the configured credentials and access a variety of aspects that you can see in the following image.


*There is a tutorial for establishing safe connections with HTTPS but it is irrelevant for this article:

Differences aside, this is similar to what eHorus offers for both basic and advanced monitoring, if used together with Pandora FMS. I have included this feature because the configured credentials are required for the next point.

The second component is Device discovery which, among other aspects, will open an SSH server to make a connection. 

This allows us to open a terminal with the Windows command line and, once there, you may directly use WSL2 for any task that you need to develop remotely from another computer. In this case, as an example I used the PuTTY software to connect from the real machine to the Windows 10 virtual machine with WSL2 installed and configured: 

As you can see, once the default configuration has been established, just by typing the command wsl you will be ready in a Linux environment, not GNU/Linux but MSW/Linux.

USB in WSL2

We come to the purpose of this blog post: USB handling in WSL2. At the time of writing these lines, there are two pieces of news, one bad and one good.

  • The bad news is that no, WSL2 is currently unable to support USB, so for example your USB connected cameras and microphones will not be available to be used from WSL2.
  • The good news is that you may compile your own Linux kernel for WSL2 and have access to the occasional microphone or webcam from your chosen Linux distribution. But what applications could you use for it?

Compiling Linux kernel for WSL2

Before doing anything, first update Ubuntu WSL2 with the usual commands:

$ sudo apt update

$ sudo apt upgrade

And if you thought that this was enough software download… well not, now what I call the programming environment (dependencies) must be installed:

$ sudo apt install build-essential flex bison libssl-dev libelf-dev

And now you may download the base kernel source code for Ubuntu on WSL2:

$ sudo git clone https://github.com/microsoft/WSL2-Linux-Kernel.git

There are three gigabytes to download. The source code. Awesome.  Although you may always use the parameter git clone -depth=1<repository>, I did not use that option. I recommend at least 100 gigabytes free in storage before going into the downloaded folder (cloned repository) and running:

$ make -d KCONFIG_CONFIG=Microsoft/config-wsl

At this point I must clarify that I found many configuration options to compile. For example, to install the software for handling Snap packages on Debian. However, all this is excluded from Microsoft support, nothing you will be able to complain to this company if something goes wrong in the compilation process.

To finish off, turn off WSL2 with the command wsl –shutdown and copy the newly compiled kernel in the following way, not without first backing up the original kernel:

C:\Windows\System32\lxss\tools\kernel

At this point you should be able to connect any microphone or webcam and have access from WSL2… But it’s going to be no. It turns out that you must first get the hardware drivers for MS Windows, obviously, and then the Linux ones, enter in the source code the latter and recompile again. In addition to that, install in Ubuntu WSL2:

sudo apt install linux-tools-5.4.0-77-generic hwdata

sudo update-alternatives --install /usr/local/bin/usbip usbip /usr/lib/linux-tools/5.4.0-77-generic/usbip 20

And by the way, it must also be installed on Windows, with an MSI installer package, the USBIPD-WIN project…

As we can see, since we have gotten used to the graphical simplicity of Windows, if you disable the USB through the Device Manager, no hardware will be able to connect with or without your consent, since it will be blocked at operating system level.

Installing graphical applications in WSL2

Finally, although in the case of the snap package installer it is explicitly unsupported in Ubuntu over WSL2, other applications that interact with hardware (such as sound, for example) will be able to be installed, but when they try to access files of hardware (remember that in Linux everything is a file) because they simply will not find such resources. This is the case of the espeak software:

In theory, the Ubuntu blog indicates that by means of X Window System Architecture it is possible to “pass” the graphical interface of the applications installed in WLS2. Microsoft officially announced just before the end of 2021 that the following graphics applications can be run:

  • Gedit (my favorite graphical GNU text editor).
  • GIMP (powerful for graphic design).
  • Nautilus (file explorer).
  • VLC (audio and video player).
  • Applications based on X11 (calculator, clock, etc.).
  • Google Chrome (at your own risk due to its high RAM and resource consumption).
  • Microsoft Teams (by the way, Pandora FMS has a special connector).
  • Even Microsoft Edge web browser for Linux!

But this has some drawbacks. First, you must have Windows 11 Build 22000. Second, have the video hardware drivers for WSL2 installed. Third, be enrolled in the Windows Insider Program. I hope you liked the information!

About Version 2 Digital

Version 2 Digital is one of the most dynamic IT companies in Asia. The company distributes a wide range of IT products across various areas including cyber security, cloud, data protection, end points, infrastructures, system monitoring, storage, networking, business productivity and communication products.

Through an extensive network of channels, point of sales, resellers, and partnership companies, Version 2 offers quality products and services which are highly acclaimed in the market. Its customers cover a wide spectrum which include Global 1000 enterprises, regional listed companies, different vertical industries, public utilities, Government, a vast number of successful SMEs, and consumers in various Asian cities.

About PandoraFMS
Pandora FMS is a flexible monitoring system, capable of monitoring devices, infrastructures, applications, services and business processes.
Of course, one of the things that Pandora FMS can control is the hard disks of your computers.

Silicon shortage, is another global crisis coming?

We are drug addicts. Not to green cannabis or MDMA, necessarily, but we do are addicted to some elements scattered around the globe that support the base of the world economy and that we need, like water, so that everything remains in order. The shortage of silicon chips is already one of the most suffocating problems that humanity has to face these days, we tell you about it in this article.

A new world problem: shortage of silicon chips

Perhaps there were some smart people who knew it before, but, for the rest of the mortals, it was in 2021 when the crude dependence that the technology industry has on factories that produce microchips was revealed. Yes, those little things are absolutely essential for the operation of electronic devices.

You can now start trembling with fear, the shortage of semiconductors, of silicon chips, which work as the heads of computing devices, is not good for us. Because, as you may tell, they control everything these days, from your smartphone to your laptop, from your tablet to your new car, from your state-of-the-art washing machine to your kid’s Playstation 5.

What is this semiconductor crisis about?

As it happened with the rest of the markets, the restrictions imposed by the pandemic forced the closure of many of the factories that were devoted to the production of these chips, thus making their production more difficult. And what’s worse, on top of that, the demand for computer devices increased, since everyone was locked up at home, needing to work remotely or entertain themselves with screens so as not to die of disgust making bread or staring at the wall. To all of this we add the inevitable delay in shipments and transport on a global scale, as well as the rise in the price of silicon, an essential element for microchip manufacturing, and other components that were bitterly disputed by the great world powers. As if that were not enough, two large chip producers, Taiwan and China, suffered certain catastrophes that seriously affected the capacity of their factories.

We know that the semiconductor industry fluctuates, that it is fickle and regularly goes through certain cycles of shortage, but all of this happened at the same time: this fluctuating nature, the alteration of demand and supply patterns due to the pandemic, the disagreements between the great powers, and then the catastrophes in the countries with the highest production… Not even done on purpose!

Who has been the worst off because of the shortage?

One of the markets that has been the most affected is the automobile sector. In fact, the AlixPartners financial consultancy recalls that, due to the shortage of chips, the global automobile industry has lost, this past 2021, 210,000 million dollars in revenue. That’s about 7.7 million cars less.

But not only that, the shortage of semiconductors also threatened the availability of smartphones, tablets and other gadgets with microchips in the last months of last year, which is, as you know, when these things are sold more. The Christmas campaign.

In fact, the very Apple, during November, had to choose between its iPads and its iPhones, diverting the chips that were originally destined for the former for the latter, since the iPhones are sold more and they are more lucrative. This meant that many specialist stores in the UK didn’t have stock of the iPad mini or the basic iPad for months.

But now comes perhaps the sector that has defended the problem of silicon, chips, semiconductors and all their ancestors the most: the world of gamers. Because the universe can be sunk with a single click of Thanos but the difficulties to get the brand new PlayStation 5 or the Xbox Series X is inexcusable. Indeed, Sony had it hard. Forced, even, to stop the production of its flagship product, the PS5, because the hundreds of chips that make it up are too difficult to obtain. The same thing happened with the giant Nintendo, which warned, distressed, that they were in serious trouble. They couldn’t keep up with the demand for their new console. Meanwhile, high-end graphics cards for PC gaming are still hard to find. If things continue like this, at any moment gaming lovers will leave the controls of Call of Duty, come out of their burrow and go themselves refine the silicon.

Moving on to the aesthetic spectrum, we note that if you’re bald you might not have noticed, but the Supersonic hair dryer and Airwrap hair styler have been missing for months as tech giant Dyson continues to beg for chips among the few supplies that work selling them worldwide.

Conclusion: What will happen in the near future?

Yes, things are very bad regarding the supply of chips and semiconductor materials. Although, don’t worry, experts warn that the effects of the shortage will only take a year to subside. There will be gradual improvements, although all the demand will probably not be met before 2023.

Many companies, such as Intel, have decided to create new chip factories in Europe, America and Asia to avoid another shortage on such a scale. In the meantime, meditate, exercise, read our articles, check your security system, or try to bring back tug-of-war as an Olympic sport.

About Version 2 Digital

Version 2 Digital is one of the most dynamic IT companies in Asia. The company distributes a wide range of IT products across various areas including cyber security, cloud, data protection, end points, infrastructures, system monitoring, storage, networking, business productivity and communication products.

Through an extensive network of channels, point of sales, resellers, and partnership companies, Version 2 offers quality products and services which are highly acclaimed in the market. Its customers cover a wide spectrum which include Global 1000 enterprises, regional listed companies, different vertical industries, public utilities, Government, a vast number of successful SMEs, and consumers in various Asian cities.

About PandoraFMS
Pandora FMS is a flexible monitoring system, capable of monitoring devices, infrastructures, applications, services and business processes.
Of course, one of the things that Pandora FMS can control is the hard disks of your computers.

Hard Disk Types

Hard disk types: Get to know the main ones!

Do you need to buy hard disks? All right, we all have needs in life.

Are you clear about what you need them for? Great, that’s where it starts.

Don’t you have a clear choice of hard disk types? Maybe we can give you some clues…

The choice of hard disks depends, specially, on the use you are going to make of them. You may need them for servers or databases, or for high-performance environments. But it is also possible that you only want them to save on your home computer Petabytes of videos of the dancing parrot.

In this article we are going to know the main types of hard disk that exist nowadays. Let’s go!

Hard disk types. A brief introduction

Before going into greater depths we have to say that hard disks are basically divided into 2 categories: HDD and SSD.

When distinguishing between classes of hard disks, these can also be distinguished depending on the type of connectors they use. Thus, we talk about modalities such as SATA, SCSI or SAS, among others.

In fact, we could even use other criteria to classify the types of hard disk, such as where they are (internal or external) or even what they are used for, but in this article we are going to keep the first two.

Next we will see what each type of hard disk consists of. However, one thing to keep in mind is that both HDDs and SSDs will be able to use different types of connectors.

Hard Disk Types: HDD and SSD

HDD Hard Disks

We know by HDD (Hard Drive Disk) the traditional mechanical hard disks that record information magnetically on one or several platters. HDDs are made up of mechanical parts; they basically consist of one or more hard disks that rotate at high speed (thousands of RPMs) around an axle, inside a box. On each disc, a head reads or records data on each of its faces.

So that you can visualize it simply, it would be something like a small turntable stored inside a box (saving distances).

HDDs have been the most widely used discs in recent decades. More economical, durable, and with ever-increasing storage capacities, HDDs have reigned as storage devices for decades, and even though they have been a tough competitor in SSDs, they are still widely accepted.

Solid State Disks (SSD)

They are a recent novelty, and every day they have more followers. Actually, when we talk about SSD (Solid State Drive), we’re not talking about a “hard drive” as such. However, since they share their primary purpose, which is to store data, they are also often called “hard drives”.

The structure of SSD devices has little or nothing to do with the classic HDD, so they are only called “hard drives” because they are dedicated to similar functions. SSDs are not, in fact, disks, and lack mechanical parts; on the contrary, they have their own microprocessor (called a “controller”) that takes care of data reading/writing tasks, and stores the data in microchips that have interconnected flash memories.

For the last few years SSD hard drives have been very successful thanks to their higher speed. However, they also have some disadvantages, such as their price and lower storage capacity. So some people go for the solution of using an SSD hard drive to run the operating system and use an HDD for data storage.

Types of hard disk according to their connectors

Serial ATA (SATA) hard disks

In its different versions, the most current is version III, these are the most common hard drives in home computers, if you are accessing this article through a laptop or desktop computer is likely to be the type of hard drive that is working in your computer.

The Serial ATA uses a serial connector for data transmission and in its version III reaches speeds of about 600 Mb/s.

As we said, these are the hard drive connectors that have been most popular in recent years. Both their price and their data transmission speed have made them very popular.

SCSI or SAS hard disks

These are professional hard drive connectors that are typically found in high performance environments.

They are usually installed in RAID and are inside racks or blades.

One of their main features is that they are able to replace other similar hard disks (which, for example, have broken down), without having to shut down the computer, which will help the service to continue operating without an interruption.

Let’s get monitoring!

And now that we’ve seen some of the main hard disk types out there, how about taking a few minutes to discover something as important as system monitoring?

Monitoring systems are responsible for monitoring computer systems (hardware, networks and communications, operating systems or applications, for example) in order to analyse their operation and performance, and to detect and warn of possible errors.

And if we talk about monitoring, of course, we should talk about Pandora FMS. Pandora FMS is a flexible monitoring software, capable of monitoring devices, infrastructures, applications, services and business processes.

Of course, one of the things that Pandora FMS can monitor are the hard disks of your computers.

About Version 2 Digital

Version 2 Digital is one of the most dynamic IT companies in Asia. The company distributes a wide range of IT products across various areas including cyber security, cloud, data protection, end points, infrastructures, system monitoring, storage, networking, business productivity and communication products.

Through an extensive network of channels, point of sales, resellers, and partnership companies, Version 2 offers quality products and services which are highly acclaimed in the market. Its customers cover a wide spectrum which include Global 1000 enterprises, regional listed companies, different vertical industries, public utilities, Government, a vast number of successful SMEs, and consumers in various Asian cities.

About PandoraFMS
Pandora FMS is a flexible monitoring system, capable of monitoring devices, infrastructures, applications, services and business processes.
Of course, one of the things that Pandora FMS can control is the hard disks of your computers.

Every programmer deserves a Vagrant File

Vagrant File: Working with virtual IDE’s

An Integrated Development Environment is like the personal office of every software programmer, because we have all the components in order to focus on the task. Today everything is oriented towards web applications and in a previous article we mentioned how large companies have taken advantage to offer such services quickly, in what have become known as “Architecture without server”, euphemistically. For these cases we tell you that a Vagrant File could be developed to simulate this environment without a server to perform tests, saving time and money before hiring these services and creating our web application.

In this article we will show you how the field of programming has evolved, always with concise narratives and additional links.

In the 20th century…

Computers were expensive, even more than today; so many of us didn’t have computers at home. Those were simpler times, and mobile phones were only used by our bosses, so when we left the office we were really disconnected and could get by without Internet. But when we turned on our computer to program we had already placed all the variables -and programs- necessary to begin our work. We had to have the whole programming environment set up and ready.

In those days, going to the office physically was common, but now, it’s not.

In this 21st century

Now programmers can work remotely and for several clients or companies from anywhere, but such flexibility brings the dreaded thing of “it works on my machine”, but not on that of other developers who work with us. Virtual machines have solved, in part, this problem and even its complexity has increased exponentially with the networks defined by software.

As we said, each application is unique and its components can become very unique or specific. All of the above may not fully meet our needs, but it is not yet time to say goodbye to our personal computers, at least not in our profession.

Vagrant File

vagrant file

vagrant file logo

Continuous Software Release and Continuous Integration have taken the demands much further to meet deadlines and goals: we must copy from the repositories the algorithms we are working on, to make very specific modifications and then return them to the common cause. Whether we are in America or Europe we must always be ready for any work, and this is where the Vagrant File comes in.

A Vagrant File describes both an operating system and the provisioning and also configuration of a development environment. For the programmers it is a complete and rather tedious work: it takes away our energy to program. With a Vagrant File created and adapted by all the members of the team, not only will we have a development environment, we will also have an environment identical to the one used in production, a task that we will do in a single opportunity in the device where we usually work.

Installing Vagrant

To install any Vagrant File we will first need to have VirtualBox installed, and in our case we use Debian/Ubuntu. Once we have installed this hypervisor we can proceed to install Vagrant. In a GNU/Linux environment it is common to use apt-get install vagrant or for CentOS and related yum install vagrant, but if you have a problem it is better to download the installation packages directly from the official site rather than the default repositories of your operating system. At the time of writing this post the supported platforms are as follows:

  • Linux (64 bits, package in AppImage format, which is very appreciated by Linus Torvalds, creator of Linux, who explains how it works)
  • Debian (32-bit and 64-bit, package in .deb format)
  • Microsoft Windows® (32-bit and 64-bit)
  • CentOS® (32-bit and 64-bit, .rpm package)
  • macOS® (32-bit and 64-bit, .dmg package)
  • ArchLinux (64 bits, package in .tar.xz format)

First steps

The first thing we run is the vagrant -v command in a terminal window, to see which version we have installed (2.1.2, to date). Then we will be able to choose the operating system we are going to use; in Pandora FMS the selected one is CentOS 7, so we will create in our user documents a folder called vagrant-home:

# mkdir ~/vagrant-home 
# cd ~/vagrant-home 
# vagrant init centos/7

This is where we need to be patient: we proceed to download an image of the desired provider, in this case a Content Delivery Network (CDN) from vagrantcloud.com:

“vagrant init centos/7” and “vagrant up”

It is fair to say at this time that many companies have collaborated by publishing each by their own means an image file for different hypervisors. In the case of CentOS we have for Microsoft Hyper-V®, Libvirt, VMWare Fusion® and, of course, for VirtualBox.

vagrant file

Vagrant images supported by CentOS for different hypervisors

Do we need a Percona database? We can search VagrantUp for a Vagrant Archive that suits our needs, or we can create our own Vagrant Archives and share them!

Finally using a Vagrant File

Now we will do all our work of server configuration management with a Vagrant File and we will start by reviewing the one we just created… When? Well, when we issued the vagrant up order in our vagrant-home folder:

Vagrant File

The famous Vagrant File, file in plain text

All the lines are commented, except the one that describes the virtual machine; there we can quickly change anything we need (IP address, listening ports to connect via SSH, etc.). For now we’ll use the vagrant halt order to shut down our machine.

The “mantra” of Vagrant

The idea is, by means of a Vagrant File that we get to download a virtual machine and, in addition, with additional instructions to carry out the provisioning and configuration of a development environment (or of production). This way we will have our own machine, we will turn on and off, and if at a certain moment we want to restart and start again we will use vagrant destroy.

Remember to save OUTSIDE the virtual machine all your work, or if you use Git apply the command git push; in Pandora FMS we use GitHub to store the source code since 2014.

Working with Vagrant

How do we connect to our Vagrant File (as we saw, this file is the core of the matter)? Because always located in our folder to that effect created, we introduce vagrant ssh and we will be connected to begin our work.

Do we want to connect in a “normal” way, as we have always done? The only change human beings like is the diaper change; if we want to connect with the command, ssh, first we must run vagrant ssh-config to know the configuration we will use.

vagrant file

“vagrant ssh” and “vagrant ssh-config”

Monitoring Vagrant

From the SSH connection we can add the parameter “-o LogLevel=VERBOSE” to know what happens with our connection (by default it is configured to “FATAL”, the other possible values are QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2 and DEBUG3). Also for logs, if we use VirtualBox, they are located at
“~/VirtualBox VMs/vagrant-nombre_de_nuestra_carpeta_default_XXX/Logs/VBox.log” in a very particular format… But before going deeper into that, we tell you that it is just the tip of the iceberg, because it only shows us the record of SSH connections and perhaps we should aim higher.

To keep track of the boot of our virtual machines we must use the parameter “–debug”to be able to get all the details of each boot and shutdown:

vagrant file

Result of the command “vagrant up –debug”

Note: always “VBox.log” will contain the last record, the previous ones will be listed and kept and if we want to monitor we must automate so that it always reads the record after a “vagrant halt” or “vagrant destroy”. The other possible values are: info, warn and error. If we want to save absolutely all the startup record we must send all the output to a file in the same folder where we run: “vagrant up –debug &> nuestro_registro.log” (the debug parameter has two dashes as prefix).

Any information we send you to register may contain personal information and/or sensitive data of the device where you are running Vagrant. Be careful.

Using Pandora FMS as a monitoring tool

We saw that Vagrant has a very particular way of keeping records. Therefore, the default option we have to monitor with Pandora FMS is like any other device, either installing a Software Agent or performing a Remote Monitoring, having the foresight to provide an IP address to the Vagrant virtual machine to communicate with the Pandora FMS server, central or satellite.

A few steps beyond

Once we have experienced working with third party Vagrant Files, it will be time to create our own well-customized virtual machines to share with our colleagues. To do this, we must use Packer, a tool specially designed for such tasks.

When we are very experienced we can even review the logs without having to connect via SSH through a very elaborate artifice called codeyourinfra, which consists of an Apache web server with Jenkins, which will allow us reading access.

Don’t hesitate to contact us in Pandora FMS to start working in your company or office. We have years of experience and a well-qualified team at an international level.

About Version 2 Digital

Version 2 Digital is one of the most dynamic IT companies in Asia. The company distributes a wide range of IT products across various areas including cyber security, cloud, data protection, end points, infrastructures, system monitoring, storage, networking, business productivity and communication products.

Through an extensive network of channels, point of sales, resellers, and partnership companies, Version 2 offers quality products and services which are highly acclaimed in the market. Its customers cover a wide spectrum which include Global 1000 enterprises, regional listed companies, different vertical industries, public utilities, Government, a vast number of successful SMEs, and consumers in various Asian cities.

About PandoraFMS
Pandora FMS is a flexible monitoring system, capable of monitoring devices, infrastructures, applications, services and business processes.
Of course, one of the things that Pandora FMS can control is the hard disks of your computers.

What is, how to install WSL2 and why is it great news for the IT industry?

What is and how to install WSL2 and why is it great news for IT?

Background

Before diving into what WSL2 is, how to install it, and how to use it – which we will – I would like to add some background information you might relate to if you were born in the 80s like me.

From a very young age I have felt attracted to computers, and in my childhood they were not as common as they are today, when almost everyone has one within reach.

I think my first encounter with a computer was when I was 11 or 12 years old, with an old computer that my father had in his office. I remember spending hours in front of the screen, although I’m not quite sure what I was doing, because at that time there was no internet.

That old computer had Windows 3.1; my first computer also meant my first Operating System was Windows, which I used in all its versions (and I will also spoil that I still use it). From then on I kept on using it, in fact, I didn’t know about anything else until I got to college and some friends told me about Linux (Mac was not an alternative for me).

Since I met Linux I fell in love with the penguin operating system, its philosophy and its fantastic terminal, so I started testing it on my home computer, with all the compatibility issues it involved at the time, when you spent half a day installing and two more looking for drivers. However it was a new experience and, although frustrating, totally rewarding when you achieved this sense of accomplishment. Of course, for me it was no more than an experiment for many years.

Half of my professional life revolved around Windows, from my first jobs as a microcomputer technician to managing servers and services based on Microsoft OS. I even studied at a Microsoft partner academy and got certified in Microsoft Windows Server 2012. It wasn’t until early 2013 that I had my first professional experience with Linux on an old web server that someone had to maintain. Indeed, that someone was me and I devoted many more hours than necessary to that lonely server.

Like many of you, I find myself in the following position: I love Linux and its ecosystem but it seems to me that Microsoft does a very good job on its OS and, for some reason, I always end up coming back to it. The ideal thing would be to have the best of both worlds. I’ve tried dual boot, virtualization, and cwin, but none felt like a full experience. I thought it was the best I could get even if it wasn’t ideal and just moved on, until Microsoft announced WSL.

What is WSL?

WSL stands for Windows Subsystem for Linux, which was nothing more than a compatibility layer for native Linux environments within Windows. Its first version was announced in 2016 and it was big news. I remember having the Ubuntu 16.04 terminal running natively on Windows and thinking “this is what I’ve been waiting for, everything I need without losing compatibility”.

Unfortunately WSL, although very useful, had several shortcomings: all the executions were interpreted, there was no access to all the hardware of the machine, the overall performance was quite poor, etc. I didn’t stop using it, but it wasn’t suitable for everyone. Still, it was the first step. In 2019 they announced WSL2, which would no longer be interpreted, it would have the entire native Linux kernel and would be running on Windows at full performance. WSL2 was recently released for all Windows 10 2004 version users. It seems that having everything I needed is now becoming a reality. It’s not perfect, that’s for sure, but it’s impressive how well it works.

Why WSL2 and not a Linux distro?

“It depends”, that’s the answer. Many of you, due to company policies, will not be able to change the OS of your computer or will be stuck with Windows for using the Office suite or Adobe tools, or even because you feel more comfortable on Windows rather than Linux.

In my case, I have the freedom to choose the operating system I use, my company does not enforce any restrictions as long as it stays updated and has an antivirus active. I have tried using Linux straight away and in the end I always have to go back to Windows or virtualize it and I prefer to virtualize Linux on Windows rather than the other way around.

In my day to day I have many different tasks, although I have a WSL2 terminal always open on one of my virtual desktops, I spend half of the day in meetings with different providers (webex on Linux is a nightmare). I use different VPNs and virtual client desktops, I edit videos for Pandora FMS YouTube channel, etc. And I do many of these things with tools that do not work quite well in Linux, so WSL2 has given me the almost perfect solution for my daily tasks.

(If you think you would be interested in reading an article about my workflow and all the tools I use, leave a message in the comment box).

Deploy WSL2

If you are here, it is because you relate to one of the cases here exposed. Installing WSL2 is very simple, but let’s go step by step.

Remember that you must have Windows 10 version 2004 or higher to be able to use WSL2.

Checking it is as simple as pressing the start key, typing winver and pressing enter.

wsl2

It will show you a screen like this, where you will see Windows 10 version.

wsl2

If you comply with the correct Windows version, let’s get to work. If not, it is time to go update Windows.

Step 1: Enable WSL on your system.

The easiest way is to open a PowerShell terminal as administrator and run:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

Don’t close the terminal or restart yet.

Step 2: Enable virtualization.

Execute the following command in the PowerShell terminal open as Admin.

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Now restart the machine.


Step 3:
Activate WSL version 2 as default.

Open a PowerShell terminal again as administrator and execute:

wsl --set-default-version 2

You will see a message similar to: “WSL 2 requires an update to its kernel component. For information, please visit https://aka.ms/wsl2kernel”. Go to the URL and download the package following the wizard steps.

wsl2

Step 4: Download the distro, preferably from Windows store. Type in wsl in the search engine so that the options come out (personally I use Arch, but it is not in the store so it is a bit more complicated to install). I recommend installing Ubuntu, the first to be released and in my opinion the one with the most covering support.

wsl2

Once downloaded, open it and the distro installation will start. It will ask for the username and password. For the Linux system you can set the one you prefer, it has nothing to do with the Windows user.

wsl2

Once the installation is finished, you will see a screen similar to the following and the prompt ready to use Ubuntu bash.

wsl2

Step 5: Check the installation from a PowerShell terminal, executing:

wsl --list --verbose

Where it will list the distros installed and their versions. I already said that it used arch and yes I also have Windows running in WSL2 for Docker. In your case, it will show just the one that you have installed, in this case Ubuntu, and it would have to be version 2.

wsl2

Conclusions

With these simple steps you will have Ubuntu installed within Windows with its kernel at 100% and you can run all the tools you need, such as Docker natively directly in the Linux kernel (something that before with HyperV was not working for me and that WSL1 did not support).

Implementation is not perfect, it has many advantages but it also has some problems to figure out. Even so, I think it is the best current implementation to have a hybrid system where to enjoy the best of both worlds, so I recommend it 100%.

If you are interested in the subject, we can write an article listing the advantages, disadvantages and alternative solutions to certain problems that this technology currently poses. Let me know if you are interested in the comments.

About Version 2 Digital

Version 2 Digital is one of the most dynamic IT companies in Asia. The company distributes a wide range of IT products across various areas including cyber security, cloud, data protection, end points, infrastructures, system monitoring, storage, networking, business productivity and communication products.

Through an extensive network of channels, point of sales, resellers, and partnership companies, Version 2 offers quality products and services which are highly acclaimed in the market. Its customers cover a wide spectrum which include Global 1000 enterprises, regional listed companies, different vertical industries, public utilities, Government, a vast number of successful SMEs, and consumers in various Asian cities.

About PandoraFMS
Pandora FMS is a flexible monitoring system, capable of monitoring devices, infrastructures, applications, services and business processes.
Of course, one of the things that Pandora FMS can control is the hard disks of your computers.