安装VMware-tools出错无法共享文件的解决办法

 

【开发工具】VMware安装Fedora17,安装VMware-tools出错无法共享文件的解决办法

分类: 工具与下载 VMware Fedora VMware-tools   836人阅读  评论(0)  收藏  举报

之前用的VMware7,安装Fedora14,VMware-tools安装出错,无法共享文件夹,打开共享时报错

以为是版本问题,下载了最新的VMware8,Fedora17,安装Vmware-tools仍然出错,打开共享不报错,但/mnt/hgfs下为空。

VMware-tools版本为VMware-Tools-8.8.2,报错如下:

[plain]  view plain copy
  1. [root@Fedora bin]# ./vmware-config-tools.pl   
  2. ........#省略  
  3. Using 2.6.x kernel build system.  
  4. make: Entering directory `/tmp/vmware-root/modules/vmhgfs-only'  
  5. make -C /lib/modules/3.4.0-1.fc17.i686/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \  
  6.   MODULEBUILDDIR= modules  
  7. make[1]: Entering directory `/usr/src/kernels/3.4.0-1.fc17.i686'  
  8.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/message.o  
  9.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/request.o  
  10.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/hgfsUtil.o  
  11.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/cpName.o  
  12.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/link.o  
  13.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/tcp.o  
  14.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/rpcout.o  
  15.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/backdoorGcc32.o  
  16.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/hgfsEscape.o  
  17.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/file.o  
  18.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/transport.o  
  19.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/inode.o  
  20.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/super.o  
  21.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/vmci.o  
  22.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/dir.o  
  23.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/bdhandler.o  
  24.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/fsutil.o  
  25.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/hgfsBd.o  
  26.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/cpNameLinux.o  
  27.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/module.o  
  28.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/filesystem.o  
  29.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/stubs.o  
  30.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/backdoor.o  
  31.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/page.o  
  32.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/dentry.o  
  33.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/cpNameLite.o  
  34.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/kernelStubsLinux.o  
  35. /tmp/vmware-root/modules/vmhgfs-only/file.c:128:4: warning: initialization from incompatible pointer type [enabled by default]  
  36. /tmp/vmware-root/modules/vmhgfs-only/file.c:128:4: warning: (near initialization for ‘HgfsFileFileOperations.fsync’) [enabled by default]  
  37. /tmp/vmware-root/modules/vmhgfs-only/inode.c:121:4: warning: initialization from incompatible pointer type [enabled by default]  
  38. /tmp/vmware-root/modules/vmhgfs-only/inode.c:121:4: warning: (near initialization for ‘HgfsDirInodeOperations.create’) [enabled by default]  
  39. /tmp/vmware-root/modules/vmhgfs-only/inode.c:124:4: warning: initialization from incompatible pointer type [enabled by default]  
  40. /tmp/vmware-root/modules/vmhgfs-only/inode.c:124:4: warning: (near initialization for ‘HgfsDirInodeOperations.mkdir’) [enabled by default]  
  41. /tmp/vmware-root/modules/vmhgfs-only/filesystem.c: In function ‘HgfsGetRootDentry’:  
  42. /tmp/vmware-root/modules/vmhgfs-only/filesystem.c:379:4: error: implicit declaration of function ‘d_alloc_root’ [-Werror=implicit-function-declaration]  
  43. /tmp/vmware-root/modules/vmhgfs-only/filesystem.c:379:19: warning: assignment makes pointer from integer without a cast [enabled by default]  
  44. cc1: some warnings being treated as errors  
  45. make[2]: *** [/tmp/vmware-root/modules/vmhgfs-only/filesystem.o] Error 1  
  46. make[2]: *** Waiting for unfinished jobs....  
  47. make[1]: *** [_module_/tmp/vmware-root/modules/vmhgfs-only] Error 2  
  48. make[1]: Leaving directory `/usr/src/kernels/3.4.0-1.fc17.i686'  
  49. make: *** [vmhgfs.ko] Error 2  
  50. make: Leaving directory `/tmp/vmware-root/modules/vmhgfs-only'  
  51.   
  52. The filesystem driver (vmhgfs module) is used only for the shared folder   
  53. feature. The rest of the software provided by VMware Tools is designed to work   
  54. independently of this feature.  
  55.   
  56. If you wish to have the shared folders feature, you can install the driver by   
  57. running vmware-config-tools.pl again after making sure that gcc, binutils, make  
  58. and the kernel sources for your running kernel are installed on your machine.   
  59. These packages are available on your distribution's installation CD.  
  60. [ Press Enter key to continue ]   
  61.   
  62. Using 2.6.x kernel build system.  
  63. make: Entering directory `/tmp/vmware-root/modules/vmxnet-only'  
  64. make -C /lib/modules/3.4.0-1.fc17.i686/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \  
  65.   MODULEBUILDDIR= modules  
  66. make[1]: Entering directory `/usr/src/kernels/3.4.0-1.fc17.i686'  
  67.   CC [M]  /tmp/vmware-root/modules/vmxnet-only/vmxnet.o  
  68. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:525:4: error: unknown field ‘get_rx_csum’ specified in initializer  
  69. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:525:4: warning: initialization from incompatible pointer type [enabled by default]  
  70. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:525:4: warning: (near initialization for ‘vmxnet_ethtool_ops.get_eeprom_len’) [enabled by default]  
  71. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:526:4: error: unknown field ‘set_rx_csum’ specified in initializer  
  72. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:526:4: warning: initialization from incompatible pointer type [enabled by default]  
  73. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:526:4: warning: (near initialization for ‘vmxnet_ethtool_ops.get_eeprom’) [enabled by default]  
  74. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:527:4: error: unknown field ‘get_tx_csum’ specified in initializer  
  75. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:527:4: warning: initialization from incompatible pointer type [enabled by default]  
  76. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:527:4: warning: (near initialization for ‘vmxnet_ethtool_ops.set_eeprom’) [enabled by default]  
  77. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:528:4: error: unknown field ‘set_tx_csum’ specified in initializer  
  78. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:528:4: warning: initialization from incompatible pointer type [enabled by default]  
  79. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:528:4: warning: (near initialization for ‘vmxnet_ethtool_ops.get_coalesce’) [enabled by default]  
  80. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:529:4: error: unknown field ‘get_sg’ specified in initializer  
  81. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:529:27: error: ‘ethtool_op_get_sg’ undeclared here (not in a function)  
  82. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:530:4: error: unknown field ‘set_sg’ specified in initializer  
  83. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:530:27: error: ‘ethtool_op_set_sg’ undeclared here (not in a function)  
  84. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:532:4: error: unknown field ‘get_tso’ specified in initializer  
  85. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:532:27: error: ‘ethtool_op_get_tso’ undeclared here (not in a function)  
  86. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:533:4: error: unknown field ‘set_tso’ specified in initializer  
  87. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:533:4: warning: initialization from incompatible pointer type [enabled by default]  
  88. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:533:4: warning: (near initialization for ‘vmxnet_ethtool_ops.get_pauseparam’) [enabled by default]  
  89. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:535:4: error: unknown field ‘get_ufo’ specified in initializer  
  90. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:535:27: error: ‘ethtool_op_get_ufo’ undeclared here (not in a function)  
  91. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c: In function ‘vmxnet_probe_device’:  
  92. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:1008:7: error: unknown field ‘ndo_set_multicast_list’ specified in initializer  
  93. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:1008:7: warning: initialization from incompatible pointer type [enabled by default]  
  94. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:1008:7: warning: (near initialization for ‘vmxnet_netdev_ops.ndo_vlan_rx_add_vid’) [enabled by default]  
  95. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c: In function ‘vmxnet_map_pkt’:  
  96. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:2085:32: error: incompatible type for argument 2 of ‘pci_map_page’  
  97. In file included from /usr/src/kernels/3.4.0-1.fc17.i686/arch/x86/include/asm/pci.h:148:0,  
  98.                  from include/linux/pci.h:1335,  
  99.                  from /tmp/vmware-root/modules/vmxnet-only/./shared/compat_pci.h:27,  
  100.                  from /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:31:  
  101. include/asm-generic/pci-dma-compat.h:43:1: note: expected ‘struct page *’ but argument is of type ‘struct <anonymous>’  
  102. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:2104:26: error: incompatible type for argument 2 of ‘pci_map_page’  
  103. In file included from /usr/src/kernels/3.4.0-1.fc17.i686/arch/x86/include/asm/pci.h:148:0,  
  104.                  from include/linux/pci.h:1335,  
  105.                  from /tmp/vmware-root/modules/vmxnet-only/./shared/compat_pci.h:27,  
  106.                  from /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:31:  
  107. include/asm-generic/pci-dma-compat.h:43:1: note: expected ‘struct page *’ but argument is of type ‘struct <anonymous>’  
  108. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c: In function ‘vmxnet_rx_frags’:  
  109. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:2599:48: error: incompatible types when assigning to type ‘struct <anonymous>’ from type ‘struct page *’  
  110. make[2]: *** [/tmp/vmware-root/modules/vmxnet-only/vmxnet.o] Error 1  
  111. make[1]: *** [_module_/tmp/vmware-root/modules/vmxnet-only] Error 2  
  112. make[1]: Leaving directory `/usr/src/kernels/3.4.0-1.fc17.i686'  
  113. make: *** [vmxnet.ko] Error 2  
  114. make: Leaving directory `/tmp/vmware-root/modules/vmxnet-only'  
  115.   
  116. The fast network device driver (vmxnet module) is used only for our fast   
  117. networking interface. The rest of the software provided by VMware Tools is   
  118. designed to work independently of this feature.  
  119. If you wish to have the fast network driver enabled, you can install the driver  
  120. by running vmware-config-tools.pl again after making sure that gcc, binutils,   
  121. make and the kernel sources for your running kernel are installed on your   
  122. machine. These packages are available on your distribution's installation CD.  
  123. [ Press Enter key to continue ]   
  124. .......#省略  
