• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
cropped CodeSpecialist e1592127475203

Code Specialist

Code and Programming Blog

  • Home
  • Clean Code
  • Code Principles
  • Code Interview
  • Python

How to use Linux Ubuntu with Windows 10

If you are a developer or plan to become one, developing on Windows as the operating system (OS) can be... pretty unpleasant. Therefore I want to list some ways on how to use Linux Ubuntu 20.04 with Windows 10. Often it's no option to install the Linux OS directly to the computer. That's when virtualization comes into play.

Home » Environment » How to use Linux Ubuntu with Windows 10

September 29, 2020 by Yannic Schröer Leave a Comment

Contents hide
1 General information
2 Distributions
3 Reasons to use Linux
3.1 Security
3.2 Stability
3.3 Developer friendlyness
4 Hypervisor/Virtual Machine Monitor
4.1 Why is it important?
5 Using Ubuntu with VMWare Player
5.1 How to set up VMWare Player
6 Using Ubuntu with Windows Hyper-V
6.1 How to set up Hyper-V
7 Using Ubuntu with WSL (Windows Subsystem for Linux)
7.1 How to set up WSL
8 Some last words

General information

In this case, we will elaborate on how to do this using a current version of Windows 10, and our target OS will be Ubuntu 20.04 LTS. By the way, if you ever wondered what LTS means: LTS stands for long-term support, meaning updates, support, and bug fixes are granted for up to 60 months after release. Ubuntu is released twice a year – in April and October – which results in their version designation. So 20.04 LTS means it was released in April 2020 and will be supported until April 2025. LTS versions of Ubuntu are usually released in April in even years, so every two years.

Distributions

Linux comes in various distributions, and depending on which source you trust, different ones are the most popular. We will attach a poll below this post to evaluate our readers’ used distribution, but we assume the information to be correct until then. According to various sources, the 10 most popular Linux distributions are:

  1. Ubuntu
  2. Debian
  3. Cent OS
  4. Fedora
  5. Red Hat
  6. Arch Linux
  7. SUSE
  8. Linux Mint
  9. Gentoo
  10. Mandriva

I am sure this isn’t the correct order, and the chances I even missed popular ones are high. This is merely my personal assessment. But I am also pretty sure I never used 6 of these 10. Some might want to stone me, but in my opinion, the choice of the specific Linux OS is more a taste than a functionality decision.

Reasons to use Linux

Even so, this shouldn’t be an article about how awesome Linux is. If you are here, you most likely have your reasons and decided you want to use a Linux distro. Nevertheless, I will name a few reasons that should motivate you even further to use Linux for development.

muscular penguin as symbol for strong linux

Security

Linux was first released in 1991, 6 years after the first Windows version, enough time to look into some major problems the Windows OS had, such as the vulnerability. Linux was designed to be secure. Many actions are restricted to a superuser, the Linux equivalent to an administrator under Windows. Thereby viruses and malware can do little to no harm to your system. Some distributions even deactivate the so called root user by default, increasing the security even more. If not, a profound first step under Linux should be to create a new user with Sudo-rights instead of using the default user with overpowered root rights.

Another reason for high security is its open-source nature. Since everyone can take a look into the very depths of Linux and any of its components, basically, every security issue has already been found by someone and has been fixed.

Stability

Did you ever wonder why your Windows machine seems to slow down significantly after like a year? Me too. And I can’t tell you why that is, but what I can tell you is that my Ubuntu distribution seems to run the same speed no matter how long it is installed.

Another huge advantage is that it doesn’t need to be restarted after each minor or major update. You may install the update and keep it running. The kernel itself is very stable and nearly immune to crashes.

These are also why Linux servers are that popular – they naturally have very high uptime and thereby perfectly fit the needs of many in the current now-economy.

Developer friendlyness

Besides being totally free of charge (we all know developers are always broke), Linux supports developers in several ways.

It supports nearly every major programming language and a nearly endless variety of applications and IDEs. But the most compelling reason for myself is the Bash console. Bash is short for Bourne-again shell. Its a tribute to the original UNIX shell inventor Steve Bourne. Nearly any task and action on the OS can be performed on the shell with ease, and it is effortless to automate complex tasks.

Hypervisor/Virtual Machine Monitor

Before we jump right into 3 of many possible ways to use Linux under Windows, I want to make some notes about the Hypervisor or Virtual Machine Monitor (VMM) as it is crucial for deciding which technique to use in which specific cases.

A hypervisor can be classified as one of two possible types: type 1 and type 2. The type 1 hypervisor is also called a bare-metal hypervisor, and type 2 is often called a hosted hypervisor.

Type 1 and type 2 hypervisors
Animated picture of type 1 and type 2 hypervisors

