Vmware虚拟机教程之VMWare+Ubuntu所遇问题解决之总结
白羽 2018-07-25 来源 :网络 阅读 1366 评论 0

摘要:本文将带你了解VMWare+Ubuntu所遇问题解决之总结,希望本文对大家学Vmware有所帮助。


一、 VMWare Worksation 10注册码
JZ6WK-4529P-HZAA1-9RAG6-33JNR
 
二、使用vi时,按方向键、空格键、Backspace键输出为乱码的问题
sudo vi /etc/vim/vimrc.tiny
文件中的倒数第二句话是“set compatible”,将“compatible”改为“nocompatible”,这样非兼容模式就可以解决方向键变ABCD的问题了。那么接下来要解决Backspace键的问题也非常简单,就在刚才那句话的后面加一句:set backspace=2。
 
三、Vmware Tools安装出错的解决方法
Vmware Tools安装过程,如果出现vmhgfs编译出错,会造成共享文件夹不可用,提示“无法更新运行时文件夹共享状态: 在客户机操作系统中装载共享文件夹”。
解决方法:
cd vmware-tools-distrib/lib/modules/source
tar xf vmhgfs.tar // 解压出vmhgfs-only文件夹,对下面提到的错误文件进行修改(修改前先改文件属性为可写。
tar cf vmhgfs.tar vmhgfs-only // 修改后重新打包再安装
sudo ./vmware-install.pl //安装Vmware Tools
 