错误主要在编译vmhgfs模块filesystem.c与vmxnet模块vmxnet.c两个文件时。主要错误如下:

[plain]  view plain copy
  1. /tmp/vmware-root/modules/vmhgfs-only/filesystem.c: In function ‘HgfsGetRootDentry’:  
  2. /tmp/vmware-root/modules/vmhgfs-only/filesystem.c:379:4: error: implicit declaration of function ‘d_alloc_root’ [-Werror=implicit-function-declaration]  
  3.   
  4. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:525:4: error: unknown field ‘get_rx_csum’ specified in initializer  
  5. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:526:4: error: unknown field ‘set_rx_csum’ specified in initializer  
  6. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:527:4: error: unknown field ‘get_tx_csum’ specified in initializer  
  7. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:528:4: error: unknown field ‘set_tx_csum’ specified in initializer  
  8. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:529:4: error: unknown field ‘get_sg’ specified in initializer  
  9. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:529:27: error: ‘ethtool_op_get_sg’ undeclared here (not in a function)  
  10. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:530:4: error: unknown field ‘set_sg’ specified in initializer  
  11. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:530:27: error: ‘ethtool_op_set_sg’ undeclared here (not in a function)  
  12. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:532:4: error: unknown field ‘get_tso’ specified in initializer  
  13. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:532:27: error: ‘ethtool_op_get_tso’ undeclared here (not in a function)  
  14. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:533:4: error: unknown field ‘set_tso’ specified in initializer  
  15. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:535:4: error: unknown field ‘get_ufo’ specified in initializer  
  16. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:535:27: error: ‘ethtool_op_get_ufo’ undeclared here (not in a function)  
  17. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c: In function ‘vmxnet_probe_device’:  
  18. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:1008:7: error: unknown field ‘ndo_set_multicast_list’ specified in initializer  
  19. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c: In function ‘vmxnet_map_pkt’:  
  20. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:2085:32: error: incompatible type for argument 2 of ‘pci_map_page’  
  21. In file included from /usr/src/kernels/3.4.0-1.fc17.i686/arch/x86/include/asm/pci.h:148:0,  
  22.                  from include/linux/pci.h:1335,  
  23.                  from /tmp/vmware-root/modules/vmxnet-only/./shared/compat_pci.h:27,  
  24.                  from /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:31:  
  25. include/asm-generic/pci-dma-compat.h:43:1: note: expected ‘struct page *’ but argument is of type ‘struct <anonymous>’  
  26. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:2104:26: error: incompatible type for argument 2 of ‘pci_map_page’  
  27. In file included from /usr/src/kernels/3.4.0-1.fc17.i686/arch/x86/include/asm/pci.h:148:0,  
  28.                  from include/linux/pci.h:1335,  
  29.                  from /tmp/vmware-root/modules/vmxnet-only/./shared/compat_pci.h:27,  
  30.                  from /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:31:  
  31. include/asm-generic/pci-dma-compat.h:43:1: note: expected ‘struct page *’ but argument is of type ‘struct <anonymous>’  
  32. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c: In function ‘vmxnet_rx_frags’:  
  33. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:2599:48: error: incompatible types when assigning to type ‘struct <anonymous>’ from type ‘struct page *’  
