Skip to main content

Linux on Windows? Yes you can!!

Ever heard of WSL?? Windows Subsystem for Linux! This basically helps you run Linux binary executables on Windows 10 and Windows server 2019.WSL let developers run a GNU/Linux enviroment - inculding most command-line tools,utilities,and application directly on windows 10,unmodified with any virtual machine or dual boot setup.

You can:
  • Choose your favourite GNU/Linux distribution from the Microsoft store.
  • Run command-line such as grep,sed,awd or other ELF-64 binaries.
  • Run bash shell scripts and GNU/command-line applications including:
    • Tools like vim,emacs,tmux
    • Languages like C,C++,C#,Ruby,Python,Go,Rust,NodeJS,etc
    • Services like SSHD,Mysql,Apache,Lighttpd,MongoDB etc
  • Install additional software using own GNU/Linux distribution package Manager
  • Invoke windows application using Unix like command-like shell.
  • Invoke GNU/Linux application on windows.
WSL version 1 was introduced on the windows fall creator update version 1709 and WSL version 2 was released on Windows feature MAy 2020 update version 2004.

WSL 1:

WSL verion 1 was initially released on 2nd August 2016. WSlL 1 is able to run some graphical applications(such as Mozilla Firefox), by installing X11 server within windows (host) environment(such as VcXsrv or Xming), although not with caveats, such as lack of audio or hardware acceleration(resulting in poor graphics performance).
Also it is not capable of running all Linux software, such as 32-bit binaries or those that require specific kernel services. Due to lack of any "real" Linux kernel in WSL version 1kernel modules, such as devices drivers can't be run. However, WSL version 2 makes use of live virtualized Linux kernel instances.

Microsoft stated that WSL was designed for the development of application and for desktop computers or production services.

SYSTEM REQUIREMENTS FOR WSL VERSION 1:

Before installing WSL, make sure your computer meets the following minimum system requirements:
  • You must be running Windows 10 version 1607 or above
  • WSL will only run in 64-bit version of Windows 10. 32-bit version is not supported.
To check if you meet these requirements:
  1. Open you settings. You can do it by clicking the gear icon on start menu or by opening Power user task menu and choose Settings.
  2. In settings choose system.
  3. On left side of System choose, choose About.
  4. On the right of window, system information is displayed. MMake sure version is at least 1607 and the system type is 64-bit operating system.

WSL 2:

Microsoft, on 6 May 2019, announced WSL 2, which features completely new VM-based backend(based on a subset of Hyper V Features).It was introduced with many major changes such as Linux kernel etc. The new version of Windows Subsystem architecture powers Windows Subsystem for Linux to run ELF 64 Linux binaries on Windows. Its primary goals are to increase file system performance, as well as adding full system call compatibility. 

The new architecture changes how these Linux binaries interact with Windows and your computers hardware, but still provides the same user experience as in WSL version 1.

Support of OpenCL and CUDA is not being implemented currently, although planned for future releases.



SYSTEM REQUIREMENT FOR WSL VERSION 2:

To install WSL version 2, you need following requirements:
  • Windows 10 Insider Preview Build version 19041 or above.
  • WSL 2 will be, generally available for windows 10, version2004.
  • A computer that supports Hyper-V visualization.

HOW TO INSTALL WSL ON WINDOWS 10:

  • Open Power shell as administrator and run the following command:

  • Some necessary software will download and WSL will be enabled after you reboot your system.
  • When the download is complete, powershell will ask you if you are ready to reboot your computer. Before rebooting, make sure all of your important documents are saved and all other applications are closed. 
  • After you computer reboots open the command prompt or powershell and rum the folling command:

  • Bash will inform you that no distribution is installed and give you URL for downloading one from windows store.
  • Go to windows store and download Linux distribution of your choice. If you are not sure what to pick, we recoomend you to pick Ubuntu.

  • Click the distribution of your choice and then click "GET".

  • When installation is complete, click on "LAUNCH". It will take few minutes to complete the installation.
