轉載一篇解決windows和centos虛擬機器共用主機目錄問題的方法,方法不同於ubuntu虛機

來源:互聯網
上載者:User

標籤:

在centos虛機安裝vmtools過程中有如下報錯


/tmp/modconfig-ygOywn/vmhgfs-only/inode.c: 在函數‘HgfsPermission’中: tmp/modconfig-ygOywn/vmhgfs-only/./shared/compat_dcache.h:57:38: 錯誤:‘struct dentry’沒有名為‘d_count’的成員 #define compat_d_count(dentry) dentry->d_count ^ /tmp/modconfig-ygOywn/vmhgfs-only/inode.c:1904:23: 附註:in expansion of macro compat_d_count’ int dcount = compat_d_count(dentry);

這就導致虛機centos無法和windows共用目錄了, 需要留意的是,centos虛機的解決辦法是不同於ubuntu虛機的。
這裡, 我們需要修改源碼compat_dcacche中的.h檔案

[root@localhost ~]# cd /tmp/vmware-tools-distrib/lib/modules/source/

[root@localhost source]# tar -xf vmhgfs.tar –解壓vmhgfs.tar,裡面有個vmhgfs-only檔案夾

[root@localhost source]# cd vmhgfs-only/–進入解壓後目錄

[root@localhost vmhgfs-only]# cd shared/

[root@localhost shared]# vim compat_dcache.h–開啟標頭檔

#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)#define compat_d_count(dentry) d_count(dentry)#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)#define compat_d_count(dentry) dentry->d_count#else#define compat_d_count(dentry) atomic_read(&dentry->d_count);#endif

這裡報錯了,不知道為什麼這樣,將


#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)

下面的#define改成

#define compat_d_count(dentry) d_count(dentry)

改完源碼後,重新歸檔

[root@localhost source]# tar -cf vmhgfs.tar vmhgfs-only/

[root@localhost source] cd /tmp/vmware-tools-distrib

[root@localhost vmware-tools-distrib]# ./vmware-install.p

重新安裝。這下成功了。。。

轉載一篇解決windows和centos虛擬機器共用主機目錄問題的方法,方法不同於ubuntu虛機

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.