从错误信息可以看出,主要是“类型不匹配”与“未声明的字段”。


原因:

Fedora17内核版本为:3.4.0-1.fc17.i686

[plain]  view plain copy
  1. [root@Fedora software]# uname -r  
  2. 3.4.0-1.fc17.i686  
此版本的一些数据结构定义和函数生命比2.6.*之前的版本有些变化,导致编译不过。

修改filesystem.c与vmxnet.c中出错行,消除错误重新编译可解决这个问题。

相关的几行代码如下:

filesystem.c:

[cpp]  view plain copy
  1. line:528-533  
  2.    rootDentry = d_alloc_root(rootInode);  
  3.    if (!rootDentry) {  
  4.       iput(rootInode);  
  5.       return -ENOMEM;  
  6.    }  
  7.    sb->s_root = rootDentry;  
vmxnet.c

[plain]  view plain copy
  1. line:520-538  
  2. static struct ethtool_ops  
  3. vmxnet_ethtool_ops = {  
  4.    .get_settings        = vmxnet_get_settings,  
  5.    .get_drvinfo         = vmxnet_get_drvinfo,  
  6.    .get_link            = ethtool_op_get_link,  
  7.    .get_rx_csum         = vmxnet_get_rx_csum,  
  8.    .set_rx_csum         = vmxnet_set_rx_csum,  
  9.    .get_tx_csum         = vmxnet_get_tx_csum,  
  10.    .set_tx_csum         = vmxnet_set_tx_csum,  
  11.    .get_sg              = ethtool_op_get_sg,  
  12.    .set_sg              = ethtool_op_set_sg,  
  13. #ifdef VMXNET_DO_TSO  
  14.    .get_tso             = ethtool_op_get_tso,  
  15.    .set_tso             = vmxnet_set_tso,  
  16. #   if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)  
  17.    .get_ufo             = ethtool_op_get_ufo,  
  18. #   endif  
  19. #endif  
  20. };  
  21.   
  22.   
  23. line:1003-1015  
  24.    static const struct net_device_ops vmxnet_netdev_ops = {  
  25.       .ndo_open = &vmxnet_open,  
  26.       .ndo_start_xmit = &vmxnet_start_tx,  
  27.       .ndo_stop = &vmxnet_close,  
  28.       .ndo_get_stats = &vmxnet_get_stats,  
  29.       .ndo_set_multicast_list = &vmxnet_set_multicast_list,  
  30.       .ndo_change_mtu = &vmxnet_change_mtu,  
  31. #   ifdef VMW_HAVE_POLL_CONTROLLER  
  32.       .ndo_poll_controller = vmxnet_netpoll,  
  33. #   endif  
  34.       .ndo_set_mac_address = &vmxnet_set_mac_address,  
  35.       .ndo_tx_timeout = &vmxnet_tx_timeout,  
  36.    };  
  37.   
  38. line:2081-2085  
  39.             dma = pci_map_page(lp->pdev,  
  40.                                frag->page,  
  41.                                frag->page_offset + offset,  
  42.                                frag->size - offset,  
  43.                                PCI_DMA_TODEVICE);  
  44.   
  45. line:2100-2104  
  46.       dma = pci_map_page(lp->pdev,  
  47.                          frag->page,  
  48.                          frag->page_offset,  
  49.                          frag->size,  
  50.                          PCI_DMA_TODEVICE);  
  51.   
  52. line:2598-2603  
  53.          pci_unmap_page(pdev, rre2->paddr, PAGE_SIZE, PCI_DMA_FROMDEVICE);  
  54.          skb_shinfo(skb)->frags[numFrags].page = lp->rxPages[dd->rxDriverNext2];  
  55.          skb_shinfo(skb)->frags[numFrags].page_offset = 0;  
  56.          skb_shinfo(skb)->frags[numFrags].size = rre2->actualLength;  
  57.          skb->data_len += rre2->actualLength;  
  58.          numFrags++;  
OK,找到出错行了,看如何修改。


解决方案:

对于filesystem.c,没有找到d_alloc_root函数,此函数在内核版本3.2.11中定义如下:

[plain]  view plain copy
  1. extern struct dentry * d_alloc_root(struct inode *);  
在3.4.0中此函数已更名,变为d_make_root

因此将此函数改为d_make_root即可


对vmxnet.c,错误比较多,一一看来:

先看520-538这几行的问题所在

老版本ethtool.h中结构体ethtool_ops声明如下:

