VMware virtual machine installation Ubuntu 20.04-server detailed graphic tutorial

Table of contents

1. Installation steps

1. Select language

2. System update 

3. Set up the keyboard

4. Configure dynamic IP address

5. Server Proxy

6. Set the mirror source address 

7. Configure Storage

8. File system

9. Create a user

10. Ignore it, just skip it

11. Install SSH service

12. Other tools

13. The system configuration is complete, and the installation interface

15. Login interface

2. Configure static network

1. View current ip

2. Check the gateway

3. Modify the configuration file

3. Enable root default login

1. Log in to the system as an ordinary user and create a password for the root user

2. Modify the sshd configuration

3. Restart the sshd service

Fourth, replace the yum source

1. Here we first open the directory where the source is stored

2. Add the following information to the configuration file

3. In order to make the modified content take effect, we need to update the system, enter the following commands in sequence:

4. Install common tools


Ubuntu download official website

Alibaba Open Source Mirror Station-OPSX Mirror Station-Alibaba Cloud Developer Community  The download speed is faster:

This time, VMware Workstation 16 is used for installation!

1. Installation steps

After starting up, various inspections will be carried out first, and wait for a short while until the installation interface appears, and all subsequent operations must be confirmed with the Enter key!

1. Select language

Select the language as English:

2. System update 

Prompt that we can update the system version, choose not to update:

3. Set up the keyboard

Select the keyboard layout, we will use the default American English keyboard layout here, press Enter directly:

4. Configure dynamic IP address

        Next, select the network connection, and you can see that my virtual machine has a network card called ens32. This is a virtual network card generated by VMware. By default, DHCP (dynamic IP allocation) is used. In practice, the server uses a fixed IP, and here In order for the virtual machine to directly access the external network to download software packages, we first use the default DHCP method to connect, and then modify the IP if it is necessary to access a fixed IP. Enter directly:

5. Server Proxy

        Next, choose a proxy server, and you can understand it by reading the English explanation. If your virtual machine cannot directly connect to the external network, but it is connected to a proxy server, and the proxy server can connect to the external network, you can fill in the address of the proxy server here. To allow your virtual machine to access the external network through a proxy, we directly press Enter:

