您的位置:首页 > 其它

在 VMWare 下安装 Ubuntu 13.10 的共享文件夹问题

2014-10-14 17:16 393 查看
最近在 VMWare 下面装了一个 Ubuntu,但是共享文件夹总是用不了,每次一加载就报 “无法更新运行时文件夹共享状态: 在客户机操作系统内装载共享文件夹文件系统时出错。”

好在有高人解决了这个问题,虽然不是官方的:

1. 先选“重新安装 VMWare Tools”, 然后解压到 home。

2. 建这么一个 shell 脚本并 sudo 运行:

fix.sh

Shell

12345678cd ~/vmware-tools-distrib/lib/modules/sourcesudo tar xf vmhgfs.tarsudo wget https://raw.github.com/rasa/vmware-tools-patches/master/patches/vmhgfs/vmhgfs-d_count-kernel-3.11-tools-9.6.0.patchsudo patch -p0 <vmhgfs-d_count-kernel-3.11-tools-9.6.0.patchsudo mv vmhgfs.tar vmhgfs.orig.tarsudo tar cf vmhgfs.tar vmhgfs-onlycd ~/vmware-tools-distribsudo ./vmware-install.pl
3. 一路回车之后重启。应该就好了。参考来源在这里这里。感谢补丁的作者。查看补丁具体内容
vmhgfs-d_count-kernel-3.11-tools-9.6.0.patchC

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

---
vmhgfs-only/inode.c
2013-08-15
22:32:22.000000000
-0700

+++
vmhgfs-only.patched/inode.c
2013-09-16
21:31:12.323041668
-0700

@@
-31,6
+31,9
@@

#include
<linux/namei.h>

#endif

#include
<linux/highmem.h>

+#if
LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)

+#include
<linux/dcache.h>

+#endif

#include
"compat_cred.h"

#include
"compat_fs.h"

@@
-1890,7
+1893,11
@@

#endif

&inode->i_dentry,

d_alias)
{

+#if
LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)

+
int
dcount
=
d_count(dentry);

+#else

int
dcount
=
dentry->d_count;

+#endif

if
(dcount)
{

LOG(4,
("Found
%s %d \n",
dentry->d_name.name,
dcount));

return
HgfsAccessInt(dentry,
mask
&
(MAY_READ
|
MAY_WRITE
|
MAY_EXEC));

@@
-1943,10
+1950,12
@@

list_for_each(pos,
&inode->i_dentry)
{

int
dcount;

struct
dentry
*dentry
=
list_entry(pos,
struct
dentry,
d_alias);

-#if
LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 38)

-
dcount
=
atomic_read(&dentry->d_count);

-#else

+#if
LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)

+
dcount
=
d_count(dentry);

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

dcount
=
dentry->d_count;

+#else

+
dcount
=
atomic_read(&dentry->d_count);

#endif

if
(dcount)
{

LOG(4,
("Found
%s %d \n",
(dentry)->d_name.name,
dcount));

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: