VMware ESXi 8.0中Ubuntu Server 20.04的安装与配置
使用VMware ESXi 8.0虚拟化技术,创建Ubuntu虚拟机,详细记录安装与配置Ubuntu Server 20.04的整个过程。
Ubuntu Server 20.04的安装与配置
安装Ubuntu Server
下载Ubuntu
访问Ubuntu官网,这里下载Ubuntu服务器版本
创建虚拟机
上传Ubuntu系统镜像
新建一个Ubuntu虚拟机
选择存储
设置CPU数量 内存大小 存储大小
注意: 一定要勾选预留所有客户机内存 (全部锁定)
选择要安装的系统镜像
开始安装Ubuntu
选择 Try or Install Ubuntu Server
选择语言,默认即可
选择键盘布局,默认即可
选择安装类型,默认即可
Ubuntu服务器
Ubuntu服务器(最小化)
搜索第三方驱动程序
网络配置
1.使用动态ip,等安装完成后再进行配置,如果此处不配置,默认DHCP自动获取IP地址。
2.通过上下箭头移动至ens34 ⇒ 点击Enter ⇒ Edit IPV4 ⇒ 选择Manual ⇒ 设置IP地址 ⇒ Save
选择Manual,手动设置
设置IP地址信息
配置完成进入下一步
配置代理地址,一般不需要,默认直接Done
配置软件源,可配置镜像地址如下:
# 阿里云镜像
http://mirrors.aliyun.com/ubuntu
# 清华大学
https://mirror.tuna.tsinghua.edu.cn/ubuntu-releases/20.04/
#中科大源
http://mirrors.ustc.edu.cn/ubuntu-releases/20.04/
这里暂时默认
是否进行程序更新,这里不更新继续
设置分区
可以直接使用整个磁盘,然后就自动配置了分区,例如:/、swap、home
等分区
可以根据自己需要设置分区配置
进行分区操作
添加分区home
添加分区swap
添加分区/
最终配置如下:
提示操作不可逆是否继续,选择继续即可
设置用户名,密码
设置登录系统的用户名和密码
每项具体意思如下:
你的名字
机器实例名称
选择一个用户名
选择密码
确认您的密码
是否将这台机器升级到Ubuntu Pro,以便在更广泛的软件包上进行安全更新
选择开启 SSH 远程连接,按空格键勾选
可以按需要勾选要安装的软件
等待安装完成
重启
取消更新并重启系统
最后将虚拟机先关机,然后将虚拟机配置中的驱动器配置指向主机设备
其他配置
Server版启用Root
设置 root 密码
sudo passwd root
开启root用户远程登录
编辑
vim /etc/ssh/sshd_config
配置文件,将PermitRootLogin设置为yes
# Authentication:
#LoginGraceTime 2m
#PermitRootLogin prohibit-password
PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
重启sshd服务
systemctl restart sshd
Desktop版启用root
注意:在Ubuntu桌面系统中,root账号是默认无法登陆系统的,执行以下操作开启Ubuntu桌面系统使用root账号登录
执行sudo vim /etc/pam.d/gdm-autologin
,注释以下内容,第三行左右
auth required pam_succeed_if.so user != root quiet_success
执行sudo vim /etc/pam.d/gdm-password
,注释以下内容,第三行左右
auth required pam_succeed_if.so user != root quiet_success
执行sudo vim /root/.profile
修改配置文件,文档最后一行前添加
tty -s &&mesg n || true
重启系统使其生效
reboot
配置静态IP
编辑:vim /etc/netplan/00-installer-config.yaml
,设置静态ip,有如下2种方式
# This is the network config written by 'subiquity'
network:
ethernets:
ens34:
dhcp4: false # 关闭DHCP
addresses: [192.168.5.210/24] # 设置静态IP
gateway4: 192.168.5.254 #设置网关
nameservers:
addresses: [8.8.8.8]
version: 2
renderer: networkd
# This is the network config written by 'subiquity'
network:
ethernets:
ens34:
addresses:
- 192.168.5.230/24
nameservers:
addresses:
- 8.8.8.8
search: []
routes:
- to: default
via: 192.168.5.254
version: 2
配置源
打开清华镜像官方,在搜索框输入ubuntu ,点击ubuntu旁边的小问号
查看ubuntu版本
root@master:/etc/apt# cat /etc/issue
Ubuntu 22.04.3 LTS \n \l
根据相应的版本复制镜像源码
vi /etc/apt/sources.list
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu jammy main restricted
# deb-src http://archive.ubuntu.com/ubuntu jammy main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu jammy-updates main restricted
# deb-src http://archive.ubuntu.com/ubuntu jammy-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu jammy universe
# deb-src http://archive.ubuntu.com/ubuntu jammy universe
deb http://archive.ubuntu.com/ubuntu jammy-updates universe
# deb-src http://archive.ubuntu.com/ubuntu jammy-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://archive.ubuntu.com/ubuntu jammy multiverse
# deb-src http://archive.ubuntu.com/ubuntu jammy multiverse
deb http://archive.ubuntu.com/ubuntu jammy-updates multiverse
# deb-src http://archive.ubuntu.com/ubuntu jammy-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu jammy-backports main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu jammy-backports main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu jammy-security main restricted
# deb-src http://archive.ubuntu.com/ubuntu jammy-security main restricted
deb http://archive.ubuntu.com/ubuntu jammy-security universe
# deb-src http://archive.ubuntu.com/ubuntu jammy-security universe
deb http://archive.ubuntu.com/ubuntu jammy-security multiverse
# deb-src http://archive.ubuntu.com/ubuntu jammy-security multiverse
.将sources.list内的内容清空,粘贴刚刚复制的镜像源,并保存
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
# deb-src http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
# # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
更新镜像源
apt-get update
更多推荐
所有评论(0)