在虛擬機中新安裝的Ubuntu16.04預設連不上網的,導致基礎類庫軟體無法更新,而且putty、FileZilla等工具也無法連接Ubuntu。 一、首先要設置宿主機器的網路 設置虛擬網路VMnet8 設置本地連接與虛擬網路VMnet8共用 二、安裝好的虛擬機網路調整為NAT模式。進入Ubuntu ...
在虛擬機中新安裝的Ubuntu16.04預設連不上網的,導致基礎類庫軟體無法更新,而且putty、FileZilla等工具也無法連接Ubuntu。
一、首先要設置宿主機器的網路
設置虛擬網路VMnet8
設置本地連接與虛擬網路VMnet8共用
二、安裝好的虛擬機網路調整為NAT模式。進入Ubuntu系統查看網卡名稱,然後調整網路配置。
查看網卡名稱:ifconfig
由於預設vi編輯器有問題,比如上下左右變成ABCD,此問題下麵會解決。所以暫時用gedit命令調整網路配置,
配置DNS伺服器,
重啟網路服務
測試網路是否可用
三、源調整
查看ubuntu系統的codename
備份源
修改源
1 #xenial指codename,請根據實際情況調整 2 #163源: 3 deb http://mirrors.163.com/ubuntu/ xenial main restricted universe multiverse 4 deb http://mirrors.163.com/ubuntu/ xenial-security main restricted universe multiverse 5 deb http://mirrors.163.com/ubuntu/ xenial-updates main restricted universe multiverse 6 deb http://mirrors.163.com/ubuntu/ xenial-proposed main restricted universe multiverse 7 deb http://mirrors.163.com/ubuntu/ xenial-backports main restricted universe multiverse 8 deb-src http://mirrors.163.com/ubuntu/ xenial main restricted universe multiverse 9 deb-src http://mirrors.163.com/ubuntu/ xenial-security main restricted universe multiverse 10 deb-src http://mirrors.163.com/ubuntu/ xenial-updates main restricted universe multiverse 11 deb-src http://mirrors.163.com/ubuntu/ xenial-proposed main restricted universe multiverse 12 deb-src http://mirrors.163.com/ubuntu/ xenial-backports main restricted universe multiverse 13 14 #阿裡源: 15 deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse 16 deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse 17 deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse 18 deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse 19 deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse 20 deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse 21 deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse 22 deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse 23 deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse 24 deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse 25 26 #中科大源(在安裝Chrome Deps時很好用) 27 deb http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse 28 deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse 29 deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse 30 deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse 31 deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse 32 deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse 33 deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse 34 deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse 35 deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse 36 deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverseView Code
最後update
四、上下左右變成ABCD問題,卸載vi重新安裝即可
五、安裝ssh服務,方便使用putty遠程登錄Ubuntu