VMware虚拟机模拟Ubuntu无法上网的解决办法

来源:互联网 发布:数据管控流程 编辑:程序博客网 时间:2024/05/17 08:48
1. ubuntu使用无线网卡上网
a. 虚拟机 - 设置 - 网络适配器 - 桥接模式(不选复制物理网络连接状态,下面的自定义可能选VMnet0桥接状态)
b. 编辑 - 虚拟网络编辑器 - VMnet0桥接模式 - 桥接模式(桥接到:实际的无线网卡) - 应用 - 确定
c. 打开终端
d. ifconfig(若使用的网卡为eth0)
e. sudo ifconfig eth0 192.168.0.3  (设置ip地址,和Windows处于同一个网段)(cmd 执行ipconfig查看到无线连接:ip地址192.168.0.192,子网掩码255.255.255.0,默认网关192.168.0.1)
f. ping 192.168.0.192可以ping通,但是ping www.baidu.com不能ping通 (即不能访问外网)
g. sudo route add default gw 192.168.0.1  (设置默认网关,和Windows相一致)
h. chmod 777 /etc/resolv.conf (重新配置/etc/resolv.conf吧,可以用8.8.8.8)
  sudo vi /etc/resolv.conf
  修改为:nameserver 8.8.8.8
i. ping www.baidu.com可以ping通 (即能访问外网)
j. 打开浏览器,发现能上网
注意1:在软件中心下载软件的过程中如果出现:Check if you are using third party repositories. If so disable them, since they are a common source of problems.
解决:sudo apt-get update && sudo apt-get install -f
注意2:VNP CONNECTS - VNP CONFIGURE - wired - edit - ipv4 settings - automatic
参考文章:
设置ip和网关:
http://blog.csdn.net/happyjiang2009/article/details/5730017
连外网需要修改:
https://www.oschina.net/question/113989_127677?sort=time
解决错误:禁止第三方存储库 sudo apt-get update && sudo apt-get install -f
http://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/problems-with-package-system-4175480323/
****************************************************************************

2. ubuntu使用本地联机传文件
a. 虚拟机 - 设置 - 网络适配器 - 桥接模式(不选复制物理网络连接状态,下面的自定义可能选VMnet0桥接状态)
b. 编辑 - 虚拟网络编辑器 - VMnet0桥接模式 - 桥接模式(桥接到:本地连接对应的网卡) - 应用 - 确定
c. 打开终端
d. ifconfig(若使用的网卡为eth0)
e. ifconfig eth0 192.168.2.3  (设置ip地址,和Windows处于同一个网段)(cmd 执行ipconfig查看到本地连接:ip地址192.168.2.3,子网掩码255.255.255.0,默认网关192.168.2.1)
f. VNP CONNECTS - VNP CONFIGURE - wired - edit - ipv4 settings - manual - 192.168.2.3/255.255.255.0/192.168.2.1 - save
g. ping 192.168.2.2成功

****************************************************************************
3. Ubuntu识别usb
a. 虚拟机 - 设置 - USB控制器 - USB兼容性(选择USB3.0 根据实际的U盘速度设置)
b. 点击VMware右下角的USB图标,点击连接即可在文件系统中看到U盘
参考文章:
http://blog.csdn.net/polokang/article/details/6690921

****************************************************************************
4. ubuntu识别串口
a. 虚拟机 - 设置 - 添加 - 串行端口 - 一路按确定
b. 虚拟机 - 设置 - 串行端口 - 使用物理串行端口 - 指定串口位置为COM9 (根据串口实际的插入位置确定)
c. 点击VMware右下角的串口 - 连接,此时ubuntu已经连接好串口
d. sudo apt-get install cutecom
e. sudo su
f. cutecom

参考文章:
http://www.cnblogs.com/image-eye/archive/2011/08/16/2141586.html

原创粉丝点击