Even though the principle now seems obvious, not everything you may virtualize directly on your OS is instantly a type II hypervisor. For instance, the Windows subsystem for Linux (WSL) is available in two versions, 1 and 2. WSL version 1 is a type 2 hypervisor, whereas WSL version 2 is a type 1 hypervisor as it uses the hyper-v technique.

Why is it important?

In short: performance. The additional layer in a type 2 hypervisor increases the time instructions need from the OS to the hardware. Even though these times are nearly non-measurable, the slightly increased latency sums up.

But why would anyone use a type 2 hypervisor then? Because its easier. For the type 1 hypervisor, your hardware must be hyper-vised directly by your operating system (OS), whereas in the type 2 hypervisor, the host OS will take care of all the drivers and translations. Also, if you think of techniques like Docker, it can even be intended that the OS runs decoupled from direct contact to the hardware.

Using Ubuntu with VMWare Player

The first way I want to show to use Linux Ubuntu 20.04 with Windows 10 is the VMWare Player. The VMWare Player is a type 2 hypervisor and an enterprise software by VMWare. It is reasonably priced and even free for personal usage in the workstation version. You may find it at:

https://www.vmware.com/products/workstation-player.html

How to set up VMWare Player

The installation of the VMWare Player is straight forward, and you shouldn’t encounter any issues. However, you may have to enable the virtualization feature of your CPU in your BIOS to run a virtual machine with it. As this is different to every CPU and mainboard, I can’t tell you if it is enabled by default or where you may find it if it isn’t. You should find this information in your mainboards documentation or various posts on the net.

