When we develop programs on Windows, we run into all sorts of annoying problems, and sometimes we have to move to Linux. However, with this article you will be able to solve any problems you may encounter developing on the Windows platform.
1. Chocolate Package Manager
For developers, to build the development environment is the first step in all the sectors of development, however under the Windows environment, installation tools, software version is multifarious, and easy to download software to the virus, so for beginners, download the correct software development, build good development environment or skilled. Has the certain difficulty.
If I wanted a package management tool on Windows like the one on Linux or MacOS that would let me download the environment with a single command and add the path to the environment variable without having to do it myself, there are package management tools that already exist. Chocolate Package Manager happens to be one of the best and easiest ways to build a development environment in a Windows environment.
Package manager, also known as software package management system, is a combination of tools that automatically installs, configures, uninstalls and upgrades software packages in computers. It is widely used in the installation and management of various system software and application software.
- Website: https://chocolatey.org/
- Installation documentation: https://chocolatey.org/install
- Chocolate Packages:https://chocolatey.org/packages
After Chocolate is installed, all Windows environments, including Node, NPM, Python, Java, Git, Filezilla, etc., are installed using this tool. All packages do not need to be manually managed from now on.
2. Windows Subsystem for Linux
If we want to be able to comfortably learn and use Linux on Windows, Microsoft has solved this problem and solved it well.
The Windows subsystem for Linux lets developers run the GNU/Linux environment as-is – including most command-line tools, utilities, and applications – without incurring virtual machine overhead.
2.1 installation WSL
Installed website address: https://docs.microsoft.com/zh-cn/windows/wsl/install-win10
2.2 Upgrading WSL1 to WSL2
WSL2 installation instructions: https://docs.microsoft.com/zh-cn/windows/wsl/wsl2-install
2.2.1 Upgrading to Win10 or later:
- To ensure you are using version 18917 or higher, join the Windows Preview Experience Program and select the “Fast” or “Slow” ring.
- Check Windows for updates and restart the system
- Viewing the Windows Version
Settings –> System –> About
2.2.2 Ubuntu UPGRADE Windows 2 A message is displayed indicating that the requested operation cannot be completed due to virtual disk system limitations. Virtual hard disk files must be unzipped and unencrypted, and cannot be sparse.
Open the directory C: UserslenovoAppDataLocalPackagesCanonicalGroupLimited UbuntuonWindows_79rhkp1fndgsc
When it asks whether you want to apply to just this folder or to all subfolders and files, you can say “just this folder”, because all you’re doing is clearing that “compress” flag.
2.2.3 WSL2 and Win10 File systems Access each other
In WSL2, everything is exactly the same as Linux. Unlike WSL1, which translates system calls, WSL2 is based on virtual machines, but the virtual machine is not isolated from Windows. You can edit and change Windows files in Linux, and you can edit and change Linux files in Windows, and they’re interoperable, and if you launch a localhost application in Linux, You can access it directly in your browser using localhost.
Take Ubuntu as an example. Ubuntu accesses Win10 files: the Win10 file system is mounted under Ubuntu/MNT
Windows 10 To access the Ubuntu file system, simply run Explorer. Exe in Ubuntu Terminal. Command to view the Ubuntu system files
2.3 ZSH + oh – my – ZSH
- ZSH official website: https://github.com/zsh-users/zsh
- Oh-my-zsh website: https://ohmyz.sh/
First, install ZSH
sudo apt-get install zshCopy the code
Change the default Shell to ZSH
chsh -s /bin/zshCopy the code
Oh – my – ZSH installation:
$ sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"Copy the code
Change the ZSH theme:
$ vi .zshrc
ZSH_THEME="ys"Copy the code
3, Windows Terminal
If you want to have a good command line tools, Microsoft launched Windows Terminal, support multi-tab, custom styles, GPU text rendering, a variety of shortcuts, screen splitting, JSON custom configuration, etc.
The official address: https://github.com/microsoft/terminal
4, VSCode Remote
With the support of the above three, and combined with VSCode, developing on the win platform is no longer as troublesome as before. At least, there are no problems of developing on the win platform, combining with the development environment, and not getting unix-like experience, etc.
Win10 SSH connection error, protocol mismatch, use VSCode Remote to connect to WSL
So far, Win10 development environment build complete!!