Anniversary Update of Windows 10 added support for the Linux environment in Windows 10 in 2016. But do not be deceived: it's more than just a bash shell. This is a full compatibility layer for running Linux applications on Windows.
We've included a lot of things in opening a new partition of Windows 10, so we've included all those guides here in a mega-list for your convenience.
As Fall Creator Update at the end of 2017, you no longer have to enable Developer Mode in Windows, and this feature is no longer a beta.
Since it is a low or low full Ubuntu user-space environment, you can install software in other ways. For example, you can compile and install software from source code on Linux distribution.
If you have installed another Linux distribution, then use the command to install software on that specific distribution. For example, openSUSE uses the zypper command.
You may have multiple Linux distributions installed, and you can also run many different Linux environments at once.
If you are not sure what to install, then we recommend Ubuntu. But, if you need a specific Linux distribution-you may be testing software that runs on a server running SUSE Linux Enterprise Server or Debian, or you want a security test tool in Black Linux-that is, to get the help of Ubuntu Are available in the store as well.
The Linux distributions you create a hidden folder where all the files used in that Linux environment are stored. If you want to view and back up Linux files with Windows tools, you can access this folder from Windows, but Microsoft warns you that you should not modify these tools with Windows tools or Windows applications Along with this you should create new files.
When you are in the Linux environment, you can access your Windows drive from / mnt / under the folder. Your C: drive is located at / mnt / c and your D: drive is located for example / mnt / d. If you want to work with files from within Linux and Windows environments, then place them anywhere in your Windows file system and access them via the / mnt / folder.
However, you can mount them manually and access them in a Linux environment with a special mount command that takes advantage of the drvfs file system.
For example, you can use Zsh open instead of Bash. When you open a Linux shell shortcut in your Start menu, you can also switch to Zsh Open automatically even when you open Standard Bash.
You can include batch scripts in batch script or power shell script, which is very easy. For all of this, see our guide for Bash script in Windows 10.
If you run this command from within the command prompt or PowerShell window, the command prints the output on the command prompt or PowerShell console.
You can do a lot with bash -c or wsl. You can create a desktop shortcut to launch a Linux program, integrate them into batches or power shell scripts, or run in any other way that you run the Windows program.
To run a Windows program, type the path for a .exe file and press Enter. You will find your installed Windows program in the Bash environment under the / mnt / c folder. Remember, the order is case-sensitive, so "example.exe" is different from "example.exe" in Linux.
However, it will not work by default. Before you can run the graphical Linux desktop program on your Windows desktop, you must install an X server and set the DISPLAY variable. The simpler the application, the better the work will be. The more complex the application, the more likely to try Microsoft's underlying Windows subsystem for Linux, it is not supported yet. All you can do is give it a shot with these instructions and hope for the best.
Even if you have multiple Linux installs, you can launch it directly by running commands such as Ubuntu or OpenSUSE-42. The exact command you need is written on the download page of every Linux distribution on Microsoft Store.
This article also provides the instructions for adding the file explorer to the "open bash shell" option by editing the Windows registry, which gives you a convenient context menu option similar to the "Open PowerShell Window" or "Open Command Prompt Here" option. Works.
To get the latest system without reloading the Linux distribution, you can run the command of the distribution with the Windows Command Prompt or the "Clean" option from PowerShell Console. For example, to reset Ubuntu without reloading, clear Ubuntu.
If you still have an old Linux environment installed - that was installed before the Fall Creators update - you can still uninstall it with the lxrun command.
However, if you have built a bash environment on older versions of Windows, then you will have an old Ubuntu environment installed. You can simply open the store, and you can install the latest Ubuntu from the Windows Store to upgrade.
We've included a lot of things in opening a new partition of Windows 10, so we've included all those guides here in a mega-list for your convenience.
Everything You Can Do With Windows 10’s New Bash Shell |
Getting Started with Linux on Windows
You can install a Linux environment and bash shell on any version of Windows 10 including Windows 10 Home. However, it requires a 64-bit version of Windows 10. All you have to do is enable the Windows subsystem for Linux features, and then install your chosen Linux distribution - for example, Ubuntu from the Windows Store.As Fall Creator Update at the end of 2017, you no longer have to enable Developer Mode in Windows, and this feature is no longer a beta.
Install Linux Software
The simplest way to install Linux software in your Ubuntu (or Debian) environment is with the apt-get command. (The apt command also works.) This command downloads and installs software from Ubuntu software repositories. You can download and install one or more applications with only one command.Since it is a low or low full Ubuntu user-space environment, you can install software in other ways. For example, you can compile and install software from source code on Linux distribution.
If you have installed another Linux distribution, then use the command to install software on that specific distribution. For example, openSUSE uses the zypper command.
Run Multiple Linux Distributions
Fall Creator Update also enabled support for several Linux distributions, where Ubuntu was previously only available. Initially, you can install Ubuntu, OpenSUSE Leap, SUSE Linux Enterprise Server, Debian GNU / Linux, or Black Linux. Fedora is also on the way, and we will probably offer more Linux distribution in the future.You may have multiple Linux distributions installed, and you can also run many different Linux environments at once.
If you are not sure what to install, then we recommend Ubuntu. But, if you need a specific Linux distribution-you may be testing software that runs on a server running SUSE Linux Enterprise Server or Debian, or you want a security test tool in Black Linux-that is, to get the help of Ubuntu Are available in the store as well.
Access Windows Files in Bash, and Bash Files in Windows
Your Linux files and Windows files are generally different, but there are ways to access your Linux files from Windows and your Windows files from the Linux environment.The Linux distributions you create a hidden folder where all the files used in that Linux environment are stored. If you want to view and back up Linux files with Windows tools, you can access this folder from Windows, but Microsoft warns you that you should not modify these tools with Windows tools or Windows applications Along with this you should create new files.
When you are in the Linux environment, you can access your Windows drive from / mnt / under the folder. Your C: drive is located at / mnt / c and your D: drive is located for example / mnt / d. If you want to work with files from within Linux and Windows environments, then place them anywhere in your Windows file system and access them via the / mnt / folder.
Mount Removable Drives and Network Locations
Windows subsystem for Linux automatically mounts fixed internal drives under the / mnt / folder, but it does not automatically mount removable drives such as USB drives and optical discs. It does not automatically mount any network drive that can be mapped to your PC.However, you can mount them manually and access them in a Linux environment with a special mount command that takes advantage of the drvfs file system.
Switch to Zsh (or Another Shell) Instead of Bash
While Microsoft basically kept this feature as a "bash shell" environment, it is actually an underlying compatibility layer that allows you to run Linux software on Windows. This means that if you like them then you can run other shells rather than Bash.For example, you can use Zsh open instead of Bash. When you open a Linux shell shortcut in your Start menu, you can also switch to Zsh Open automatically even when you open Standard Bash.
Use Bash Scripts on Windows
Thanks to this environment, writing the Bash shell script on Windows and running it is actually possible. Your bash script can access your Windows files stored under the / mnt folder so that you can use Linux commands and scripts to work on your normal Windows files. You can also run Windows commands from within the Bash script.You can include batch scripts in batch script or power shell script, which is very easy. For all of this, see our guide for Bash script in Windows 10.
Run Linux Commands From Outside the Linux Shell
If you just want to launch a program, execute the command, or run the script, then you do not even need to launch the Bash environment first. You can use the command bash -c or wsl to perform Linux commands from outside Linux shells. The Linux environment runs the command and then leaves it.If you run this command from within the command prompt or PowerShell window, the command prints the output on the command prompt or PowerShell console.
You can do a lot with bash -c or wsl. You can create a desktop shortcut to launch a Linux program, integrate them into batches or power shell scripts, or run in any other way that you run the Windows program.
Run Windows Programs From Bash
As creators updates (which came in spring 2017), you can run the Windows program from within the Linux environment. This means that you can integrate Windows commands with Linux commands in Bash scripts, or just run Windows commands from standard bash or JS shell, which you are already using.To run a Windows program, type the path for a .exe file and press Enter. You will find your installed Windows program in the Bash environment under the / mnt / c folder. Remember, the order is case-sensitive, so "example.exe" is different from "example.exe" in Linux.
Run Graphical Linux Desktop Programs
Microsoft does not officially support graphical Linux software on Windows. Windows SubSystems may be required to run command line program developers for the Linux feature. But using this feature is actually possible to run a graphical Linux desktop program on Windows.However, it will not work by default. Before you can run the graphical Linux desktop program on your Windows desktop, you must install an X server and set the DISPLAY variable. The simpler the application, the better the work will be. The more complex the application, the more likely to try Microsoft's underlying Windows subsystem for Linux, it is not supported yet. All you can do is give it a shot with these instructions and hope for the best.
Choose Your Default Linux Environment
If you have multiple Linux distributions installed, you can choose your default installation. When you launch the Linux distribution with a bash or wsl command, or when you use the bash -c or wsl command to run Linux commands elsewhere in Windows, this distro occurs.Even if you have multiple Linux installs, you can launch it directly by running commands such as Ubuntu or OpenSUSE-42. The exact command you need is written on the download page of every Linux distribution on Microsoft Store.
Quickly Launch Bash From File Explorer
You do not need to launch Linux open from your shortcut icon. You can launch it from inside the file explorer by typing "Bash" in the address bar and pressing Enter. Your default Linux distribution will open the bash, and the current working directory will be the directory that you had opened in the file explorer.This article also provides the instructions for adding the file explorer to the "open bash shell" option by editing the Windows registry, which gives you a convenient context menu option similar to the "Open PowerShell Window" or "Open Command Prompt Here" option. Works.
Change Your UNIX User Account
When you first set up the bash, you are asked to create a UNIX user account and set a password. You will be automatically signed in to this account every time you open the Bash window. If you want to change your Unix user account - or want to use root account as your default account - then there is a hidden command to change your default user account.Uninstall and Reinstall a Linux Environment
After installing some programs or changing some settings, you want to restore Ubuntu or any other Linux distribution and want to get a new Linux environment. It was a bit complicated earlier, but now you can do it by uninstalling Linux distributions like you can restore it to another application and then from the store.To get the latest system without reloading the Linux distribution, you can run the command of the distribution with the Windows Command Prompt or the "Clean" option from PowerShell Console. For example, to reset Ubuntu without reloading, clear Ubuntu.
If you still have an old Linux environment installed - that was installed before the Fall Creators update - you can still uninstall it with the lxrun command.
Upgrade Your Ubuntu Environment
After the fall creator update of Windows 10, you now have to install Ubuntu and other Linux environments from the store. Once you complete it, they will be updated automatically in the latest versions of the special order.However, if you have built a bash environment on older versions of Windows, then you will have an old Ubuntu environment installed. You can simply open the store, and you can install the latest Ubuntu from the Windows Store to upgrade.
0 Comments