Once you have installed the player and downloaded a Linux Ubuntu installation image (https://releases.ubuntu.com/20.04/), you can create a virtual machine via “Create a new Virtual Machine”. This, again, is straightforward, and you shouldn’t encounter any issues.

Pros
  • User friendly design
  • Supports multiple displays
  • Supports any resolution
  • Supports over 200 distributions of guest OS
Cons
  • Cryptic error messages
  • No snapshots available
  • Pro version required to run more than one machine at the same time
Want to know more about WSL2? (Affiliate)

Using Ubuntu with Windows Hyper-V

Another way to use Linux Ubuntu 20.04 with Windows 10 is Hyper-V. Hyper-V is a Windows built-in feature to host virtual machines. It is available under Windows 10 Pro and Windows Server 2008 R2 or later. Hyper-V is a type 1 hypervisor; thereby, it is slightly more efficient than the VMWare Player. But I honestly can’t see any obvious performance differences on the frontend.

How to set up Hyper-V

Before you follow the steps, you have to enable the virtualization feature of your computer CPU. As I said, Hyper-V is a Windows feature; there is nothing to download or install. Navigate to “Turn Windows features on or off”:

Windows features activate hyper-v
Windows features: Activate Hyper-V

Once you’ve selected Hyper-V and restarted your computer, the Hyper-V Manager is available in your apps. From here on, everything is easy to grasp, and you shouldn’t encounter any issues.

Pros
  • Allows as many instances as your hardware can manage
  • Well manageable virtual networks
Cons
  • Does not support multiple displays
  • Maximum resolution 1920 x 1080px

Using Ubuntu with WSL (Windows Subsystem for Linux)

Last but not least, there’s another way to use Linux Ubuntu 20.04 with Windows 10 is WSL, the Windows Subsystem for Linux. As described in the Hypervisor section, WSL comes in two major versions: WSL and WSL2. Though this sounds like WSL2 is simply the successor of WSL, it isn’t the case. As WSL is a type 2 hypervisor and WSL2, a type 1 hypervisor, they both have their determined usage and reason for existence. Microsoft announced that they do not desire to discontinue development or support for either of these versions.

FeatureWSL 1WSL 2
Integration between Windows and Linux✓✓
Fast boot times✓✓
Small resource foot print✓✓
Runs with current versions of VMware and VirtualBox✓✓
Managed VM✗✓
Full Linux Kernel✗✓
Full system call compatibility✗✓
Performance across OS file systems✓✗
Source: https://docs.microsoft.com/windows/wsl/compare-versions

Depending on the specific case, you should decide yourself which version fits you better.

WSL comes without a graphical interface. Its purpose is simply to use a Linux kernel/file system and all its advantages.

How to set up WSL

The installation process has improved significantly in the last years. First, navigate to your windows features and enable “Windows Subsystem for Linux” and “Virtual Machine Platform”.

Windows features activate virtual machine platform and windows subsystem for linux
Features that must be enabled in order to use WSL2

Alternatively use these commands in the shell to activate the features:

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

Restart you machine. Now you can set the desired version of your WSL via:

wsl --set-default-version 2

If you encounter the error, “WSL 2 requires an update to its kernel component. For information, please visit https://aka.ms/wsl2kernel“, go to https://docs.microsoft.com/de-de/windows/wsl/wsl2-kernel and download and install the Linux kernel update package.

Next, go to the Microsoft Store and install “Ubuntu 20.04 LTS” for free. You may now use WSL by simply opening the “Ubuntu 20.04 LTS” app or executing “wsl.exe” via the command prompt.

If you encounter any registration issues like “The virtual machine could be started because a required feature is not installed” when installing Ubuntu, this is possible because you did not activate your CPUs virtualization feature yet. Check out your mainboard’s documentation to determine how to activate it or google it (as any sane computer scientist would do).

Video: How to set up WSL2

As you can see, WSL even works on a VM itself, which can be a major advantage.

Pros
  • Integrates seamlessly into windows
  • High performance
  • Can be fully integrated into IDEs e. g. PyCharm
Cons
  • No graphical user interface

Some last words

No matter for which solution you decide, all these solutions have their pros and cons but are, in my opinion, also the best solutions you will be able to get your hands on for free. However, this list isn’t complete, and there are many substitutes available for each of these. If you don’t need your Windows features or rely on any applications that run solely under Windows, you could also consider installing it directly to your hard drive.

I hope I could bring the available methods on how to use Linux Ubuntu 20.04 with Windows 10 closer to you.

Below we attached the promised poll about your OS for development. If you encounter any issues, don’t hesitate to write to use or comment, we will look into it and supplement it here.

yannic schroeer
Yannic Schröer

I am a developer and entrepreneur from Germany. I chose studying computer science because I love building things. I am of the opinion that there isn’t one truth (especially for computer science concepts) and whoever claims so isn’t that trustworthy in my eyes. I constantly try to improve things and myself. In my spare time I support businesses by offering them most of my services for free. Beside that I am kind of addict to e-learning courses.

Category iconEnvironment,  Learn to Code,  Technical Background Tag iconUbuntu 20.04,  Virtualization with Windows

Related Posts

decoration on dark grey table
Decorators in Python
February 23, 2021
bubble sort in python preview
Bubble Sort in Python and how to Visualize it
February 2, 2021
kmeans preview
Visualize K Means Algorithm in Python
January 31, 2021

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published.

Primary Sidebar

Search

Categories

  • Algorithms
  • Cloud
  • Code Interview
  • Code Principles
  • Environment
  • Errors
  • Hardware
  • Learn to Code
  • Nice to know
  • Object Orientation
  • Python
  • Technical Background
  • Write Better Code

Tags

Alternative (1) Announcement (1) Clean Code (7) Cloud Foundry (1) Cloud Native (1) Code (1) Code Interview Question (2) Code Philosophy (1) Comments (1) Computer Graphics (2) Concurrency (1) Control Characters (1) Data Science (1) Data Structures (1) decorators (2) dictionaries (3) Easter Eggs (1) funny (1) Github Actions (1) Marching Cubes (1) Meshing (1) Microservice (1) Nice to know (1) Parallelisation (1) Programming Facts (1) Pythonic (3) PyYAML (1) Readability (4) Simple is good (2) Software Engineering (2) switch (1) Syntax (1) Tricks (1) type hints (1) Ubuntu 20.04 (1) Underscores (1) Unix (1) Video (1) Virtualization with Windows (1)

Footer

Recent Posts

  • Cloud Foundry Components
  • No matching distribution found for pkg-resources==0.0.0
  • SOLID Principles with Python Code Examples
  • 5 Hardware Ideas to Upgrade your Programming Experience
  • 5 Programming facts every programmer must know

Tags

Alternative Announcement Clean Code Cloud Foundry Cloud Native Code Code Interview Question Code Philosophy Comments Computer Graphics Concurrency Control Characters Data Science Data Structures decorators dictionaries Easter Eggs funny Github Actions Marching Cubes Meshing Microservice Nice to know Parallelisation Programming Facts Pythonic PyYAML Readability Simple is good Software Engineering switch Syntax Tricks type hints Ubuntu 20.04 Underscores Unix Video Virtualization with Windows

Categories

  • Algorithms
  • Cloud
  • Code Interview
  • Code Principles
  • Environment
  • Errors
  • Hardware
  • Learn to Code
  • Nice to know
  • Object Orientation
  • Python
  • Technical Background
  • Write Better Code

Recent Comments

  • Nina on Bubble Sort in Python and how to Visualize it
  • Bhan on Concurrency in Python

Follow Us

  • Facebook
  • Instagram
  • Pinterest
  • Twitter

Quicklinks

  • About us
  • Become a writer
  • Guest Post

Privacy Policy | Legal Notice | Contact

 

All rights reserved © 2020-2021 code-specialist.com