[cpp]  view plain copy
  1. struct ethtool_ops {  
  2.     int (*get_settings)(struct net_device *, struct ethtool_cmd *);  
  3.     int (*set_settings)(struct net_device *, struct ethtool_cmd *);  
  4.     void    (*get_drvinfo)(struct net_device *, struct ethtool_drvinfo *);  
  5.     int (*get_regs_len)(struct net_device *);  
  6.     void    (*get_regs)(struct net_device *, struct ethtool_regs *, void *);  
  7.     void    (*get_wol)(struct net_device *, struct ethtool_wolinfo *);  
  8.     int (*set_wol)(struct net_device *, struct ethtool_wolinfo *);  
  9.     u32 (*get_msglevel)(struct net_device *);  
  10.     void    (*set_msglevel)(struct net_device *, u32);  
  11.     int (*nway_reset)(struct net_device *);  
  12.     u32 (*get_link)(struct net_device *);  
  13.     int (*get_eeprom_len)(struct net_device *);  
  14.     int (*get_eeprom)(struct net_device *,  
  15.                   struct ethtool_eeprom *, u8 *);  
  16.     int (*set_eeprom)(struct net_device *,  
  17.                   struct ethtool_eeprom *, u8 *);  
  18.     int (*get_coalesce)(struct net_device *, struct ethtool_coalesce *);  
  19.     int (*set_coalesce)(struct net_device *, struct ethtool_coalesce *);  
  20.     void    (*get_ringparam)(struct net_device *,  
  21.                  struct ethtool_ringparam *);  
  22.     int (*set_ringparam)(struct net_device *,  
  23.                  struct ethtool_ringparam *);  
  24.     void    (*get_pauseparam)(struct net_device *,  
  25.                   struct ethtool_pauseparam*);  
  26.     int (*set_pauseparam)(struct net_device *,  
  27.                   struct ethtool_pauseparam*);  
  28.     u32 (*get_rx_csum)(struct net_device *);  
  29.     int (*set_rx_csum)(struct net_device *, u32);  
  30.     u32 (*get_tx_csum)(struct net_device *);  
  31.     int (*set_tx_csum)(struct net_device *, u32);  
  32.     u32 (*get_sg)(struct net_device *);  
  33.     int (*set_sg)(struct net_device *, u32);  
  34.     u32 (*get_tso)(struct net_device *);  
  35.     int (*set_tso)(struct net_device *, u32);  
  36.     void    (*self_test)(struct net_device *, struct ethtool_test *, u64 *);  
  37.     void    (*get_strings)(struct net_device *, u32 stringset, u8 *);  
  38.     int (*set_phys_id)(struct net_device *, enum ethtool_phys_id_state);  
  39.     void    (*get_ethtool_stats)(struct net_device *,  
  40.                      struct ethtool_stats *, u64 *);  
  41.     int (*begin)(struct net_device *);  
  42.     void    (*complete)(struct net_device *);  
  43.     u32 (*get_ufo)(struct net_device *);  
  44.     int (*set_ufo)(struct net_device *, u32);  
  45.     u32 (*get_flags)(struct net_device *);  
  46.     int (*set_flags)(struct net_device *, u32);  
  47.     u32 (*get_priv_flags)(struct net_device *);  
  48.     int (*set_priv_flags)(struct net_device *, u32);  
  49.     int (*get_sset_count)(struct net_device *, int);  
  50.     int (*get_rxnfc)(struct net_device *,  
  51.                  struct ethtool_rxnfc *, u32 *rule_locs);  
  52.     int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *);  
  53.     int (*flash_device)(struct net_device *, struct ethtool_flash *);  
  54.     int (*reset)(struct net_device *, u32 *);  
  55.     int (*set_rx_ntuple)(struct net_device *,  
  56.                  struct ethtool_rx_ntuple *);  
  57.     int (*get_rxfh_indir)(struct net_device *,  
  58.                   struct ethtool_rxfh_indir *);  
  59.     int (*set_rxfh_indir)(struct net_device *,  
  60.                   const struct ethtool_rxfh_indir *);  
  61.     void    (*get_channels)(struct net_device *, struct ethtool_channels *);  
  62.     int (*set_channels)(struct net_device *, struct ethtool_channels *);  
  63.     int (*get_dump_flag)(struct net_device *, struct ethtool_dump *);  
  64.     int (*get_dump_data)(struct net_device *,  
  65.                  struct ethtool_dump *, void *);  
  66.     int (*set_dump)(struct net_device *, struct ethtool_dump *);  
  67.   
  68. };  
报错的几个字段都有,新版本声明如下:

