There are three main ways to build a Linux environment on a Windows computer:
directly installing it on a physical machine; using virtual machine software; and using a cloud server.
Since the Linux desktop is very unfriendly to use, this article mainly describes how to use 虚拟机
and 云服务器
set up a Linux environment.
Note: It is not recommended to install the virtual machine on the C drive. If you refuse the Ares on the C drive, start with me!
Virtual machine to build Linux environment
To build an environment using a virtual machine, you need to download the virtual machine software VMware Workstation Player
and image files. centos7/ubuntu
The official download address of the virtual machine software: VMware Workstation Player
image file recommended download address: Tsinghua University Open Source Software Mirror Station
Step 1: Install virtual machine software
Virtual machine software installation tutorial.
Open the official website and click on the free download on the VMware Workstation Player official website.
After clicking, the following interface will appear and clickGO TO DOWNLOADS
Because we are a Windows system, we need to download a virtual machine prepared for Windows - 64 bit, as shown in the figure.
When the above interface appears, it means that the download has started. After the download is successful, just click Next. Change the installation location to the D drive (remember this address). No additional operations are required thereafter. Finally, click Install. You may need to wait for a while. meeting.
After the installation is successful, you will be prompted to enter the key. There is no need to click on the license.Click directly to complete。
Step 2: Install the contos7/ubuntu image file
The virtual machine installed with the contos7 image file is convenient for typing commands, and the virtual machine installed with the ubuntu image file has a visual interface, and you can choose it as needed.
After opening the image file installation website given at the beginning of the article, the following interface will appear:
Click on the 4.4GB address to start downloading the image file.
It must be placed outside the C drive. If the default download address is on the C drive, you can copy the downloaded file. Finally, paste it into the D drive or E drive (remember the address). This has no effect. After the download is completed, go to the next step.
Step 3: Install the virtual machine
Open VMware Workstation Player, click Create Virtual Machine
, click Browse, find the address of the downloaded image file, and then click 下一步
The full name here is the name of the created virtual machine.
The username is equivalent QQ号或其他账号
to the password 账号密码
. This account and password are the account and password used when logging in to the virtual machine.
Click Browse to switch the installation location of the virtual machine.
It is recommended that the size of the virtual machine is 20GB, click Next.
When the preparation is complete, click Finish.
When you see the interface below, it means it is being created.
The following interfaces will appear one after another.
Once the installation is complete, click Skip this version.
The following interface appears, indicating that it has been installed. Next, you only need to enter the account and password you used when creating the virtual machine.
Cloud server builds Linux environment
Note in advance: It costs money to use a cloud server, but you can try it for free for 3-4 months at the beginning.
Cloud servers include: Tencent Cloud, Alibaba Cloud, Baidu Cloud, and Huawei Cloud. Here we use Tencent Cloud as an example.
Open the official website of Tencent Cloud,
log in and search in the search box 校园
. If you are not under 25 years old, you cannot enjoy the student discount, just search directly 云服务器
.
When we normally use Linux to write code, we 2核2G
can just use the configuration directly. It is more affordable to buy it directly for one year.
Just select the mirror configuration CentOs 7.6
.
After purchasing, click on the console on the main interface
Enter, lightweight server options
Click to reset password (you cannot log in to the cloud server without resetting the password)
Copy this ip address. This is your own public IP address.
Step 2: Download Xshell, this software can be used to log in to the cloud server.
Xshell download official website
After downloading Xshell and opening it, the above pop-up window will appear. Just click on the wrong number.
Enter: in this terminal interface ssh root@公网IP
to start logging in to the cloud server.
After entering the reset password, click OK.
Seeing last login indicates that the cloud server login is successful.
Then you only need to open it in the future Xshell
to log in to the cloud server and use Linux.