设为首页 收藏本站
查看: 2003|回复: 0

[经验分享] VMWare不支持eth-tool,mii-tool等工具及使用E1000网卡

[复制链接]

尚未签到

发表于 2016-1-7 01:05:03 | 显示全部楼层 |阅读模式
  在VMWare中安装Linux时发现无法使用eth-tool,mii-tool等工具查询网卡的信息,导致一些程序都不能工作,其实是虚拟网卡的问题。
  一直以来,VMware都在虚拟客户机中提供的是古老的AMD PCNet10/100Mbps虚拟网卡,后来,VMware通过一种类似部分虚拟化的vmxnet优化虚拟网卡的方式提供了10/100/1000Mbps性能,无疑性能更好。现在,VMware ESX Server已经可以提供基于Intel E1000的千兆虚拟网卡,从兼容性和性能的角度来看,E1000都是更好的选择。但似乎,在ESX/ESXi 3.5的图形界面中,都无法直接选择该网卡类型,需要手动配置。

一、为什么要用E1000
原有很很多,其中最主要的有两个:
1、PCNet32 网卡太古老
这个古老的意思是,该网卡已经不适应新操作系统的要求了。而且也不支持mii-tool等检测工具,过去用虚拟客户机测试HA集群时,就无法监控虚拟的PCNet32 网卡。
甚至在Linux kernel的默认配置中,都需要费一番功夫才能找到该网卡的编译模块选项。
2、性能
现在的服务器基本都提供千兆的网卡,若虚拟客户机中仍只提供100Mbps虚拟网卡,性能肯定会降低的。
另一方面,vmxnet与E1000的对比中,也会发现E1000的效率更高,见 这里。
因此,建议把虚拟客户机中的网卡设置为Intel E1000类型。
  
  二、指定网卡类型
  2、默认配置
在Linux中,为PCNet32网卡:
引用
# lspci -v
00:11.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] (rev 10)
        Subsystem:Advanced Micro Devices [AMD] PCnet - Fast 79C971
        Flags: bus master, medium devsel, latency 64, IRQ 177
        I/O ports at 1400 [size=128]
        [virtual] Expansion ROM at 50000000 [disabled] [size=64K]
# cat /etc/modprobe.conf|grep eth
alias eth0 pcnet32
#ethtool eth0
Settings for eth0:
        Current message level: 0x00000007 (7)
        Link detected: yes
# mii-tool eth0
SIOCGMIIPHY on 'eth0' failed: Operation not supported

  
3、修改配置
若希望把虚拟网卡类型改为Intel E1000,直接修改对应虚拟客户机的.vmx文件:
  先关闭VMWare WorkStation,不然修改会被覆盖
  
加入或修改:
ethernet0.virtualDev = "e1000"

  
保存即可。若有多个网卡,采取同样的操作。
  值为"e1000"指定网卡类型为Intel(R) PRO/1000
值为"vlance"指定网卡类型为AMD PCNet AM79C970A(默认为此项)
值为"vmxnet"指定网卡类型为VMware PCI Ethernet Adapter
  
重启虚拟客户机后,可看到结果:
引用
# lspci -v
00:13.0Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev 01)
        Subsystem: VMware Inc Abstract PRO/1000 MT Single Port Adapter
        Flags: bus master, 66MHz, medium devsel, latency 0, IRQ 193
        Memory at f4840000 (64-bit,non-prefetchable) [size=128K]
        Memory at f4810000 (64-bit, non-prefetchable) [size=64K]
        I/O ports at 14c0
        [virtual]Expansion ROM at 50010000 [disabled] [size=64K]
        Capabilities:[dc] Power Management version 2
        Capabilities: [e4] PCI-X non-bridge device
# cat /etc/modprobe.conf|grep eth
alias eth0 e1000
# ethtool eth0
Settings for eth0:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supportsauto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Advertisedauto-negotiation: Yes
        Speed: 1000Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 0
        Transceiver:internal
        Auto-negotiation: on
        Supports Wake-on: d
        Wake-on:d
        Current message level: 0x00000007 (7)
        Link detected: yes
# mii-tool eth0
eth0:negotiated 100baseTx-FD, link ok




下面是VMware Guest Operating System Installation Guide中的一段内容:
The AMD Ethernet card driver included with certainWindows Vista builds—including 4074 and possibly others—does not workcorrectly or is not included with Windows. To use networking in theseWindows Vista guest operating systems, you must change the networkadapter. A driver for the vmxnet adapter is included in VMware Tools.
VMware GSX Server: Choose VM > Settings >Network Adapter (Windows) or VM > Settings > NIC (Linux), andselect vmxnet as the virtual device to use. Then install VMware Tools.A driver for the vmxnet adapter is included in VMware Tools.
VMware Workstation 4.x or lower, or VMware ACE, on aWindows host: Use a text editor such as Notepad to edit theconfiguration (.vmx) file for your Windows Vista virtual machine. Addthe following line:
Ethernet[n].virtualDev = "vmxnet"
Replace [n] with the  number of the Ethernet adapter. The first Ethernet adapter is number 0, so the  line for that adapter is
Ethernet0.virtualDev = "vmxnet"
Include a line for each Ethernet adapter configuredfor the virtual machine. Then install VMware Tools. A driver for thevmxnet adapter is included in VMware Tools.
VMware Workstation 4.x or lower on a Linux host:Choose VM > Settings, select Network Adapter, and then select vmxnetas the virtual device to use. Then install VMware Tools. A driver forthe vmxnet adapter is included in VMware Tools.
VMware Workstation 5.0.x:  Install VMware Tools. A driver for the network adapter is included in VMware  Tools.
VMware Workstation 5.5.x and VMware Server 1.x:Install VMware Tools. A vmxnet driver for the network adapter isincluded in VMware Tools. Installing VMware Tools automaticallyswitches the network adapter to vmxnet, and installs the vmxnet driver.
Alternatively, you can change the network adapter toe1000 (the Intel® PRO/1000 MT Adapter) before installing Windows Vista.Use a text editor such as Notepad to edit the configuration (.vmx) filefor your Windows Vista virtual machine. Add the following line:
Ethernet[n].virtualDev = "e1000"
Replace [n] with the  number of the Ethernet adapter. The first Ethernet adapter is number 0, so the  line for that adapter is
Ethernet0.virtualDev = "e1000"
Include a line for each Ethernet adapter configured  for the virtual machine.
ESX Server 2.x: In the Hardware page, under NetworkAdapter, click Edit. In the Network Adapter page, in the Device Bindinglist, select the virtual network device that you want the virtualmachine to use. In the Virtual Device list, choose vmxnet. Then installVMware Tools. A driver for the vmxnet adapter is included in VMwareTools.
ESX Server 3.x: Install VMware Tools. A vmxnet driverfor the network adapter is included in VMware Tools. Installing VMwareTools automatically switches the network adapter to vmxnet, andinstalls the vmxnet driver.
Alternatively, you can change the network adapter toe1000 (the Intel® PRO/1000 MT Adapter) before installing Windows Vista.Use a text editor such as Notepad to edit the configuration (.vmx) filefor your Windows Vista virtual machine. Add the following line:
Ethernet[n].virtualDev = "e1000"
Replace [n] with the  number of the Ethernet adapter. The first Ethernet adapter is number 0, so the  line for that adapter is
Ethernet0.virtualDev = "e1000"
Include a line for each Ethernet adapter configured  for the virtual machine.

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-161113-1-1.html 上篇帖子: 用VMware这样的虚拟机有什么实际的意义? 下篇帖子: vmware 桥接 redhat 静态ip 设置 (备忘)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表