前言
大家好,在企业中使用 Linux 系统居多,本文讲述如何使用VMware安装 Ubuntu Server 22.04 LTS 。希望对大家有所帮助~
一、CentOS 和 Ubuntu 的区别

1.1、CentOS
CentOS 是由 CentOS Project 开发的 Linux 发行版。最初于 2004 年 5 月 14 日发布。为我们提供了 Red Hat Enterprise Linux,这是一个免费且受社区支持的计算平台,在功能上与其上游源代码兼容。基于 Fedora。
1.2、Ubuntu
Ubuntu 是一个基于 Linux 的操作系统,由 Mark Shuttleworth 领导的 Canonical 团队开发。属于 Linux 的 Debian 家族。是开源的,可以免费使用。
类型 | CentOS | Ubuntu |
---|
团队 | CentOS Project(隶属于 Red Hat)开发 | Canonical 开发。 | Base | 基于 Fedora | 基于 Debian 的操作系统 | 发布时间 | 2007 年 4 月 12 日发布 | 2004 年 10 月发布 | 起源地 | 美国 | 马恩岛 | 包管理器 | yum | apt | 虚拟化 | 带有本地 KVM 虚拟化支持 | 支持 KVM 和 Xen 虚拟化 | 论坛 | https://forums.centos.org/ | https://ubuntuforums.org/ | GitHub 仓库 | https://github.com/CentOS | https://github.com/ubuntu |
二、Ubuntu Desktop 和 Ubuntu Server 之间的区别
Ubuntu Desktop 是一个免费提供的开源 GUI 环境。有一个图形用户界面 (GUI),但这个 Linux 发行版依赖于其被称为终端的命令行。
Ubuntu Server 提供了一个完整的操作系统供您使用。使用命令行界面 (CLI) 而不是 GUI。
两台具有默认规格的相同机器上安装 Ubuntu Server 和 Ubuntu Desktop,Ubuntu Server 更胜一筹,它无需运行桌面环境,就可以将资源转移到服务器任务上。
三、Ubuntu Server 22.04安装
3.1、镜像下载
Ubuntu 官网地址:
https://ubuntu.com/
下载地址(如果失效,可根据如下步骤进行下载):
https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/22.04.1/ubuntu-22.04.1-live-server-amd64.iso
1)、进入官网,点击Download 菜单,在点击绿色按钮 Get Ubuntu Server  2)、点击Download Ubuntu Server 22.04.1 LTS 即可开始下载。如果需要下载其他的版本,则可以点击 See alternative downloads 链接自行下载。 
3.2、开始安装
1)、打开 VMware Workstation Pro ,点击文件 ,再点击新建虚拟机  2)、选择 自定义 方式,点击下一步  3)、直接点击下一步  4)、选择 稍后安装操作系统 ,点击下一步  5)、操作系统选择Linux ,版本选择 Ubuntu 64位 ,点击下一步  6)、更改虚拟机名称Ubuntu Server 22.04 X64 ,自定义设置虚拟机位置D:\VMware\Ubuntu Server 22.04 X64  7)、设置处理器配置,此处参数安装好后也可以进行更改。直接点击下一步即可 
8)、可手动修改虚拟机的内存,根据实际情况给虚拟机分配内存即可。分配好后,点击下一步 
9)、选择NAT 网络方式,点击下一步 
10)、选择LSI Logic(L) ,点击下一步 
11)、选择SCSI ,点击下一步 
12)、选择创建新虚拟磁盘 ,点击下一步 
13)、可设置最大磁盘大小,建议20GB ,后续也可增加,选择将虚拟磁盘拆分多个文件 ,点击下一步 
14)、直接点击下一步 
15)、点击完成 
16)、指定镜像文件。点击编辑虚拟机设置 ->点击CD/DVD ->选择启动时连接 ->点击使用 ISO 映像文件 ->点击浏览,选择我们下载好的ISO文件->点击确定  
17)、安装操作系统。点击开启此虚拟机 
默认选中Try or Install Ubuntu Server 安装选项,点击回车。(PS:可使用 ctrl + Alt 回到宿主机) 
键盘上下键可选择操作系统的语言,这里选择默认的English ,回车确认 
如果你安装的镜像有更新,会有提示,一般选择Continue without updating 不更新,继续安装。我这里下载的最新的镜像所以没有这个提示。 
选择键盘布局,使用默认English键盘布局即可 
选择安装类型,选择最小安装方式 
网络配置,默认 DHCP 自动获取 IP 地址。 
这里也可以手动配置固定IP。步骤如下:(PS:安装完成后,也可以更改为固定IP)
使用上下键选中 ens33 ->回车 ->Edit IPv4 ->IPv4 Method 选择Manual ,输入如下内容:
- Subnet (子网)
- Address (IP地址)
- Gateway (网关)
- Name servers (DNS)
- Search domains (搜索域)
输入完成后,选中Save 回车 
代理地址配置,直接回车 
设置系统默认镜像源
默认源:
http://cn.archive.ubuntu.com/ubuntu
清华大学镜像源
https://mirror.tuna.tsinghua.edu.cn/help/ubuntu/
中科大镜像源:
https://mirrors.ustc.edu.cn/ubuntu
阿里云镜像源:
https://mirrors.aliyun.com/ubuntu
华为云镜像源:
https://repo.huaweicloud.com/ubuntu
腾讯云镜像源:
https://mirrors.cloud.tencent.com/ubuntu

引导式存储布局配置,保持默认 
存储配置,保持默认 
弹出确认框,选择继续Continue 
配置用户名、密码等 
勾选Install OpenSSH server 安装 OpenSSH 服务包,可以使用XShell 工具进行连接 
第三方服务软件包,根据个人情况进行安装。这里不勾选,直接Done 回车 
配置完成,等待 Ubuntu 安装,根据网络情况,需要等待时间较长 
安装完成后,选择重启 
重启后,输入之前设置的用户名和密码 
3.3、配置ROOT用户登录
1)、设置 root 用户密码
micromaple@ubuntu:~$ sudo passwd
[sudo] password for micromaple:
New password:
Retype new password:
passwd: password updated successfully
micromaple@ubuntu:~$
2)、切换 root 用户
micromaple@ubuntu:~$ su
Password:
root@ubuntu:/home/micromaple
3)、设置 root 用户远程连接
更改配置文件/etc/ssh/sshd_config
vim /etc/ssh/sshd_config
如果提示bash: vim: command not found ,使用如下命令安装vi 软件包
apt-get install vim -y
在文件中增加下列配置:(输入小写i ,进入插入模式)
PermitRootLogin yes
如图: 
输入完成后,Esc ,切换英文输入法,输入:wq 保存退出
重启 ssh 服务,然后就可以使用Shell 工具直接连接Ubuntu了
service ssh restart
读到这里,想必你已经完全掌握了使用VMware安装Ubuntu Server 22.04 LTS系统,快跟着一起动手吧。 我是微枫Micromaple,期待你的关注~💪💪💪
|