以下是几种错误的解决方案,本人只遇到错误二,请根据您的实际情况做相应修改
错误一:
/tmp/modconfig-VTzwHO/vmhgfs-only/dir.c: Infunction ‘HgfsPackDirOpenRequest’:
/tmp/modconfig-VTzwHO/vmhgfs-only/dir.c:417:26:error: ‘struct file’ has no member named ‘f_dentry’
                      file->f_dentry) < 0) {
                          ^
/tmp/modconfig-VTzwHO/vmhgfs-only/dir.c: Infunction ‘HgfsDirLlseek’:
/tmp/modconfig-VTzwHO/vmhgfs-only/dir.c:707:32:error: ‘struct file’ has no member named ‘f_dentry’
   struct dentry *dentry = file->f_dentry;
                               ^
In file included from/tmp/modconfig-VTzwHO/vmhgfs-only/dir.c:39:0:
/tmp/modconfig-VTzwHO/vmhgfs-only/dir.c: Infunction ‘HgfsReaddirNextEntry’:
/tmp/modconfig-VTzwHO/vmhgfs-only/dir.c:993:31:error: ‘struct file’ has no member named ‘f_dentry’
   si = HGFS_SB_TO_COMMON(file->f_dentry->d_inode->i_sb);
                               ^
/tmp/modconfig-VTzwHO/vmhgfs-only/module.h:89:62:note: in definition of macro ‘HGFS_SB_TO_COMMON’
 #define HGFS_SB_TO_COMMON(sb)             ((HgfsSuperInfo *)(sb)->s_fs_info)
                                                              ^
/tmp/modconfig-VTzwHO/vmhgfs-only/dir.c:1082:26:error: ‘struct file’ has no member named ‘f_dentry’
         *entryIno = file->f_dentry->d_inode->i_ino;
                         ^
In file included from/tmp/modconfig-VTzwHO/vmhgfs-only/dir.c:30:0:
/tmp/modconfig-VTzwHO/vmhgfs-only/dir.c:1088:44:error: ‘struct file’ has no member named ‘f_dentry’
         *entryIno = compat_parent_ino(file->f_dentry);
                                            ^
/tmp/modconfig-VTzwHO/vmhgfs-only/./shared/compat_fs.h:120:46:note: in definition of macro ‘compat_parent_ino’
 #define compat_parent_ino(dentry) parent_ino(dentry)
                                              ^
/tmp/modconfig-VTzwHO/vmhgfs-only/dir.c:1093:52:error: ‘struct file’ has no member named ‘f_dentry’
     *entryIno = HgfsGetFileInode(&entryAttrs,file->f_dentry->d_inode->i_sb);
                                                    ^
/tmp/modconfig-VTzwHO/vmhgfs-only/dir.c: Infunction ‘HgfsDoReaddir’:
/tmp/modconfig-VTzwHO/vmhgfs-only/dir.c:1173:13:error: ‘struct file’ has no member named ‘f_dentry’
      !(file->f_dentry) ||
             ^
/tmp/modconfig-VTzwHO/vmhgfs-only/dir.c:1174:13:error: ‘struct file’ has no member named ‘f_dentry’
      !(file->f_dentry->d_inode)) {
             ^
make[2]: ***[/tmp/modconfig-VTzwHO/vmhgfs-only/dir.o] Error 1
make[1]: ***[_module_/tmp/modconfig-VTzwHO/vmhgfs-only] Error 2
make[1]: Leaving directory`/usr/src/linux-headers-3.19.0-25-generic'
make: *** [vmhgfs.ko] Error 2
make: Leaving directory`/tmp/modconfig-VTzwHO/vmhgfs-only'
 
解决:将vmhgfs-only/dir.c,vmhgfs-only/page.c,vmhgfs-only/file.c,vmhgfs-only/fsutil.c等文件里的f_dentry替换成f_path.dentry。
 
错误二:
In file included frominclude/linux/list.h:8:0,
                 from include/linux/preempt.h:10,
                 from include/linux/spinlock.h:50,
                 from include/linux/mmzone.h:7,
                 from include/linux/gfp.h:5,
                 from include/linux/mm.h:9,
                 from include/linux/pagemap.h:7,
                 from /tmp/modconfig-E9Upvb/vmhgfs-only/inode.c:29:
/tmp/modconfig-E9Upvb/vmhgfs-only/inode.c:In function ‘HgfsPermission’:
include/linux/kernel.h:811:27: error:‘struct dentry’ has no member named ‘d_alias’
 const typeof( ((type *)0)->member ) *__mptr = (ptr); \
                           ^
include/linux/list.h:688:40: note: inexpansion of macro ‘container_of’
 #define hlist_entry(ptr, type, member)container_of(ptr,type,member)
                                        ^
include/linux/list.h:699:15: note: inexpansion of macro ‘hlist_entry’
    ____ptr ? hlist_entry(____ptr, type, member) : NULL; \
               ^
include/linux/list.h:709:13: note: inexpansion of macro ‘hlist_entry_safe’
 for (pos = hlist_entry_safe((head)->first, typeof(*(pos)), member);\
             ^
/tmp/modconfig-E9Upvb/vmhgfs-only/inode.c:1922:7:note: in expansion of macro ‘hlist_for_each_entry’
      hlist_for_each_entry(dentry,
      ^
include/linux/kernel.h:811:48: warning:initialization from incompatible pointer type [enabled by default]
 const typeof( ((type *)0)->member ) *__mptr = (ptr); \
                                                ^
include/linux/list.h:688:40: note: inexpansion of macro ‘container_of’
 #define hlist_entry(ptr, type, member)container_of(ptr,type,member)
                                        ^
include/linux/list.h:699:15: note: inexpansion of macro ‘hlist_entry’
    ____ptr ? hlist_entry(____ptr, type, member) : NULL; \
               ^
include/linux/list.h:709:13: note: inexpansion of macro ‘hlist_entry_safe’
 for (pos = hlist_entry_safe((head)->first, typeof(*(pos)), member);\
             ^
/tmp/modconfig-E9Upvb/vmhgfs-only/inode.c:1922:7:note: in expansion of macro ‘hlist_for_each_entry’
      hlist_for_each_entry(dentry,
      ^
In file included frominclude/linux/compiler-gcc.h:106:0,
                 from include/linux/compiler.h:54,
                 from include/uapi/linux/stddef.h:1,
                 from include/linux/stddef.h:4,
                 from ./include/uapi/linux/posix_types.h:4,
                 from include/uapi/linux/types.h:13,
                 from include/linux/types.h:5,
                 from/tmp/modconfig-E9Upvb/vmhgfs-only/./shared/driver-config.h:71,
                 from /tmp/modconfig-E9Upvb/vmhgfs-only/inode.c:26:
include/linux/compiler-gcc4.h:14:34: error:‘struct dentry’ has no member named ‘d_alias’
 #define __compiler_offsetof(a,b) __builtin_offsetof(a,b)
                                  ^
include/linux/stddef.h:17:31: note: inexpansion of macro ‘__compiler_offsetof’
 #define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER)
                               ^
include/linux/kernel.h:812:29: note: inexpansion of macro ‘offsetof’
 (type *)( (char *)__mptr - offsetof(type,member) );})
                             ^
include/linux/list.h:688:40: note: inexpansion of macro ‘container_of’
 #define hlist_entry(ptr, type, member)container_of(ptr,type,member)
                                        ^
include/linux/list.h:699:15: note: inexpansion of macro ‘hlist_entry’
    ____ptr ? hlist_entry(____ptr, type, member) : NULL; \
               ^
include/linux/list.h:709:13: note: inexpansion of macro ‘hlist_entry_safe’
 for (pos = hlist_entry_safe((head)->first, typeof(*(pos)), member);\
             ^
/tmp/modconfig-E9Upvb/vmhgfs-only/inode.c:1922:7:note: in expansion of macro ‘hlist_for_each_entry’
      hlist_for_each_entry(dentry,
      ^
In file included frominclude/linux/preempt.h:10:0,
                 from include/linux/spinlock.h:50,
                 from include/linux/mmzone.h:7,
                frominclude/linux/gfp.h:5,
                 from include/linux/mm.h:9,
                 from include/linux/pagemap.h:7,
                 from /tmp/modconfig-E9Upvb/vmhgfs-only/inode.c:29:
include/linux/list.h:711:35: error: ‘structdentry’ has no member named ‘d_alias’
      pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member))
                                   ^
include/linux/list.h:698:12: note: indefinition of macro ‘hlist_entry_safe’
  ({typeof(ptr) ____ptr = (ptr); \
           ^
/tmp/modconfig-E9Upvb/vmhgfs-only/inode.c:1922:7:note: in expansion of macro ‘hlist_for_each_entry’
      hlist_for_each_entry(dentry,
      ^
include/linux/list.h:711:35: error: ‘structdentry’ has no member named ‘d_alias’
      pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member))
                                   ^
include/linux/list.h:698:28: note: indefinition of macro ‘hlist_entry_safe’
  ({typeof(ptr) ____ptr = (ptr); \
                            ^
/tmp/modconfig-E9Upvb/vmhgfs-only/inode.c:1922:7:note: in expansion of macro ‘hlist_for_each_entry’
      hlist_for_each_entry(dentry,
      ^
In file included frominclude/linux/list.h:8:0,
                 from include/linux/preempt.h:10,
                 from include/linux/spinlock.h:50,
                 from include/linux/mmzone.h:7,
                 from include/linux/gfp.h:5,
                 from include/linux/mm.h:9,
                 from include/linux/pagemap.h:7,
                 from /tmp/modconfig-E9Upvb/vmhgfs-only/inode.c:29:
include/linux/kernel.h:811:27: error:‘struct dentry’ has no member named ‘d_alias’
 const typeof( ((type *)0)->member ) *__mptr = (ptr); \
                           ^
include/linux/list.h:688:40: note: inexpansion of macro ‘container_of’
 #define hlist_entry(ptr, type, member)container_of(ptr,type,member)
                                        ^
include/linux/list.h:699:15: note: inexpansion of macro ‘hlist_entry’
    ____ptr ? hlist_entry(____ptr, type, member) : NULL; \
              ^
include/linux/list.h:711:13: note: inexpansion of macro ‘hlist_entry_safe’
      pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member))
             ^
/tmp/modconfig-E9Upvb/vmhgfs-only/inode.c:1922:7:note: in expansion of macro ‘hlist_for_each_entry’
      hlist_for_each_entry(dentry,
      ^
include/linux/kernel.h:811:48: warning:initialization makes pointer from integer without a cast [enabled by default]
 const typeof( ((type *)0)->member ) *__mptr = (ptr); \
                                                ^
include/linux/list.h:688:40: note: inexpansion of macro ‘container_of’
 #define hlist_entry(ptr, type, member)container_of(ptr,type,member)
                                        ^
include/linux/list.h:699:15: note: in expansionof macro ‘hlist_entry’
    ____ptr ? hlist_entry(____ptr, type, member) : NULL; \
               ^
include/linux/list.h:711:13: note: inexpansion of macro ‘hlist_entry_safe’
      pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member))
             ^
/tmp/modconfig-E9Upvb/vmhgfs-only/inode.c:1922:7:note: in expansion of macro ‘hlist_for_each_entry’
      hlist_for_each_entry(dentry,
      ^
In file included frominclude/linux/compiler-gcc.h:106:0,
                 from include/linux/compiler.h:54,
                 from include/uapi/linux/stddef.h:1,
                 from include/linux/stddef.h:4,
                 from ./include/uapi/linux/posix_types.h:4,
                 from include/uapi/linux/types.h:13,
                 from include/linux/types.h:5,
                 from/tmp/modconfig-E9Upvb/vmhgfs-only/./shared/driver-config.h:71,
                 from /tmp/modconfig-E9Upvb/vmhgfs-only/inode.c:26:
include/linux/compiler-gcc4.h:14:34: error:‘struct dentry’ has no member named ‘d_alias’
 #define __compiler_offsetof(a,b) __builtin_offsetof(a,b)
                                  ^
include/linux/stddef.h:17:31: note: inexpansion of macro ‘__compiler_offsetof’
 #define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER)
                              ^
include/linux/kernel.h:812:29: note: inexpansion of macro ‘offsetof’
 (type *)( (char *)__mptr - offsetof(type,member) );})
                             ^
include/linux/list.h:688:40: note: inexpansion of macro ‘container_of’
 #definehlist_entry(ptr, type, member) container_of(ptr,type,member)
                                        ^
include/linux/list.h:699:15: note: inexpansion of macro ‘hlist_entry’
    ____ptr ? hlist_entry(____ptr, type, member) : NULL; \
               ^
include/linux/list.h:711:13: note: inexpansion of macro ‘hlist_entry_safe’
      pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member))
             ^
/tmp/modconfig-E9Upvb/vmhgfs-only/inode.c:1922:7:note: in expansion of macro ‘hlist_for_each_entry’
hlist_for_each_entry(dentry,
 
解决:将vmhgfs-only/inode.c文件里的d_alias 替换成d_u.d_alias。
 
错误三:
/tmp/modconfig-4aUBme/vmhgfs-only/page.c:In function ‘HgfsWbRequestUnlock’:
/tmp/modconfig-4aUBme/vmhgfs-only/page.c:1681:4:error: implicit declaration of function ‘smp_mb__before_clear_bit’[-Werror=implicit-function-declaration]
   smp_mb__before_clear_bit();
   ^
/tmp/modconfig-4aUBme/vmhgfs-only/page.c:1683:4:error: implicit declaration of function ‘smp_mb__after_clear_bit’[-Werror=implicit-function-declaration]
   smp_mb__after_clear_bit();
   ^
cc1: some warnings being treated as errors
make[2]: ***[/tmp/modconfig-4aUBme/vmhgfs-only/page.o] Error 1
make[1]: ***[_module_/tmp/modconfig-4aUBme/vmhgfs-only] Error 2
 
解决:将vmhgfs-only/page.c文件里的smp_mb__before_clear_bit();和smp_mb__after_clear_bit();摒蔽。

 
     

本文由职坐标整理并发布,希望对同学们有所帮助。了解更多详情请关注职坐标系统运维之Vmware频道!

本文由 @白羽 发布于职坐标。未经许可,禁止转载。
喜欢 | 0 不喜欢 | 0
看完这篇文章有何感觉?已经有0人表态,0%的人喜欢 快给朋友分享吧~
评论(0)
后参与评论

您输入的评论内容中包含违禁敏感词

我知道了

助您圆梦职场 匹配合适岗位
验证码手机号,获得海同独家IT培训资料
选择就业方向:
人工智能物联网
大数据开发/分析
人工智能Python
Java全栈开发
WEB前端+H5

请输入正确的手机号码

请输入正确的验证码

获取验证码

您今天的短信下发次数太多了,明天再试试吧!

提交

我们会在第一时间安排职业规划师联系您!

您也可以联系我们的职业规划师咨询:

小职老师的微信号:z_zhizuobiao
小职老师的微信号:z_zhizuobiao

版权所有 职坐标-一站式IT培训就业服务领导者 沪ICP备13042190号-4
上海海同信息科技有限公司 Copyright ©2015 www.zhizuobiao.com,All Rights Reserved.
 沪公网安备 31011502005948号    

©2015 www.zhizuobiao.com All Rights Reserved

208小时内训课程