创建虚拟机


选择镜像
系统默认
仿真、16G
host、2核
2G内存

引导顺序修改

安装系统(无桌面版)

如若需要,可以选择够 go back,回到引导页面,重新选择步骤
↑↓←→选择,enter确认,space选项勾选/取消(引导页面有说明)

启动虚拟机, 选择install

语言English



网络配置


用户密码设置


时钟

分区




yes

扫描其他媒体

no

配置包管理

选择中国
选择包镜像

安装选项,去除desktop、gnome,保留ssh和standard system

boot引导,选择yes


重启

之后等安装完,设置引导顺序重启

设置

ip设置

ifconfig找不到:apt install -y net-tools
vim, apt install -y vim

1
vim /etc/network/interfaces
1
2
3
4
5
6
7
8
9
10
11
12
auto lo
iface lo inet loopback

# The primary network interface
# allow-hotplug ens18
# iface ens18 inet dhcp
auto ens18
iface ens18 inet static
address 192.168.7.231
netmask 255.255.255.0
gateway 192.168.7.1
dns-nameservers 8.8.4.4 8.8.8.8

修改前

修改后

重启网络

1
systemctl restart networking

sshd服务设置

允许root登录

备份配置文件

1
cp /etc/ssh/sshd_config{,.bak}

修改配置文件

1
vim /etc/ssh/sshd_config
1
2
3
4
5
6
7
8
9
10
11
Include /etc/ssh/sshd_config.d/*.conf
Port 22
PermitRootLogin yes
PasswordAuthentication yes
PermitEmptyPasswords no
ChallengeResponseAuthentication no
UsePAM yes
X11Forwarding yes
PrintMotd no
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server

重启ssh服务

1
systemctl restart sshd