VM安裝網(wǎng)上有很多免費(fèi)使用的手段,這里就不過多介紹了。

下載Ubuntu 22.04.1-server 進(jìn)入U(xiǎn)buntu的中文" />

国产成人精品无码青草_亚洲国产美女精品久久久久∴_欧美人与鲁交大毛片免费_国产果冻豆传媒麻婆精东

15158846557 在線咨詢 在線咨詢
15158846557 在線咨詢
所在位置: 首頁 > 營銷資訊 > 網(wǎng)站運(yùn)營 > 【Ubuntu】Win11 VmWare虛擬機(jī)安裝Ubuntu 22.04.1-server

【Ubuntu】Win11 VmWare虛擬機(jī)安裝Ubuntu 22.04.1-server

時(shí)間:2023-05-18 23:36:01 | 來源:網(wǎng)站運(yùn)營

時(shí)間:2023-05-18 23:36:01 來源:網(wǎng)站運(yùn)營

【Ubuntu】Win11 VmWare虛擬機(jī)安裝Ubuntu 22.04.1-server:

引言

如標(biāo)題所說,屬于個(gè)人虛擬機(jī)安裝Ubuntu的筆記記錄。

VM安裝

網(wǎng)上有很多免費(fèi)使用的手段,這里就不過多介紹了。

下載Ubuntu 22.04.1-server

進(jìn)入U(xiǎn)buntu的中文網(wǎng)站:Ubuntu系統(tǒng)下載 | Ubuntu

根據(jù)最新的版本下載即可。本次使用使用USB或者DVD的物理鏡像安裝。

VM安裝Ubuntu

Vm安裝完成之后,我們直接去官方網(wǎng)站下載Ubuntu 22.04.1 的Sever版本,在VM當(dāng)中我們選擇直接創(chuàng)建的新的鏡像。

在磁盤中選擇下載下來的ISO鏡像文件。

選擇直接下一步

選擇磁盤大小,這里個(gè)人磁盤空間比較充足,選擇了30GB。

選擇語言

這里建議使用英文語言:

選擇鍵盤

下面是選擇鍵盤的方式,默認(rèn)下一步即可:

配置網(wǎng)絡(luò)

注意:如果這里配置網(wǎng)絡(luò)一會安裝系統(tǒng)速度可能會較慢,因?yàn)閡buntu會從網(wǎng)絡(luò)上下載更新。

可以選擇DHCP獲取 IP,有利于新手快速學(xué)習(xí),如果讀者有IP知識也可以按tab鍵配置IP相關(guān) 地址,如上圖中標(biāo)記。

比如可以參考下面的方式配置網(wǎng)絡(luò)IP

配置的固定IP地址如上圖所示,地址段根據(jù)vm默認(rèn)即可,DNS為公共可用DNS。

選擇代理

選擇代理,這里直接使用默認(rèn)的設(shè)置即可。

選擇軟件源

如果開啟聯(lián)網(wǎng),ubuntu 默認(rèn)會選擇根據(jù)軟件源進(jìn)行下載。如果需要聯(lián)網(wǎng)更新這里可以配置清華源的地址:

https://mirrors.tuna.tsinghua.edu.cn/ubuntu

注意:可以選擇VM外的粘貼功能粘貼進(jìn)去,清華源有ubuntu20,有的源沒有,此處也可安裝完畢配置。

磁盤分區(qū)

新手建議直接使用官方給的默認(rèn)分區(qū)配置。這里就選擇默認(rèn)的使用整塊磁盤自動(dòng)分區(qū)。

磁盤分區(qū)信息預(yù)覽

最后是分區(qū)的信息預(yù)覽,這里直接Done即可。

提示:確認(rèn)是否繼續(xù),繼續(xù)后會對磁盤進(jìn)行格式化會破壞磁盤數(shù)據(jù),如果是宿主機(jī)系統(tǒng)重裝建議提前備份。

配置系統(tǒng)信息

配置系統(tǒng)主機(jī)名、登錄用戶和密碼。

OpenSSL安裝

這里需要手動(dòng)勾選一下,按空格鍵勾選圖中的小方框內(nèi)為小叉子,然后按tab鍵選擇Done繼續(xù)。

可選安裝

Ubuntu提供一些流行的常見運(yùn)維工具提供默認(rèn)安裝,比如云服務(wù)器的構(gòu)建,K8S,Docker的軟件。

這里個(gè)人勾選了docker和powershell。
最后等待安裝即可。

注意安裝過程中可能出現(xiàn)報(bào)錯(cuò),此處為卸載光驅(qū)失敗了,因?yàn)槭翘摂M機(jī)安裝,可不用理會,按回車重啟即可。

當(dāng)安裝完成之后,最下方的界面會提示重啟或者查看全部日志。我們選擇重啟然后等待Ubuntu做最后的初始化操作即可。

重啟完成之后使用上面系統(tǒng)信息配置的用戶登陸即可。注意這個(gè)用戶不是ROOT,但是具備和ROOT相同的權(quán)限。

Root用戶配置

Ubuntu 在第一次登陸之后需要設(shè)置ROOT用戶的密碼,切換Root和重新設(shè)置密碼的命令如下:

修改root密碼

sudo passwd root切換root賬戶

sudo su注意默認(rèn)情況下無法用Root遠(yuǎn)程登陸。

Root 遠(yuǎn)程登陸

默認(rèn)Ubuntu不允許root遠(yuǎn)程登錄,后期如果想通過root登陸系統(tǒng)則必須修改SSH配置文件中的相關(guān)參數(shù) 才行。

