解决 ubuntu 1104 vm_share不能使用的问题

本文解决在较新Linux内核上安装VMware Tools时遇到的编译错误问题,特别是针对共享文件夹支持组件vmhgfs的未知字段错误。通过修改源码中的super.c文件,将.clear_inode替换为.evict_inode来解决此问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

If you’re trying to install vmware-tools inside a linux guest and get the dreaded
super.c:73: error: unknown field ‘clear_inode’ specified in initializer 
error while compiling vmhgfs for shared folder support (which I use a lot),

this will help (thanks to Anjo from German VMWare Forums):

  • unpack /usr/lib/vmware-tools/modules/source/vmhgfs.tar to somewhere
  • open vmhgfs-only/super.c in your favorite text editor
  • edit from
    1#ifndef VMW_USE_IGET_LOCKED
    2 .read_inode       = HgfsReadInode,
    3 #endif
    4 .clear_inode      = HgfsClearInode,
    5 .put_super        = HgfsPutSuper,
    6 .statfs              = HgfsStatfs,
    7 };

    to (note .clear_inode -> .evict_inode)

     

    1#ifndef VMW_USE_IGET_LOCKED
    2   .read_inode    = HgfsReadInode,
    3#endif
    4   .evict_inode   = HgfsClearInode,
    5   .put_super     = HgfsPutSuper,
    6   .statfs           = HgfsStatfs,
    7};
  • repack vmhgfs.tar including edited super.c
  • execute vmware-config-tools.pl
  • profit

 

原帖地址:http://gordonazmo.wordpress.com/2011/02/09/fixing-vmware-tools-vmhgfs-on-newer-kernels-probably-anything-2-6-36/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值