安裝LINUX版VMWARE

昨天在WIN10上的CENTOS7的虛擬機中安裝VMWARE,試了VMWARE12_64,裝好後無法啓動,一直報Kernel Headers錯誤

像是這樣(圖片來自網絡),rpm -qa 包名發現已經安裝了,使用yum -y install 包名提示已經是最新版本


嘗試了很多方法,都不行,在網上百度谷歌,發現了這個

http://superuser.com/questions/976119/centos-7-as-guest-in-vmware-cant-drag-and-drop-cant-copy-and-paste

I have installed CentOS 7 as a guest under VMWare Workstation 7 on a Windows 7 host, and the problem is that I can't drag and drop files, nor copy and paste. VMWare's documentation has the following:

http://partnerweb.vmware.com/GOSIG/CentOS_7.html#Tools

Where they basically say that:

In order to enable drag and drop, you have to install the vmhgfs driver.
In order to install vmhgfs, you have to first install the open source Open VMware tools (the open-vm-tools package), and then install the VMWare's supplied VMWare Tools on top of that.
The problem is that, when installing the latter, it requires you to compile a kernel module, and when doing so, it asks for the path to the kernel headers, and no matter what you add, it says that the path is not valid. Basically, it's the same problem described here:

https://www.centos.org/forums/viewtopic.php?f=47&t=50812

If you google it, you'll find that there's a lot of people with the same problem. The solution usually suggested is to install the kernel-devel package, but I've done so, and it doesn't work either. I have two different kernel header packages installed:

kernel-devel-3.10.0-229.el7.x86_64
kernel-devel-3.10.0-229.l4.l.el7.x86_64
I've tried giving VMWare's installer all the following paths:

/usr/src/kernels/3.10.0-229.el7.x86_64
/usr/src/kernels/3.10.0-229.el7.x86_64/include
/usr/src/kernels/3.10.0-229.el7.x86_64/include/linux
/usr/src/kernels/3.10.0-229.l4.l.el7.x86_64
/usr/src/kernels/3.10.0-229.l4.l.el7.x86_64/include
/usr/src/kernels/3.10.0-229.l4.l.el7.x86_64/include/linux
And no matter what, it says that it's not a valid path.

As I said, if you google this, you'll find a lot of people with the same problem, while for others it seems to simply "work", without doing anything. What's going on?

這哥們估計是把谷歌翻遍了

UBUNTU的可以試試這個,應該管用,贊成率是我搜到的最高的了,可惜centos不適用,對應文件夾和version.h怎麼找都對不上

http://askubuntu.com/questions/40979/what-is-the-path-to-the-kernel-headers-so-i-can-install-vmware

cd /lib/modules/$(uname -r)/build/include/linux
sudo ln -s ../generated/utsrelease.h
sudo ln -s ../generated/autoconf.h
sudo ln -s ../generated/uapi/linux/version.h 
After adding the symlink, the path is /usr/src/linux-headers-$(uname -r)/include (Thanks @Kariem!)
還有這個,也是僅限ubuntu適用吧

http://askubuntu.com/questions/231876/vmware-cant-find-linux-headers-path

ln -s /usr/src/linux-3.7-rc6/include/generated/uapi/linux/version.h /usr/src/linux-3.7-rc6/include/linux/version.h

另外,網上最多的解決方法是

yum install kernel-devel 
這篇介紹得很經典 http://www.tecmint.com/install-vmware-workstation-11-in-linux/


關於centos的解決方法查到這樣一篇,估計是從國外網站拿過來的

http://mrlee23.iteye.com/blog/2124924

在 CentOS 7 中安裝 VMware 10.0.3之後無法正常工作,其實這主要是因爲 CentOS 7 中的kernel爲較低版本的kernel 3.10。
 
想運行vm需要有gcc ,kernel ,kernel-devel ,kernel-headers 這幾個組件。
用倉庫在線安裝就可以yum install -y。
 
要想在 CentOS 7 中正常安裝和運行 VMware 10.0.3必需執行如下步驟:
1.進行到/usr/lib/vmware/modules/source目錄
cd /usr/lib/vmware/modules/source
2.解壓vmnet.tar
tar -xvf vmnet.tar
3.進入到vmnet-only目錄
cd vmnet-only
4.編輯filter.c文件
vi filter.c
將206行和259行的
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
替換爲
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0)
5.回到上級目錄
cd ../
6.重新壓縮文件夾
tar -uvf vmnet.tar vmnet-only
7.移除舊目錄
rm -fr vmnet-only
8.重新打開 VMware 即可
發現在vmware12中這個tar裏面沒有filter.c文件了,搜索該jar中的所有.c文件,找不到
<pre name="code" class="plain">#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)


同樣不可用

放棄vmware12,去下載了vmware11,同樣的錯誤

後來換成普通服務器中裝vmware12也是這樣的錯,改成裝vmware11就沒問題了

TIPS:啓動vmware bundle時後臺會有一些報錯,如

Extracting VMware Installer...done.
Gtk-Message: Failed to load module "pk-gtk-module": libpk-gtk-module.so: cannot open shared object file: No such file or directory
Gtk-Message: Failed to load module "canberra-gtk-module": libcanberra-gtk-module.so: cannot open shared object file: No such file or directory

錯誤並不影響安裝

解決方法爲

http://www.aichengxu.com/view/38314

於是去找了個VMWorkstation,安裝的過程中報了兩個錯誤

Gtk-Message:Failedtoloadmodule"pk-gtk-module":libpk-gtk-module.so:cannotopensharedobjectfile:Nosuchfileordirectory

Gtk-Message:Failedtoloadmodule"canberra-gtk-module":libcanberra-gtk-module.so:cannotopensharedobjectfile:Nosuchfileordirectory

因爲能正常開啓VMware的安裝界面,所以當時也就忽略了這個問題,然而在開啓VMware時提示

Could not open /dev/vmmon:No such file or directory.Please make sure that the kernel module 'vmmon' is loaded

後來在網上察了很久,終於找到了解決方案,共分爲兩步

第一步

首先確定需要的module是否安裝及其位置

#locatelibpk-gtk-module.so

/usr/lib/gtk-2.0/modules/libpk-gtk-module.so

#locatelibcanberra-gtk-module.so

/usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so

找到之後,再添加系統加載modules的路徑

#vim/etc/ld.so.conf.d/gtk-2.0.conf

/usr/lib/gtk-2.0/modules 

然後重新加載下modules

#ldconfig
後來在VMWARE11中使用了這個方法,成功!估計VMWARE12中一樣的方法也可以解決問題,暫時不折騰VMWARE12了

http://www.aichengxu.com/view/38314

爲了修正內核版本與VMware不匹配的問題

使用root用戶依次執行以下命令

# service vmware stop
# rm /lib/modules/$(uname -r)/misc/vmmon.ko
# vmware-modconfig --console --build-mod vmmon /usr/bin/gcc /lib/modules/$(uname -r)/build/include/
# depmod -a
# service vmware start
終於解決了問題,再次謝謝不知名的作者(http://www.aichengxu.com/view/38314)


卸載方法

vmware-installer -u vmware-workstation

如果是player , vmware-installer -u vmware-player

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章