The virtual machine VMware Workstation Pro is installed and configured using the server system ubuntu-22.04.3-live-server-amd64.iso

Install ubuntu-23.04-beta-desktop-amd64 in the virtual machine and enable SSH (source change and backup) to configure Chinese and Chinese input methods, etc.

?1. Get Ubuntu Server Edition

Get Ubuntu Server Edition

2. Configure the virtual machine

SelectCustom(advanced):

SelectWorkstation 17.x:

Select “I will install the operating system later.

Select “Linux“:


Name the virtual machine and location:

Processor configuration:

Virtual machine memory configuration:

Network type select “NAT-Network Address Translation”:

If you want to cancel DHCP (dynamic IP, dynamic allocation of IP addresses, which means the IP address is not fixed), set a fixed IP, set it here Use bridged network: [I use this method]

Select IO controller type-select recommended:

Select Disk Type – Select Recommended:

Create new virtual disk:

Specify disk capacitySplit the virtual disk into multiple files:

Name the vmdk file:


Select the downloaded ubuntu-22.04.3-live-server-amd64.iso file:

3. Start installation

3.1 Start installation

Select Try or Install Ubunu Server:


Select Language:

continue without updating – Continue without updating:

Keyboard layout default:

Select Minimal installation:

3.2 Network settings


Edit IPv4:

Edit ens33 IPV4 configuration (ens33 is the network interface name):

Change to Manual:

Edit ens33 IPV4 configuration:

View Windows IP settings:

The ubuntu-22.04.3-live-server-amd64 network configuration written with reference to WindowsIP Configuration is as follows:


After save, static IP and network configuration is completed, select Done and press Enter:
Note: You must save here, otherwise it will affect the later detection of the image source.

There is no need to configure Proxy address on the Configure proxy configuration page. Select Done and press Enter:

3.3 Configure mirror source

//Mirror source of University of Science and Technology of China
https://mirrors.ustc.edu.cn/ubuntu

//aliyun mirror source
http://mirrors.aliyun.com/ubuntu

University of Science and Technology of China Mirror Source passed the test:

aliyun mirror source passed the detection:

Solution to [Mirror source cannot pass test]:
If there is a problem, first check whether the mirror source address is correct. If it still fails to pass the test, click Back to check the IP and IP address just configured. Is the network configuration correct?

I found that Gateway and Name servers were clearly configured but no longer available:
Just check this location

Reconfiguration:

Detected again, aliyun image source passed the test:

Tested again, the image source of the University of Science and Technology of China passed the test:

3.4 Installing the system

Select the installation disk and press Enter to assign it automatically by default:

Check whether the disk partition meets your requirements and press Enter to continue:

Confirm again to continue:
Set computer name, user name and password:

Update to Ubuntu Pro – skip now:

Select to install the OpenSSH Server service – press the space bar:


Install microk8s:
kubernetes for workstations and appliances(k8s)

Install docker:
Docker container runtime
Installation list summary:

Installation process:

Installation completed Select Reboot NOW:

3.5 Restart the system

Please remove the installation media and press the enter key – Just press enter.


Login interface:

4. Obtain root user

4.1 Obtain root user

4.2 Back up source files sources.list and sshd_config files

etc/apt/sources.list

/etc/ssh/sshd_config

Log in as djc user:

//Install net-tools (net-tools is required when using ifconfig)
sudo apt install net-tools

//Check ip and find the value of inet
ifconfig


Backup source file sources.list:
//1-Switch to root user
su root
//2-Backup source filessources.list
cp /etc/apt/sources.list Please put a space here /etc/apt/ sources.list.backup2023921djc
Or (directly execute the following command under ordinary user djc)
sudo cp /etc/apt/sources.list Enter a space here /etc/apt /sources.list.backup2023416djc

Backup sshd_config file:
//1-Switch to root user
su root

//2-Back up sshd_config file
cp /etc/ssh/sshd_config Enter a space here /etc/ssh/sshd_config.backup2023921.djc

Or (directly execute the following command under ordinary user djc)
#sshd_config.backup2023416.djc is the name of the new backup file
sudo cp /etc/ssh/sshd_config Enter a space here /etc/ssh/sshd_config.backup2023921.djc


View the backup file sshd_config.backup2023921.djc:

cd /etc/ssh/
cat sshd_config.backup2023921.djc
or
cat /etc/ssh/sshd_config.backup2023921.djc

4.3 Modify the contents of sshd_config

The root user cannot log in directly from the command line or graphical interface. This is because the ubuntu system default root user cannot log in directly and needs to log in as a normal user first. user ($), and then use the su root command to switch to the root user (#).

After correctly setting up and using the root user, you will find that the root user still cannot directly log in to remote login software such as xftp, and you want to directly log in to root remotely >User needs to configure the system sshd_config file, which is located in /etc/ssh/sshd_config.

4.3.1 Modify content

Install vim:

apt-get install vim

#The specific steps are as follows:
1. Edit sshd_config
sudo vi /etc/ssh/sshd_config
or
sudo vim /etc/ssh/sshd_config

2. Use the i key or the insert key to open the editing mode. If you use this mode for the first time, there is a high probability that it will become ABCD when you use the ↑ ↓ ← → direction keys.
characters, how to solve the problem so that you can use the arrow keys to move the cursor and edit and modify files.
Refer to 4.3.2 Solution to the problem that the arrow keys turn into letters under Ubuntu


3. Change PermitRootLogin prohibit-password to PermitRootLogin yes, and remove the # sign in front, indicating that root login is allowed. .
   Remove the # in front of port 22.
 
  Or (2023-9-21 20:06:55 added)
3. Delete the # symbol in front of port 22.
After the Authentication configuration, add PermitRootLogin yes to allow root login.
   


4. Save (ESC key to exit i mode, :wq! Save and exit, ! means force) (here are "colon:", "letter w", "letter q", "exclamation point!", press in sequence)

5. Cat /etc/ssh/sshd_config or cat sshd_config to check whether the modification is successful

6. Restart the SSH service (last step).
service ssh restart
or
/etc/init.d/ssh restart

1. Edit sshd_config:

cat sshd_config:

Restart SSH service (last step):
Root users can already directly log in remotely (No need to first Log in as a normal user and then log in as root through the su root command):


Directly log in to root through a black window in VMware Workstation Pro:


Successfully log in as root through a black window in VMware Workstation Pro:

Restart the SSH service (last step), then exit the system and log in again. At the same time, the root(#) user can already log in directlyxftp Wait for remote login software. And if you want to use the root user in the command line or graphical interface, you do not need to log in as a normal user ($) first, and then use the su root command to switch to root user(#).

Note: The dollar sign $ will be displayed at the end of the ordinary user name, and the will be displayed at the end of the root username. Display the # symbol to distinguish different types of users.

After using the sudo vi command to edit sshd_config, press the English letter i key to turn on the insert mode to edit the content, ↑↓ ←→Direction keys control cursor position.
Here, if press the direction keys and find the letters ABCD, you need tofix this error. Move cursor position. For specific methods, see 4.3.2 Solution to changing arrow keys to letters in Ubuntu.

4.3.2 Solution to change the direction keys into letters in Ubuntu
# 1. Uninstall the vi editor of the system
sudo apt-get remove vim-common
# 2. Install the latest vim editor
sudo apt-get install vim

5. Reference

Install ubuntu-23.04-beta-desktop-amd64 in the virtual machine and enable SSH (source change and backup) to configure Chinese and Chinese input methods, etc.