Under Windows subsystem WSL thinking

In a forum today to see the WSL news.

What is WSL

Baidu Encyclopedia quoted passage:

Windows Subsystem for Linux (short WSL) is a binary executable file to run Linux (ELF format) is on the Windows 10 natively compatible layer. It is a collaboration with Canonical developed by Microsoft, the goal is to make pure Ubuntu 14.04 "Trusty Tahr" images can be downloaded and expanded into a local computer user, and the tools and utilities in the image can natively run in this subsystem.

Between the physical machine and the virtual machine system Linu

Linux is actually a subsystem of the Windows environment, according to my tests, if you do not shut down many Windows services, use the experience worse than a virtual machine (my computer might be too much garbage). . . It very easy and convenient.

I do not know whether the installation WSL on a virtual machine in win10 (in the end is a virtual copy of the kernel or just virtual kernel interface, which is a problem, it seems necessary to look at VMware principle, but fortunately the code open source), Worth a try.

installation

  1. Enable or disable Windows features

First, in the search in the search bar and open the "enable or disable Windows features", check the "Windows subsystem for Linux" item. This setting is only open to install WSL normal. It can restart, save the state attention

  1. Installation WSL

Microsoft's application store in search Linux, you can see a list of Linux distributions, they need to choose according to their own release, here I use Ubuntu 18.04 LTS, started after the download is complete, wait for the installation is complete, enter the account and password

View Files
1. If you want to see the other partitions in Linux, WSL can be mounted in the other letter under / mnt.

2. If you want to see the WSL file location in Windows, the absolute file path: C: \ Users \ username \ AppData \ Local \ Packages \ CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc \ LocalState \ rootfs

Other settings, such as updating the software source, language, the kernel update, packages, and other operations, consistent with the physical machines running Linux system command.

Windows10 linux subsystem is not a virtual machine, but the subsystem is part of Windows and not as isolated as the virtual machine and the host system, all files in windows in the Linux subsystem has mapped, run some in the Linux subsystem in dangerous directive also affects Windows.

ps1

Sometimes Windows can not delete files exist under

The following questions arise:
Under Windows can not delete a file, not able to find the item.

The reason
Windows index files are missing.
Solution:
use WSL subsystems can be deleted.
problem solved

WSL is not seen by calling the NT interface to achieve the purpose, perhaps to the performance of POSIX system calls direct calls to the file system layer API, also can imagine, if you also want to call the top-level interface that performance is bound to decline.

Windows NT, API is the underlying operating system application WINDOWS operating system for developers to write programs provided (such as front window, automatic shutdown, etc.) reserved function interface. These interfaces can be seen by the plurality of operation composed of the bottom is not enough, a direct call to affect certain performance.

ps2

Ps1 by the association to elevate administrator privileges
to delete critical system files under windows command as follows

rd /D /S

But in general Windows administrators do not have sufficient permissions to delete critical system files.
Provide an idea, Windows system tray can be mounted on the WSL, then use the Linux command rm -rf/*to delete critical system files Windows. Because it is not a virtual machine, it is a living system. Ha ha ha.

The PS
WSL to root (I installed linux kali, the case may be)
Kali-User root config --default

In this case, there are several issues still did not understand, the division of authority Windows system in the end is how, with the permission WSl What is the difference, why the low-privilege mode operation WSL can delete Windows administrator user can not do, do the WSL root privileges higher than Windows administrator privileges.

Personal understanding: the highest authority can be understood as the system itself, because Windows is not free and open source system, closed part of the operation, and most Linux systems are just a high degree of freedom of the open source family of operating systems. So leave all the user operation, the user is aware of their need to do, you do not need to suddenly pop up a dialog box to guide the user. This seems to be logical, but not yet viewed WSL official documents, another day have time to look. . .

1. commercial operating system into part of open source operating system, and that the original open-source operating system will become part of the pay. This is for the development of the open source operating system is detrimental.

2. The type and quantity of virus for the Windows operating system is very large, if WSL widely used, it can be an indirect attack Linux with Windows, which for attacking Linux systems, more dangerous. Microsoft does not know what the follow-up methods will be used to ensure Windows WSL not to attack. Personal thoughts: As the WSL and the Windows kernel like two pipes inserted into the large pool (not virtual cores), the perhaps can be solved by adding a four-way filter approach.

Perhaps these questions in the official documentation has been resolved, taking the time to really need to look at official documents.

Head a bit big. . .

Published 160 original articles · won praise 43 · views 80000 +

Guess you like

Origin blog.csdn.net/weixin_43590389/article/details/104069037