sudo vim /etc/ssh/sshd_config PermitRootLogin yes修改之后需要重啟SSHD后臺進(jìn)程:

sudo systemctl restart sshd

Xshell 遠(yuǎn)程連接

檢查設(shè)置

如果在之前的安裝步驟中沒有安裝OpenSSL,可以使用下面的命令安裝:

sudo apt-get install openssh-server在連接之前,需要保證 xshell 所在主機(jī) 和 ubuntu( 虛擬機(jī) ) 相互能平通,因?yàn)閟sh遠(yuǎn)程連接是通過網(wǎng)絡(luò)連接的,如果網(wǎng)絡(luò)不通,就無法連接。

Ubuntu 系統(tǒng)使用ip addr命令查看網(wǎng)絡(luò)IP,Windows主機(jī)使用ipconfig查看網(wǎng)絡(luò)IP:

ip addrWindow主機(jī)地址如下:

雙方向主機(jī)Ping一下,如果都能聯(lián)通,可以進(jìn)行下一步,否則需要檢查網(wǎng)卡配置是否正確。

Xshell連接配置

個(gè)人使用的版本為Xshell7教育版,在下面的界面中新建一個(gè)SSH遠(yuǎn)程連接,配置如下:

第一次連接Xshell會警告安全性,直接同意即可,接著是提示輸入用戶名和密碼。注意在默認(rèn)情況下Ubuntu是不能用Root登陸的。

Connecting to 192.168.110.128:22...Connection established.To escape to local shell, press 'Ctrl+Alt+]'.Welcome to Ubuntu 22.04.1 LTS (GNU/Linux 5.15.0-57-generic x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/advantage System information as of Sun Jan 8 06:45:58 AM UTC 2023 System load: 0.0078125 Processes: 226 Usage of /: 41.8% of 13.67GB Users logged in: 1 Memory usage: 12% IPv4 address for docker0: 172.17.0.1 Swap usage: 0% IPv4 address for ens33: 192.168.110.12860 updates can be applied immediately.To see these additional updates run: apt list --upgradableLast login: Sun Jan 8 03:46:40 2023 from 192.168.110.1xander@xander:~$

配置apt源

Ubuntu 使用的是apt命令進(jìn)行安裝的,如果之前未進(jìn)行軟件源,會使用Ubuntu的官網(wǎng)鏡像默認(rèn)的地址,基本等于說是在國外,如果要替換,可以使用下面的方案。

清華大學(xué)的鏡像站的配置網(wǎng)站如下:

ubuntu | 鏡像站使用幫助 | 清華大學(xué)開源軟件鏡像站 | Tsinghua Open Source Mirror

清華大學(xué)開源軟件源配置方式

下面直接拷貝網(wǎng)站的內(nèi)容。

本鏡像僅包含 32/64 位 x86 架構(gòu)處理器的軟件包,在 ARM(arm64, armhf)、PowerPC(ppc64el)、RISC-V(riscv64) 和 S390x 等架構(gòu)的設(shè)備上(對應(yīng)官方源為http://ports.ubuntu.com)請使用 ubuntu-ports 鏡像

手動(dòng)替換

Ubuntu 的軟件源配置文件是 /etc/apt/sources.list。

xander@xander:~$ sudo vim /etc/apt/sources.list# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to# newer versions of the distribution.deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy main restricted# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy main restricted## Major bug fix updates produced after the final release of the## distribution.deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-updates main restricted# deb-src https://mirrors.tuna.tsinghua.edu.cn/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 https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy universe# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy universedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-updates universe# deb-src https://mirrors.tuna.tsinghua.edu.cn/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 https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy multiverse# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-updates multiverse# deb-src https://mirrors.tuna.tsinghua.edu.cn/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 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 multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-security main restricted# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-security main restricteddeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-security universe# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-security universedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-security multiverse# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-security multiverse手動(dòng)替換的方式可以參考網(wǎng)站,因?yàn)椴煌陌姹咎鎿Q方式不太一樣,這里為22.04LTS的版本。

# 默認(rèn)注釋了源碼鏡像以提高 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 multiversedeb 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 multiversedeb 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 multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse# 預(yù)發(fā)布軟件源,不建議啟用# 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命令替換

命令替換的方式使用下面的命令即可。

sudo sed -i "s@http://.*archive.ubuntu.com@https://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.listsudo sed -i "s@http://.*security.ubuntu.com@https://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list

apt簡介

apt和CenterOs系統(tǒng)的區(qū)別如下:

操作內(nèi)容Centos6/7Debian/Ubuntu
1.軟件包后綴*.rpm*.deb
2.軟件源配置文件/etc/yum.conf/etc/apt/sources.list
3.更新軟件包列表yum makecache fastapt update
4.從軟件倉庫安裝軟件yum install packageapt install package
5.安裝本地軟件包rpm -i pkg.rpmdpkg -i pkg.deb
6.刪除軟件包yum remove packageapt remove package
7.獲取某軟件包的信息yum search packageapt search package

參考資料

Ubuntu 20.04 live server版安裝(詳細(xì)版) | 運(yùn)維密碼 (mefj.com.cn)

關(guān)鍵詞:安裝,虛擬

74
73
25
news

版權(quán)所有? 億企邦 1997-2025 保留一切法律許可權(quán)利。

為了最佳展示效果,本站不支持IE9及以下版本的瀏覽器,建議您使用谷歌Chrome瀏覽器。 點(diǎn)擊下載Chrome瀏覽器
關(guān)閉