尝试了网上很多教程,都是在Windows上修改网络属性,然而都没能解决,后来找到了解决方法。发现虚拟机里Ubuntu22.04系统桌面右上角并没有有线网络图标,尝试删除网络缓存文件后,重启网络后问题就解决了。解决方法
删除NetworkManager缓存文件
sudo service NetworkManager stop
sudo rm /var/lib/NetworkManager/NetworkManager.state
sudo service NetworkManager start
打开Ubuntu火狐浏览器,发现可以正常上网啦。
sudo apt-get install open-vm-tools open-vm-tools-desktop open-vm-dkms
sudo apt-get update
然而并没有什么X用!!!
报错显示
W: Some index files failed to download. They have been ignored, or old ones used instead.
将里面的内容都删掉,替换成阿里云的源
因为换了几个源都发现还是会出现
index files failed to download的错误
所以我用了网上的几个源组合在一起
#deb包
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
##测试版源
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
# 源码
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
##测试版源
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
# 更新的源的内容
# deb http://mirrors.aliyun.com/ubuntu/ raring main restricted universe multiverse
# deb http://mirrors.aliyun.com/ubuntu/ raring-security main restricted universe multiverse
# deb http://mirrors.aliyun.com/ubuntu/ raring-updates main restricted universe multiverse
# deb http://mirrors.aliyun.com/ubuntu/ raring-proposed main restricted universe multiverse
# deb http://mirrors.aliyun.com/ubuntu/ raring-backports main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ raring main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ raring-security main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ raring-updates main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ raring-proposed main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ raring-backports main restricted universe multiverse
先复制好内容
vi linux命令行用d键删除行,用滚轮中键或shift+Insert来粘贴内容
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 114.114.114.114
naemserver 8.8.8.8
#阿里的DNS
nameserver 223.5.5.5
nameserver 223.6.6.6
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install open-vm-tools open-vm-tools-desktop open-vm-dkms
成功安装VMwareTools