Note:

You may receive the following error: 

        Installing, this may take a few seconds...
     Installation failed!
     Error: 0x8000000d
     Press any key to continue...

This error is a known bug that has occurred for some versions of windows 10. If you get this error, you can fix it by repeating first two steps and then continue with step steps mentioned below.

  • Ubuntu is now installed and WSL is enabled. You can enable WSL ubuntu command prompt by clicking on the launch button on the windows store or in the start menu by choosing UBUNTU. You can also open command prompt and run bash.
  • The first time you launch a newly installed Linux distribution, a console window will open and you will be asked to wait for a minute or two for the files to de-compress and store it on your PC. All further launches must take less than a second.
  • You will the need to create a user account and password for your Linux distribution.
UPDATE TO WSL 2:

Before updating, make sure you update the windows version if it is lower that 19041.
  • Enable the Virtual-Machine Platform optional component. To do so open powershell as administrator and run:

  • Restart your computer.
  • Download WSL 2 kernel update(required)
  • Double-click the wsl_update_x64.msi file and apply the update.
  • Now open powershell and type the following command:

  • Enter the following command to convert distro from WSL 1 to WSL 2:
    • wsl --set-version<distribution name><version>
    • ex:
  • To confirm you distro are using the wsl 2:
    • Open the powershell(as administrator) and run the following command

    • Confirm the version of distro:






 


Comments

Popular posts from this blog

Android 11 beta version is HERE!!

Android 11 Beta (18 th Version of Android Operating System) was unveiled on some of the devices like Pixel 2, 3, 3a, and 4 . Google dropped  Android 11 Developer Preview   on Wednesday, February 19, and the  second preview   on Wednesday, March 18. The company then released the  third Android 11 Developer Preview   on Thursday, April 23. Then in a surprise announcement, Google released an unplanned  fourth Android 11 preview   on May 6.   Android 11 Beta Features: Android 11 Beta has comes with many new and exciting features . It focuses  on three main Key Themes: People, Privacy and Controls.   Redesigned Notification bar: · Conversation notifications  appear in a dedicated section at the top of the shade, with a people-forward design and conversation specific actions, such as opening the conversation as a bubble, creating a conversation shortcut on the home screen, or setting a reminder.      · Bubbles  ...

All About Competitive Programming!!

  Programming is a challenging role and once you enter this field you will encounter new challenges and you may have to solve some problems which no one has solved before or their solution doesn’t exist anywhere. At that time you are expected to come up with a solution in the least possible time using your problem-solving and logical ability. So the one and clear goal behind these competitive programming is  “ To prepare a programmer such that his/her logical ability increases and he/she is able to write code for the challenging situation. ” Another reason is that a lot of big companies like Google, Facebook. Microsoft, Amazon hires through competitive programming so if you want to get into these companies then you really need to get your hands dirty in competitive programming. It doesn’t matter you are a newbie programmer or you have written some code before, we will tell you some steps, approaches, and tips to prepare yourself for competitive programming. Let’s discuss that ...

All about TIK-TOK and the guy who Reverse-Engineered it !!

WHAT IS TIK-TOK? Tik-Tok is a social networking platform where users can upload 15 second videos. Users can add music clips and sounds to their videos, and even act out dialogues from popular movies and TV shows. Tik-Tok also offers editing tools like merge, cut, trim, duplicate. Before TikTok there was musical.ly, another product from the same parent company, ByteDance ,Later they merged with  Musical.ly's 100 million monthly active users were automatically moved to TikTok. ALL ABOUT ByteDance..... ByteDance is a Chinese multinational internet technology company  headquartered in Beijing owing products like Tik-Tok,  BUZZ  video ,  VIGO  video and  Helo . Moreover,   ByteDance  is currently valued at more than $75 billion and is recognized as an  A...