6. Set the mirror source address 

        Next, select the mirror source for installing the software package. Ubuntu’s default official mirror source is very slow to download. We need to replace it with other domestic mirror sources. Here I change it to Alibaba Cloud ( https://mirrors.aliyun.com/ubuntu/ ) or Tsinghua mirror source (https://mirrors.tuna.tsinghua.edu.cn/ubuntu/) and press Enter:

7. Configure Storage

        Next, configure the storage boot. I only created a 30GB hard disk, chose to use the entire hard disk, and installed LVM. LVM is a tool for managing disks. Encrypt below means encryption. We don’t need disk encryption. If you don’t choose, these They are all default values, so in fact, just press Enter directly:

8. File system

 Display a summary of the file system created on the disk, just press Enter:

Then you will be prompted that you are performing a destructive operation, the data on the previously selected hard disk will be lost, and the installation process is irreversible, select Continue and press Enter:

9. Create user

        Next, you need to create some user information, the first is your name (Your name), this is like the windows account you registered on windows, it is a similar name. The second is the computer name (Your server's name), which is the computer name you see when you open "My Computer" in windows, which marks the entire computer with the ubuntu system installed, which may be useful when connecting to the network. The third is the username (username), this is very important, it is the first user you created on this ubuntu system. Further down is the password corresponding to the user name, and confirm the password again.

10. Ignore it, just skip it

11. Install SSH service

        Next, you will be prompted whether to install  the SSH  tool, mainly to connect to the linux externally, because it is too difficult to operate inside. This is used to connect to the server remotely. Move to Install the OpenSSH service and press the space bar to check it, then move to Done and press Enter:

12. Other tools

 Next, you can install some tools, we don’t need it, just move to Done and press Enter:

13. The system configuration is complete, and the installation interface

After the installation is complete, the upper left will display "Installation complete!" with white characters on an orange background.
After the installation is complete, the update will start automatically. You can move to the bottom to cancel the update and restart. This is the case at this time:

This will cancel the update that was in progress before restarting. It will take some time to cancel the installation update before restarting:

You can also wait for the update to be installed (wait patiently), the following becomes "reboot" to restart

This time choose to wait for the update to complete.

14. After restarting, the following interface will appear, prompting you that the ISO image used for installation cannot be uninstalled. The current situation is equivalent to restarting after installing the system, and the boot disk is still plugged into the computer. If it is installed on a physical computer, unplug the boot disk and press Enter. The virtual machine does not need to be ignored, just press Enter:

15. Login interface

After restarting, enter the login interface and enter the previously configured user and password:

So far, Ubuntu has been installed successfully!

2. Configure static network

1. View current ip

If the ifconfig command cannot be used, first use ip a to view the ip

#安装net-tools 使用ifconfig命令
sudo apt update -y 
sudo apt install net-tools -y

2. Check the gateway

route -n

As shown in the figure above: the name of the network card is  ens32 , the current ip is  192.168.78.133 , the subnet mask  is 255.255.255.0 , and the gateway address is 192.168.78.2

3. Modify the configuration file

sudo vim /etc/netplan/00-installer-config.yaml

# This is the network config written by 'subiquity'
network:
  ethernets:
    ens32: #网卡名称
      dhcp4: no  #关闭dhcp
      addresses: [192.168.78.130/24]  #设置静态ip
      gateway4: 192.168.78.2 # 网关
      nameservers:
              addresses: [114.114.114.114, 8.8.8.8] #nds
  version: 2

sudo netplan apply #使配置文件生效

The configuration was successful: 

3. Enable root default login

Because there is no file in the 20.04LTS version  /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf , most of the baidu results are not suitable

If there is this file, move to: ubuntu20 Log in with root - tangxiaosheng - 博客园

1. Log in to the system as an ordinary user and create a password for the root user

sudo passwd root

Then enter the set password and enter it twice, thus completing the setting of the root user password

Use sudo su to enter the root user

2. Modify the sshd configuration

1、 sudo ps -e |grep ssh    #查看是否安装了SSH服务
(如果显示为空则没安装,如果安装了省略2-5步)

2、sudo apt-get update    #先更新下资源列表

3、sudo apt-get install openssh-server   #安装openssh-server

4、sudo ps -e |grep ssh              #查看是否安装成功

5、sudo service sshd start             #重新启动SSH服务 (或者用命令 sudo systemctl restart sshd)

6.进行配置
sudo vi /etc/ssh/sshd_config
把PermitRootLogin prohibit-password 注释掉
增加一行 PermitRootLogin yes  

eg:
# Logging
#SyslogFacility AUTH
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
permitRootLogin yes
#PermitRootLogin prohibit-password
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

3. Restart the sshd service

sudo systemctl restart sshd

Fourth, replace the yum source

1. Here we first open the directory where the source is stored

vim /etc/apt/sources.list

Since we replaced the mirror source of Alibaba Cloud when we installed Ubuntu earlier, there is no need to change it.

If you encounter the default Ubuntu official image source, you can manually modify it!

2. Add the following information to the configuration file

Alibaba Cloud mirror source

In order to replace the original source, we first need to comment out the original source, enter 【#】in front of each source to comment it out,
and then paste the source of Alibaba Cloud just copied here

deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

3. In order to make the modified content take effect, we need to update the system, enter the following commands in sequence:

apt update #只更新不升级,已安装的软件包是否有可用的更新
apt list --upgradable #显示可更新包的具体信息
apt upgrade -y #更新所有包
注意:这可能是个危险操作。
如果你的开发和生产环境依赖特殊版本,则需要使用以下命令升级指定某个包到特殊版本

apt upgrade xxx=1.0.0

4. Install common tools

apt -y install net-tools tree wget lrzsz bash-completion build-essential

--lrzsz使用方式:
命令 rz -be 从本地上传文件到服务器
命令 lz -be xxx(文件名)从服务器的文件上传到本地

bash #使bash-completion命令补全包生效

build-essential 是一个meta package,它依赖一篮子软件包,gcc及make方式

Guess you like

Origin blog.csdn.net/weixin_46560589/article/details/125618060
Recommended