[plain]  view plain copy
  1. struct ethtool_ops {  
  2.         int     (*get_settings)(struct net_device *, struct ethtool_cmd *);  
  3.         int     (*set_settings)(struct net_device *, struct ethtool_cmd *);  
  4.         void    (*get_drvinfo)(struct net_device *, struct ethtool_drvinfo *);  
  5.         int     (*get_regs_len)(struct net_device *);  
  6.         void    (*get_regs)(struct net_device *, struct ethtool_regs *, void *);  
  7.         void    (*get_wol)(struct net_device *, struct ethtool_wolinfo *);  
  8.         int     (*set_wol)(struct net_device *, struct ethtool_wolinfo *);  
  9.         u32     (*get_msglevel)(struct net_device *);  
  10.         void    (*set_msglevel)(struct net_device *, u32);  
  11.         int     (*nway_reset)(struct net_device *);  
  12.         u32     (*get_link)(struct net_device *);  
  13.         int     (*get_eeprom_len)(struct net_device *);  
  14.         int     (*get_eeprom)(struct net_device *,  
  15. struct ethtool_ops {  
  16.         int     (*get_settings)(struct net_device *, struct ethtool_cmd *);  
  17.         int     (*set_settings)(struct net_device *, struct ethtool_cmd *);  
  18.         void    (*get_drvinfo)(struct net_device *, struct ethtool_drvinfo *);  
  19.         int     (*get_regs_len)(struct net_device *);  
  20.         void    (*get_regs)(struct net_device *, struct ethtool_regs *, void *);  
  21.         void    (*get_wol)(struct net_device *, struct ethtool_wolinfo *);  
  22.         int     (*set_wol)(struct net_device *, struct ethtool_wolinfo *);  
  23.         u32     (*get_msglevel)(struct net_device *);  
  24.         void    (*set_msglevel)(struct net_device *, u32);  
  25.         int     (*nway_reset)(struct net_device *);  
  26.         u32     (*get_link)(struct net_device *);  
  27.         int     (*get_eeprom_len)(struct net_device *);  
  28.         int     (*get_eeprom)(struct net_device *,  
  29. struct ethtool_ops {  
  30.         int     (*get_settings)(struct net_device *, struct ethtool_cmd *);  
  31.         int     (*set_settings)(struct net_device *, struct ethtool_cmd *);  
  32.         void    (*get_drvinfo)(struct net_device *, struct ethtool_drvinfo *);  
  33.         int     (*get_regs_len)(struct net_device *);  
  34.         void    (*get_regs)(struct net_device *, struct ethtool_regs *, void *);  
  35.         void    (*get_wol)(struct net_device *, struct ethtool_wolinfo *);  
  36.         int     (*set_wol)(struct net_device *, struct ethtool_wolinfo *);  
  37.         u32     (*get_msglevel)(struct net_device *);  
  38.         void    (*set_msglevel)(struct net_device *, u32);  
  39.         int     (*nway_reset)(struct net_device *);  
  40.         u32     (*get_link)(struct net_device *);  
  41.         int     (*get_eeprom_len)(struct net_device *);  
  42.         int     (*get_eeprom)(struct net_device *,  
  43.                       struct ethtool_eeprom *, u8 *);  
  44.         int     (*set_eeprom)(struct net_device *,  
  45.                               struct ethtool_eeprom *, u8 *);  
  46.         int     (*get_coalesce)(struct net_device *, struct ethtool_coalesce *);  
  47.         int     (*set_coalesce)(struct net_device *, struct ethtool_coalesce *);  
  48.         void    (*get_ringparam)(struct net_device *,  
  49.                                  struct ethtool_ringparam *);  
  50.         int     (*set_ringparam)(struct net_device *,  
  51.                                  struct ethtool_ringparam *);  
  52.         void    (*get_pauseparam)(struct net_device *,  
  53.                                   struct ethtool_pauseparam*);  
  54.         int     (*set_pauseparam)(struct net_device *,  
  55.                                   struct ethtool_pauseparam*);  
  56.         void    (*self_test)(struct net_device *, struct ethtool_test *, u64 *);  
  57.         void    (*get_strings)(struct net_device *, u32 stringset, u8 *);  
  58.         int     (*set_phys_id)(struct net_device *, enum ethtool_phys_id_state);  
  59.         void    (*get_ethtool_stats)(struct net_device *,  
  60.                                      struct ethtool_stats *, u64 *);  
  61.         int     (*begin)(struct net_device *);  
  62.         void    (*complete)(struct net_device *);  
  63.         u32     (*get_priv_flags)(struct net_device *);  
  64.                        struct ethtool_eeprom *, u8 *);  
  65.         int     (*set_eeprom)(struct net_device *,  
  66.                               struct ethtool_eeprom *, u8 *);  
  67.         int     (*get_coalesce)(struct net_device *, struct ethtool_coalesce *);  
  68.         int     (*set_coalesce)(struct net_device *, struct ethtool_coalesce *);  
  69.         void    (*get_ringparam)(struct net_device *,  
  70.                                  struct ethtool_ringparam *);  
  71.         int     (*set_ringparam)(struct net_device *,  
  72.                                  struct ethtool_ringparam *);  
  73.         void    (*get_pauseparam)(struct net_device *,  
  74.                                   struct ethtool_pauseparam*);  
  75.         int     (*set_pauseparam)(struct net_device *,  
  76.                                   struct ethtool_pauseparam*);  
  77.         void    (*self_test)(struct net_device *, struct ethtool_test *, u64 *);  
  78.         void    (*get_strings)(struct net_device *, u32 stringset, u8 *);  
  79.         int     (*set_phys_id)(struct net_device *, enum ethtool_phys_id_state);  
  80.         void    (*get_ethtool_stats)(struct net_device *,  
  81.                                      struct ethtool_stats *, u64 *);  
  82.         int     (*begin)(struct net_device *);  
  83.         void    (*complete)(struct net_device *);  
  84.         u32     (*get_priv_flags)(struct net_device *);  
  85.        int     (*get_sset_count)(struct net_device *, int);  
  86.         int     (*get_rxnfc)(struct net_device *,  
  87.                              struct ethtool_rxnfc *, u32 *rule_locs);  
  88.         int     (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *);  
  89.         int     (*flash_device)(struct net_device *, struct ethtool_flash *);  
  90.         int     (*reset)(struct net_device *, u32 *);  
  91.         u32     (*get_rxfh_indir_size)(struct net_device *);  
  92.         int     (*get_rxfh_indir)(struct net_device *, u32 *);  
  93.         int     (*set_rxfh_indir)(struct net_device *, const u32 *);  
  94.         void    (*get_channels)(struct net_device *, struct ethtool_channels *);  
  95.         int     (*set_channels)(struct net_device *, struct ethtool_channels *);  
  96.         int     (*get_dump_flag)(struct net_device *, struct ethtool_dump *);  
  97.         int     (*get_dump_data)(struct net_device *,  
  98.                                  struct ethtool_dump *, void *);  
  99.         int     (*set_dump)(struct net_device *, struct ethtool_dump *);  
  100.   
  101. };  

对比可以看出,报错的几个字段都已经不存在了。因此将这几个字段定义删除即可。

1008行的错误也是这个问题。同样的修改方法,删除即可。

其余几行的问题在于结构体skb_frag_struct定义修改了,page成为了结构体,page.p才是指针:

[cpp]  view plain copy
  1. struct skb_frag_struct {  
  2.     struct {  
  3.         struct page *p;  
  4.     } page;  
  5. #if (BITS_PER_LONG > 32) || (PAGE_SIZE >= 65536)  
  6.     __u32 page_offset;  
  7.     __u32 size;  
  8. #else  
  9.     __u16 page_offset;  
  10.     __u16 size;  
  11. #endif  
  12. };  

将这几处使用page的地方修改为page.p即可。


实施步骤:

1、Vmware安装时会吧文件默认拷贝到/usr/lib/vmware-tools目录下

其中vmhgfs、vmxnet模块在/usr/lib/vmware-tools/modules/source目录下

[plain]  view plain copy
  1. cd /usr/lib/vmware-tools/modules/source  
2、解压vmhgfs.tar

[plain]  view plain copy
  1. tar -xvf vmhgfs.tar   
解压出vmhgfs-only文件夹

3、修改filesystem.c,用d_make_root替换d_alloc_root

[plain]  view plain copy
  1. sed -i 's/d_alloc_root/d_make_root/' ./vmhgfs-only/filesystem.c  
4、压缩vmhgfs.tar

[plain]  view plain copy
  1. tar cvf vmhgfs.tar vmhgfs-only  
5、解压vmxnet.tar
[plain]  view plain copy
  1. tar -xvf vmxnet.tar   
解压出vmxnet-only文件夹

6、修改vmxnet.c按照上述几个地方修改

[plain]  view plain copy
  1. 520-538:  
  2. static struct ethtool_ops  
  3. vmxnet_ethtool_ops = {  
  4.    .get_settings        = vmxnet_get_settings,  
  5.    .get_drvinfo         = vmxnet_get_drvinfo,  
  6.    .get_link            = ethtool_op_get_link,  
  7. /*   .get_rx_csum         = vmxnet_get_rx_csum,  
  8.    .set_rx_csum         = vmxnet_set_rx_csum,  
  9.    .get_tx_csum         = vmxnet_get_tx_csum,  
  10.    .set_tx_csum         = vmxnet_set_tx_csum,  
  11.    .get_sg              = ethtool_op_get_sg,  
  12.    .set_sg              = ethtool_op_set_sg,  
  13. #ifdef VMXNET_DO_TSO  
  14.    .get_tso             = ethtool_op_get_tso,  
  15.    .set_tso             = vmxnet_set_tso,  
  16. #   if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)  
  17.    .get_ufo             = ethtool_op_get_ufo,  
  18. #   endif  
  19. #endif */  
  20. };  
  21.   
  22. 1008:  
  23. /*      .ndo_set_multicast_list = &vmxnet_set_multicast_list,*/  
  24.   
  25. 2081-2085:  
  26. <pre name="code" class="plain">            dma = pci_map_page(lp->pdev,  
  27.                                frag->page.p,  
  28.                                frag->page_offset + offset,  
  29.                                frag->size - offset,  
  30.                                PCI_DMA_TODEVICE);</pre><br>  
  31. <br>  
  32. 2100-2104:<br>  
  33.       dma = pci_map_page(lp->pdev,<br>  
  34.                          frag->page.p,<br>  
  35.                          frag->page_offset,<br>  
  36.                          frag->size,<br>  
  37.                          PCI_DMA_TODEVICE);<br>  
  38. <br>  
  39. 2059:<br>  
  40.          skb_shinfo(skb)->frags[numFrags].page.p = lp->rxPages[dd->rxDriverNext2];  
  41. <pre></pre>  
  42. 7、压缩vmxnet.tar<pre name="code" class="plain">tar cvf vmxnet.tar vmxnet-only</pre>  
  43. <p>8、修改完成后,重新运行/usr/bin/vmware-config-tools.pl,即可正常安装。</p>  
  44. <p></p>  
  45. <pre name="code" class="plain">[root@Fedora bin]# ./vmware-config-tools.pl   
  46. Initializing...  
  47.   
  48.   
  49. Making sure services for VMware Tools are stopped.  
  50.   
  51. Stopping vmware-tools (via systemctl):                     [  OK  ]  
  52.   
  53. ................................................................................省略  
  54.   
  55. kernel headers of the running kernel  
  56.   
  57.   
  58. Searching for GCC...  
  59. Detected GCC binary at "/bin/gcc".  
  60. The path "/bin/gcc" appears to be a valid path to the gcc binary.  
  61. Would you like to change it? [no]   
  62.   
  63. Searching for a valid kernel header path...  
  64. Detected the kernel headers at "/lib/modules/3.4.0-1.fc17.i686/build/include".  
  65. The path "/lib/modules/3.4.0-1.fc17.i686/build/include" appears to be a valid   
  66. path to the 3.4.0-1.fc17.i686 kernel headers.  
  67. Would you like to change it? [no]   
  68. ................................................................................省略  
  69.   
  70. The VMware Host-Guest Filesystem allows for shared folders between the host OS   
  71. and the guest OS in a Fusion or Workstation virtual environment.  Do you wish   
  72. to enable this feature? [yes]   
  73.   
  74. Using 2.6.x kernel build system.  
  75. make: Entering directory `/tmp/vmware-root/modules/vmci-only'  
  76. make -C /lib/modules/3.4.0-1.fc17.i686/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \  
  77.   MODULEBUILDDIR= modules  
  78. make[1]: Entering directory `/usr/src/kernels/3.4.0-1.fc17.i686'  
  79.   CC [M]  /tmp/vmware-root/modules/vmci-only/linux/driver.o  
  80.   CC [M]  /tmp/vmware-root/modules/vmci-only/linux/vmciKernelIf.o  
  81.   CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciDatagram.o  
  82.   CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciDriver.o  
  83.   CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciRoute.o  
  84.   CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciContext.o  
  85.   CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciResource.o  
  86.   CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciEvent.o  
  87.   CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciHashtable.o  
  88.   CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciQPair.o  
  89.   CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciQueuePair.o  
  90.   CC [M]  /tmp/vmware-root/modules/vmci-only/common/vmciDoorbell.o  
  91.   CC [M]  /tmp/vmware-root/modules/vmci-only/driverLog.o  
  92. /tmp/vmware-root/modules/vmci-only/linux/driver.c: In function ‘__check_disable_host’:  
  93. /tmp/vmware-root/modules/vmci-only/linux/driver.c:2498:1: warning: return from incompatible pointer type [enabled by default]  
  94. /tmp/vmware-root/modules/vmci-only/linux/driver.c: In function ‘__check_disable_guest’:  
  95. /tmp/vmware-root/modules/vmci-only/linux/driver.c:2501:1: warning: return from incompatible pointer type [enabled by default]  
  96. /tmp/vmware-root/modules/vmci-only/linux/driver.c: In function ‘__check_disable_msi’:  
  97. /tmp/vmware-root/modules/vmci-only/linux/driver.c:2504:1: warning: return from incompatible pointer type [enabled by default]  
  98. /tmp/vmware-root/modules/vmci-only/linux/driver.c: In function ‘__check_disable_msix’:  
  99. /tmp/vmware-root/modules/vmci-only/linux/driver.c:2507:1: warning: return from incompatible pointer type [enabled by default]  
  100.   LD [M]  /tmp/vmware-root/modules/vmci-only/vmci.o  
  101.   Building modules, stage 2.  
  102.   MODPOST 1 modules  
  103.   CC      /tmp/vmware-root/modules/vmci-only/vmci.mod.o  
  104.   LD [M]  /tmp/vmware-root/modules/vmci-only/vmci.ko  
  105. make[1]: Leaving directory `/usr/src/kernels/3.4.0-1.fc17.i686'  
  106. make -C $PWD SRCROOT=$PWD/. \  
  107.   MODULEBUILDDIR= postbuild  
  108. make[1]: Entering directory `/tmp/vmware-root/modules/vmci-only'  
  109. make[1]: `postbuild' is up to date.  
  110. make[1]: Leaving directory `/tmp/vmware-root/modules/vmci-only'  
  111. cp -f vmci.ko ./../vmci.o  
  112. make: Leaving directory `/tmp/vmware-root/modules/vmci-only'  
  113. Using 2.6.x kernel build system.  
  114. make: Entering directory `/tmp/vmware-root/modules/vmhgfs-only'  
  115. make -C /lib/modules/3.4.0-1.fc17.i686/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \  
  116.   MODULEBUILDDIR= modules  
  117. make[1]: Entering directory `/usr/src/kernels/3.4.0-1.fc17.i686'  
  118.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/hgfsUtil.o  
  119.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/message.o  
  120.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/request.o  
  121.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/cpName.o  
  122.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/link.o  
  123.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/backdoorGcc32.o  
  124.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/tcp.o  
  125.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/hgfsEscape.o  
  126.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/rpcout.o  
  127.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/file.o  
  128.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/transport.o  
  129.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/inode.o  
  130.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/super.o  
  131.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/bdhandler.o  
  132.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/vmci.o  
  133.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/fsutil.o  
  134.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/dir.o  
  135.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/cpNameLinux.o  
  136.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/hgfsBd.o  
  137.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/filesystem.o  
  138.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/module.o  
  139.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/page.o  
  140.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/backdoor.o  
  141.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/stubs.o  
  142.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/cpNameLite.o  
  143.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/dentry.o  
  144.   CC [M]  /tmp/vmware-root/modules/vmhgfs-only/kernelStubsLinux.o  
  145. /tmp/vmware-root/modules/vmhgfs-only/file.c:128:4: warning: initialization from incompatible pointer type [enabled by default]  
  146. /tmp/vmware-root/modules/vmhgfs-only/file.c:128:4: warning: (near initialization for ‘HgfsFileFileOperations.fsync’) [enabled by default]  
  147. /tmp/vmware-root/modules/vmhgfs-only/inode.c:121:4: warning: initialization from incompatible pointer type [enabled by default]  
  148. /tmp/vmware-root/modules/vmhgfs-only/inode.c:121:4: warning: (near initialization for ‘HgfsDirInodeOperations.create’) [enabled by default]  
  149. /tmp/vmware-root/modules/vmhgfs-only/inode.c:124:4: warning: initialization from incompatible pointer type [enabled by default]  
  150. /tmp/vmware-root/modules/vmhgfs-only/inode.c:124:4: warning: (near initialization for ‘HgfsDirInodeOperations.mkdir’) [enabled by default]  
  151.   LD [M]  /tmp/vmware-root/modules/vmhgfs-only/vmhgfs.o  
  152.   Building modules, stage 2.  
  153.   MODPOST 1 modules  
  154.   CC      /tmp/vmware-root/modules/vmhgfs-only/vmhgfs.mod.o  
  155.   LD [M]  /tmp/vmware-root/modules/vmhgfs-only/vmhgfs.ko  
  156. make[1]: Leaving directory `/usr/src/kernels/3.4.0-1.fc17.i686'  
  157. make -C $PWD SRCROOT=$PWD/. \  
  158.   MODULEBUILDDIR= postbuild  
  159. make[1]: Entering directory `/tmp/vmware-root/modules/vmhgfs-only'  
  160. make[1]: `postbuild' is up to date.  
  161. make[1]: Leaving directory `/tmp/vmware-root/modules/vmhgfs-only'  
  162. cp -f vmhgfs.ko ./../vmhgfs.o  
  163. make: Leaving directory `/tmp/vmware-root/modules/vmhgfs-only'  
  164.   
  165. Using 2.6.x kernel build system.  
  166. make: Entering directory `/tmp/vmware-root/modules/vmxnet-only'  
  167. make -C /lib/modules/3.4.0-1.fc17.i686/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \  
  168.   MODULEBUILDDIR= modules  
  169. make[1]: Entering directory `/usr/src/kernels/3.4.0-1.fc17.i686'  
  170.   CC [M]  /tmp/vmware-root/modules/vmxnet-only/vmxnet.o  
  171. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:3021:1: warning: ‘vmxnet_set_multicast_list’ defined but not used [-Wunused-function]  
  172. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:389:1: warning: ‘vmxnet_get_tx_csum’ defined but not used [-Wunused-function]  
  173. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:411:1: warning: ‘vmxnet_get_rx_csum’ defined but not used [-Wunused-function]  
  174. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:438:1: warning: ‘vmxnet_set_tx_csum’ defined but not used [-Wunused-function]  
  175. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:474:1: warning: ‘vmxnet_set_rx_csum’ defined but not used [-Wunused-function]  
  176. /tmp/vmware-root/modules/vmxnet-only/vmxnet.c:503:1: warning: ‘vmxnet_set_tso’ defined but not used [-Wunused-function]  
  177.   Building modules, stage 2.  
  178.   MODPOST 1 modules  
  179.   CC      /tmp/vmware-root/modules/vmxnet-only/vmxnet.mod.o  
  180.   LD [M]  /tmp/vmware-root/modules/vmxnet-only/vmxnet.ko  
  181. make[1]: Leaving directory `/usr/src/kernels/3.4.0-1.fc17.i686'  
  182. make -C $PWD SRCROOT=$PWD/. \  
  183.   MODULEBUILDDIR= postbuild  
  184. make[1]: Entering directory `/tmp/vmware-root/modules/vmxnet-only'  
  185. make[1]: `postbuild' is up to date.  
  186. make[1]: Leaving directory `/tmp/vmware-root/modules/vmxnet-only'  
  187. cp -f vmxnet.ko ./../vmxnet.o  
  188. make: Leaving directory `/tmp/vmware-root/modules/vmxnet-only'  
  189.  <pre name="code" class="plain">................................................................................省略  
  190.   
  191. Enjoy,  
  192.   
  193. --the VMware team</pre>  
  194. <pre></pre>  
  195. <p></p>  
  196. <pre></pre>  
  197. 中间warnning没仔细看,料想无大碍。  
  198. <p></p>  
  199. <p>OK,在共享文件夹,在/mnt/hgfs下可以看到久违的共享文件了!</p>  
  200. <p>其实只是修改vmhgfs.tar中filesystem.c就可以了,vmxnet安装不成功不影响共享文件。这样比较简单些。</p>  
  201. <p></p>  
  202. <p>修改后的vmhgfs.tar与vmxnet.tar下载地址:</p>  
  203. <p><a href="http://download.youkuaiyun.com/detail/ceofit/4415017">http://download.youkuaiyun.com/detail/ceofit/4415017</a></p>  
  204. <p>整个VMware-tools有近60M,不传了。</p>  
  205. <p></p>  
  206. <p><span style="color:#FF0000"><strong>切忌,只是适用于版本</strong></span></p>  
  207. <p><span style="color:#FF0000"><strong>VMware 8.0.3 build-703057</strong></span></p>  
  208. <p><span style="color:#FF0000"><strong>VMwareTools-8.8.2-590212</strong></span></p>  
  209. <p><span style="color:#FF0000"><strong>其他版本不知道,请确保版本号后使用!最好是自己修改比较放心</strong></span></p>  
  210. <pre></pre>  
  211. <pre></pre>  
  212. <pre></pre>  
  213. <pre></pre>  
  214. <pre></pre>  
  215. <pre></pre>  
  216. <pre></pre>  
  217.   
<think>好的,用户遇到了访问文件时的错误,具体是访问`//tmp/VMwareDnD/WtvNbP`时出现问题。首先,我需要根据用户提供的引用信息和常见解决方法进行分析。 根据引用[1],错误提示可能是因为其他进程或用户正在访问该文件,导致当前脚本无法访问。解决方法包括使用`lsof`命令查找正在使用该文件的进程,并终止它们。用户需要运行`lsof //tmp/VMwareDnD/WtvNbP`来查看占用进程,然后使用`kill`命令结束这些进程。如果文件被锁定,可能需要等待或强制解除锁定。 另外,引用[3]提到了`$ORACLE_HOME`相关的路径,这可能暗示用户系统中运行着Oracle数据库或其他服务,这些服务可能占用临时文件。需要检查是否有Oracle进程意外占用了该文件,必要时重启相关服务。 同时,用户的问题涉及VMware的拖放功能(DnD),因此可能需要检查VMware Tools是否正常运行。重启VMware Tools服务或虚拟机本身可能解决问题。如果文件损坏,删除临时文件并重启拖放操作也是一个可行步骤。 权限问题也是常见原因,需要确认用户是否有权限访问该路径,使用`ls -l`检查文件权限,必要时用`chmod`或`chown`修改。 总结步骤:检查进程占用、处理文件锁定、检查VMware Tools、处理文件权限、删除临时文件。如果问题持续,可能需要进一步诊断系统日志或联系支持。</think>[逐步解决方案] 针对访问文件时出现错误`error accessing file //tmp/VMwareDnD/WtvNbP`的问题,请按以下步骤排查: 1. **检查文件占用进程** 使用`lsof`命令定位占用文件的进程: ```bash lsof //tmp/VMwareDnD/WtvNbP ``` 若输出显示有进程PID(如`VMware-tool 1234`),通过`kill -9 1234`终止进程[^1]。 2. **处理文件锁定状态** - 若文件被锁定,尝试等待操作完成 - 强制解除锁定(仅限紧急情况): ```bash sudo rm -f /var/lib/dpkg/lock-frontend sudo rm -f /var/lib/dpkg/lock ``` 3. **验证VMware Tools状态** - 在虚拟机菜单选择`VM > Reinstall VMware Tools` - 重启VMware Tools服务: ```bash sudo systemctl restart vmware-tools.service ``` 4. **检查文件权限** 执行权限验证命令: ```bash ls -l //tmp/VMwareDnD/WtvNbP ``` 若权限不足(如显示`root`所属),通过以下命令修改: ```bash sudo chmod 755 //tmp/VMwareDnD/WtvNbP sudo chown $USER:$USER //tmp/VMwareDnD/WtvNbP ``` 5. **清理临时文件** 删除问题文件后重启拖放功能: ```bash sudo rm -rf //tmp/VMwareDnD/WtvNbP ``` 随后在虚拟机执行一次新的文件拖放操作以重建缓存。 [补充说明] 若问题仍存在,建议检查: - VMware日志路径:`/var/log/vmware-vmsvc.log` - 系统日志:`journalctl -u vmware-tools.service` - 确认虚拟机配置中`drag and drop`功能已启用
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值