Notes:All commands (especially the WSL related ones) may change according to the WSL updates.
Open "Windows Features and tick the corresponding option, or using the Powershell command:
% Powershell
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
For x64 systems: Version 1903 or higher, with Build 18362 or higher.
Open "Windows Features and tick the corresponding option, or using the Powershell command:
% Powershell:
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
WSL2 Linux kernel update package for x64 machines
(https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi)
% Powershell:
wsl --set-default-version 2
Open the Microsoft Store, select and install your favorite Linux distribution.
I choose Ubuntu here.
- Search Apps & features in the Start menu
- On the Apps & features page in the Settings app, type Ubuntu, or the name of the Linux distribution you want to reset, in the ‘Search this list’ box.
- Ubuntu, or the name of your Linux distribution, will appear. Click it and see "Uninstall" and then click Advanced options for "Reset".
- Check the wsl related commands:
wsl -
orwsl --help
- Check the detail info. of all distributions (including running status):
wsl -l -v
- Shut down all runing distributions:
wsl --shutdown
- Terminate a specific distributions:
wsl -t <Distro>
- Check Ubuntu version:
lsb_release -a
- Update:
sudo apt update && sudo apt -y upgrade
- Check all installed package:
sudo dpkg --list
- Check all install software:
sudo apt list
- Remove files:
rm
- Remove folders: 1. empty directory
rmdir
2. non-empty folderrm -r
Note: Windows 10 is going to release official GUI support (waiting for official release)
Everything is out of box ! with some good handy features as well. It also features a file system browser which you can easily visit, copy, and delete folds and files in the WSL-Ubuntu system (includes text editor to directly open text files).
https://mobaxterm.mobatek.net/
-
VcXsrv ( if you want to torture yourself...)
https://sourceforge.net/projects/vcxsrv/
Run the following commands or attach them at the end of the
.bashrc
file in your home directory to avoid doing it everytime open the WSL. (Use mobaXterm browser or nano editornano ~/.bashrc
)export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):0.0 export LIBGL_ALWAYS_INDIRECT=1 sudo /etc/init.d/dbus start &> /dev/null
Difference between Vanilla Xfce desktop and the one install through
tasksel
https://linuxconfig.org/install-xfce-xubuntu-desktop-on-ubuntu-20-04-focal-fossa-linux
-
X410 ($10,有试用)
设置比VcXsrv更简单,但是用anaconda-navigator 测试时,Default setting's DPI scale is none,貌似需要自己设置一下,见下方的reference link
https://medium.com/@japheth.yates/the-complete-wsl2-gui-setup-2582828f4577
X410:
https://x410.dev/cookbook/wsl/using-x410-with-wsl2/
https://x410.dev/cookbook/running-x410-on-hidpi-screens/
https://code.visualstudio.com/docs/remote/wsl
Anaconda, by definition, servers as a sandbox that permits you to install packages into strictly defined environments. As long as you're working within one of those environments (running the activate command), your environment will see only those packages that you've installed into it. So you can basically using the one come with Anaconda and ignore the python 3 come with the Ubuntu installtion.
To see if the conda installation of Python is in your PATH variable:
- On macOS and Linux, open the terminal and run echo $PATH.
- On Windows, open an Anaconda Prompt and run echo %PATH%.
To see which Python installation is currently set as the default:
- On macOS and Linux, open the terminal and run which python.
- On Windows, open an Anaconda Prompt and run where python.
-
Go to Anacoda website and obtain the corresponding version download link (https://www.anaconda.com/products/individual)
-
Go to Linux terminal (the download link I used is the one below):
wget https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh
-
Install Anaconda using :
sudo bash ~/Anaconda3-2020.11-Linux-x86_64.sh
Note that the default install location may be displayed as "/root/anaconda3", then change it to the location
/home/carls_hyx/anaconda3
according the the Anaconda doc in the reference link. When prompted "Do you wish the installer to initialize Anaconda3", enteryes
. -
To make sure the installation will take place effectively, simply reload the shell:
source ~/.bashrc
-
Then try
conda --version anaconda-navigator
-
If the above command not work after restart the terminal. then conda has not modified your shell scripts. In order to initialize after the installation process is done, first run
source /home/carls_hyx/anaconda3/bin/activate
and then runconda init
. -
Spyder GUI: If you want use Spyder come with Anaconda (which I don't anymore, I use VScode under Win10 instead). Try the following:
sudo apt-get install qtbase5-dev
(source: microsoft/WSL#1246)conda update qt pyqt -c conda-forge
(source: spyder-ide/spyder#4426)
- check out the reference link below.
- 如果碰到权限问题,check 当前目录文件(夹)权限:
ls -l ~
- Change the users 权限:
sudo chown -R carls_hyx:carls_hyx /home/carls_hyx/anaconda3/
https://www.how2shout.com/how-to/install-anaconda-wsl-windows-10-ubuntu-linux-app.html