在Fedora21下安装vmware报错的解决办法

时间:2022-06-21 07:08:23

关于VMWARE WORKSTATION在Fedora21下的安装问题

 

(1)在Fedora21下安装vmware如果在终端下启动,提示你找不到内核头文件Kernel Headers的话使用命令:

 

sudo yum install kernel-devel

 

你的内核头文件默认是在/usr/src/kernels下

使用命令后再检查内核头文件就应该已经存在了

 

<linux报错解决>在Fedora21下安装vmware报错的解决办法

 

(2)在内核头文件存在的情况下,如果提示报错如下:

 

Stopping vmware (via systemctl):                           [  确定  ]
make: Entering directory '/tmp/modconfig-czFWqw/vmnet-only'
Using kernel build system.
/bin/make -C /lib/modules/3.19.5-200.fc21.x86_64/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
  MODULEBUILDDIR= modules
make[1]: Entering directory '/usr/src/kernels/3.19.5-200.fc21.x86_64'
  CC [M]  /tmp/modconfig-czFWqw/vmnet-only/driver.o
  CC [M]  /tmp/modconfig-czFWqw/vmnet-only/hub.o
  CC [M]  /tmp/modconfig-czFWqw/vmnet-only/userif.o
  CC [M]  /tmp/modconfig-czFWqw/vmnet-only/netif.o
/tmp/modconfig-czFWqw/vmnet-only/driver.c: 在函数‘VNetFileOpUnlockedIoctl’中:
/tmp/modconfig-czFWqw/vmnet-only/driver.c:1194:20: 错误:‘struct file’没有名为‘f_dentry’的成员
    if (filp && filp->f_dentry) {
                    ^
/tmp/modconfig-czFWqw/vmnet-only/driver.c:1195:19: 错误:‘struct file’没有名为‘f_dentry’的成员
       inode = filp->f_dentry->d_inode;
                   ^
/tmp/modconfig-czFWqw/vmnet-only/userif.c: 在函数‘VNetCopyDatagram’中:
/tmp/modconfig-czFWqw/vmnet-only/userif.c:526:4: 错误:隐式声明函数‘skb_copy_datagram_iovec’ [-Werror=implicit-function-declaration]
    return skb_copy_datagram_iovec(skb, 0, &iov, len);
    ^
scripts/Makefile.build:257: recipe for target '/tmp/modconfig-czFWqw/vmnet-only/driver.o' failed
make[2]: *** [/tmp/modconfig-czFWqw/vmnet-only/driver.o] Error 1
make[2]: *** 正在等待未完成的任务....
In file included from include/linux/pci.h:34:0,
                 from /tmp/modconfig-czFWqw/vmnet-only/compat_netdevice.h:27,
                 from /tmp/modconfig-czFWqw/vmnet-only/netif.c:43:
include/linux/pci_ids.h:2251:0: 警告:“PCI_VENDOR_ID_VMWARE”重定义
 #define PCI_VENDOR_ID_VMWARE  0x15ad
 ^
In file included from /tmp/modconfig-czFWqw/vmnet-only/net.h:38:0,
                 from /tmp/modconfig-czFWqw/vmnet-only/vnetInt.h:26,
                 from /tmp/modconfig-czFWqw/vmnet-only/netif.c:42:
/tmp/modconfig-czFWqw/vmnet-only/vm_device_version.h:56:0: 附注:这是先前定义的位置
 #define PCI_VENDOR_ID_VMWARE                    0x15AD
 ^
cc1: some warnings being treated as errors
scripts/Makefile.build:257: recipe for target '/tmp/modconfig-czFWqw/vmnet-only/userif.o' failed
make[2]: *** [/tmp/modconfig-czFWqw/vmnet-only/userif.o] Error 1
Makefile:1386: recipe for target '_module_/tmp/modconfig-czFWqw/vmnet-only' failed
make[1]: *** [_module_/tmp/modconfig-czFWqw/vmnet-only] Error 2
make[1]: Leaving directory '/usr/src/kernels/3.19.5-200.fc21.x86_64'
Makefile:120: recipe for target 'vmnet.ko' failed
make: *** [vmnet.ko] Error 2
make: Leaving directory '/tmp/modconfig-czFWqw/vmnet-only'
Starting vmware (via systemctl):  Job for vmware.service failed. See "systemctl status vmware.service" and "journalctl -xe" for details.
                                                           [失败]                                        

 


即头文件中的内容和安装过程要求不符合的话,可以

使用修复后的源码包:

http://pan.baidu.com/s/1hqAcYzU

复制到以下目录下覆盖:

 

sudo cp vmnet.tar /usr/lib/vmware/modules/source

 

问题就解决了!