Use the built-in nano
editor as:
nano ~/.bashrc
The most important shortcuts for nano
are Ctrl+O to save the file and Ctrl+X to close the editor.
A simple guide for using nano
can be found in the Gentoo Linux Wiki.
Windows 10 itself does not support GUI. In order to run GUI in wsl you need to install a X server and get it to configure correctly.
I would suggest you to install VcXsrv to display GUI.
I am not able to run GUI successfully by sudo apt-get install ubuntu-desktop
. However, I successfully installed mate-desktop GUI in Debian and ubuntu.
Here are the steps for me to display GUI by wsl. You can check my videos on detailed steps Install GUI (mate desktop) to Microsoft Windows Subsystem Linux
step 1:
install Debian or Ubuntu Linux subsystem:
- PowerShell as administrator: Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
- Microsoft Store: install "Debian" or "ubuntu"
step 2:
install mate tesktop for Debian:
- open Debian in windows 10. Type the following commend
- sudo apt-get update
- sudo apt install task-mate-desktop
OR install mate-desktop for Ubuntu
- open Ubuntu console in windows 10
- sudo apt install tasksel
- sudo apt update
- sudo tasksel install ubuntu-mate-desktop
step 3:
install VcXsrv in windows 10:
- download from: https://sourceforge.net/projects/vcxsrv/
- open XLauch, and use the following options for setup
- select: "One large window"
- Display number: 0
- next
- Start no client
- next
- finish
step 4:
setup display in linux console:
- export DISPLAY=:0
- export LIBGL_ALWAYS_INDIRECT=1
step 5:
start Mate-desktop environment:
- run mate-session
Step 3 and step 4 are extremely important to display GUI in windows 10 wsl.
Best Answer
At a Windows 10 command prompt, run
ver
. Is the next-to-last numeric group version 18917 or higher? If so, it is possible you have WSL 2 but not yet verified. Go on to step A or B.If you do not see Windows version 18917 or higher, you have version 1.
This illustrates the result when the OS is Build 16299:
A. Open Windows PowerShell and enter the command
wsl -l -v
. If version 2 is installed properly, you will see the version number. If you don't see a version number, or if you see an error message (Thank you, Cornea Valentin) you have version 1. Uninstall it then reinstall it as per https://scotch.io/bar-talk/trying-the-new-wsl-2-its-fast-windows-subsystem-for-linuxB. From the WSL shell prompt, run
uname
. If the kernel version => 4.19, it's WSL Version 2.Why is this relevant?
WSL 1 was based on Microsoft's Linux-compatible kernel interface, a compatibility translation layer with no Linux kernel code.
WSL 2 was redesigned with a Linux kernel running in a lightweight VM environment, and innovators have found many more things they can do with WSL 2.
Windows 10 Version 2004 (build 19041.153 & later) enhances WSL2 further; see https://devblogs.microsoft.com/commandline/wsl2-will-be-generally-available-in-windows-10-version-2004/ and https://winaero.com/blog/wsl2-will-ship-with-windows-10-version-2004-with-kernel-updates-via-windows-update/ .