In the last article , We mainly talked about ： stay
Windows In the system , install
WSL Subsystem .
WSL It just looks like
Linux nothing more , Although in this subsystem , We can execute Linux Program , But at the bottom ,
WSL The call is still
in other words ：WSL Just an adaptation layer .
later , Microsoft finally released
WSL2 This real
Linux Subsystem , This is a real Linux Full kernel , With traditional virtual machines
VMWare equally , But it has better interoperability with the host .
For completeness , Let's continue to finish the process .
Problems encountered in this process 、 Required installation software and other resources , Has been uploaded to the network disk , There is a download address at the end of the text .
Before we start , Let's take a look at the current computer
WSL Version of .
Windows Command line window , Input instruction ：
wsl --list --verbose( Or enter a simplified version ：
wsl -l -v), Get the results ：
You can see what we installed in our last article
WSL The version is
If you want to upgrade to
Windows The kernel version of the operating system must meet certain requirements , as follows ：
We will follow the official requirements , Check if your computer meets your needs ： choice
Windows Winkey Win + R, Then type.
winver, choice “ determine ”.
It seems that my system can meet the requirements , Then go on to the next step ！
If your kernel version does not meet this requirement , Can search for keywords “WIN10 Get internal preview version ”, You can find a solution .
Continue to start as Administrator
PowerShell, Then execute the command ：
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
here , It's time to restart the computer again ！
After reboot , Continue to
PowserShell in , hold
Ubuntu-18.04 Set to
WSL2 edition .
The command entered is ：
wsl --set-version Ubuntu-18.04 2
This step may encounter such problems ：
resolvent ： Download from Microsoft's official website WSL2 Linux Kernel upgrade package , Download address is ：
WSL2 Linux Kernel upgrade package
You can also download it from the network disk at the end of the text
After downloading , All the way
Next Can be installed .
here , stay
PowerShell Re execute in
wsl --set-version Ubuntu-18.04 2 Instructions ( Need to wait for a while , Probably
1 About minutes )：
meanwhile , hold
WSL The default version of is changed to
wsl --set-default version 2.
here , Let's execute the instructions
wsl -l -v Let's have a look at , It becomes
WSL2 Version of the ：
Now? , Restart
Ubuntu-18.04 System , Although it is still a dark window , But it's a complete 、 Pure Linux operating system ！
The operation of this part , Reference resources ：https://autoize.com/xfce4-desktop-environment-and-x-server-for-ubuntu-on-wsl-2/.
Linux Desktop environment for , It is associated with
Windows There are some differences in the concept of desktop environment .
Linux In the system , The desktop environment is a stand-alone application , Not part of the operating system .
In other words , Even without a desktop environment , You can also have a good time
Linux System , Such as those servers and other devices .
Linux The desktop in consists of client and server , They communicate through a protocol , Be commonly called ：
Server side ： Responsible for graphic display ;
client ： According to the system settings DISPLAY environment variable , Send the request to display graphics to the server ;
therefore , To make our
Ubuntu Display the graphical interface , We need to install a server software and client software .
Be careful ： The server software here is installed in
Windows In the system , The client is installed in
Ubuntu-18.04 In the system .
Ubuntu-18.04 In the terminal window , Execute the following instructions to install the client software
sudo apt-get update && sudo apt-get upgrade -y sudo apt-get install xfce4
Ubuntu Client in
xfce4 You need to send the display request , Send to... Over the network
Windows The server on , So we need to know
IP Address , stay
Windows View... In the command line window in the system ：
And then in
Ubuntu-18.04 Middle handle this
IP Address , Configure... In the home directory
.bashrc In file ：
$ cd $ vi .bashrc
Add at the end of the file ：
preservation 、 After closing the file , perform ：
source ~/.bashrc Update can .
The graphical interface has
Xming Two software , We choose the front
alike , I have already put vcxsrv-126.96.36.199.0.installer.exe Put it in the net disk , Download all the way
Next install .
After installation , start-up
Windows On the table
XLaunch Program :
then , Follow the configuration in the reference document , as follows ：
In the last step , You can save the configuration information on the desktop .
Ubuntu-18.04 Command line window in the system , Execution instruction ：
At the moment , The artifact happened ： Yours Windows Does the system jump out of the following window ：
You can open it on the desktop
File System, Did you see many familiar figures ？
In the open
mnt Catalog , Did you see
Windows Drive letter in the system ？
however , Chinese information is displayed in garbled code ！ Then let's install the Chinese language support package .
Ubuntu-18.04 System command line window , Set up
here , Windows in our desktop environment can be used , As shown in the figure below ：
sudo vi /etc/locale.gen
Copy the blue line in the figure below , Then remove the front
Space , Then save 、 sign out .
Then execute instructions in the terminal ：
The user name in the upper right corner of the stand-alone , choice 【Log Out..】
Ubuntu The virtual machine
xfce4 The client will exit , Re execution
startxfce4 Start client ：
Again , In the terminal window on the desktop , hold
locale Change to Chinese ：
sudo vi /etc/default/locale
LANG=C.UTF-8 Change it to
then , Install the following Chinese language packs into it ：
sudo apt install language-pack-zh-hans sudo apt install language-pack-gnome-zh-hans sudo apt install language-pack-kde-zh-hans
At the moment , Look at those random codes just now , Have you displayed Chinese correctly ？
Next , You can also install various
IDE, Explore how they share files ...
The software to be installed in this article , It has been uploaded to the network disk .
Please reply in official account. 721( It's not a message area ), You can receive the download address , thank you ！
【1】C Language pointer - From basic principles to fancy techniques , With graphics and code to help you explain thoroughly
【2】 Step by step analysis - How to use C Implement object-oriented programming
【3】 original gdb The underlying debugging principle is so simple
【4】 Is inline compilation terrible ？ After reading this article , End it ！