在虚拟机中新安装的Ubuntu16.04默认连不上网的,导致基础类库软件无法更新,而且putty、FileZilla等工具也无法连接Ubuntu。
一、首先要设置宿主机器的网络
设置虚拟网络VMnet8
设置本地连接与虚拟网络VMnet8共享
二、安装好的虚拟机网络调整为NAT模式。进入Ubuntu系统查看网卡名称,然后调整网络配置。
查看网卡名称:ifconfig
由于默认vi编辑器有问题,比如上下左右变成ABCD,此问题下面会解决。所以暂时用gedit命令调整网络配置,
设置DNS,
重启网络服务
测试网络是否可用
三、源调整
1 # deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted 2 deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties 3 deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted 4 deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties 5 deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted 6 deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties 7 deb http://mirrors.aliyun.com/ubuntu/ xenial universe 8 deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe 9 deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse 10 deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse 11 deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse 12 deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties 13 deb http://archive.canonical.com/ubuntu xenial partner 14 deb-src http://archive.canonical.com/ubuntu xenial partner 15 deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted 16 deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties 17 deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe 18 deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse
四、上下左右变成ABCD问题,卸载vi重新安装即可
五、安装ssh服务,方便使用putty远程登录Ubuntu