3,713 瀏覽數

VMware fusion – Install CentOS7 vmware tool

在 VMware Funsion 安裝完 CentOS7 Minimal install 最小安裝之後還要安裝 VMware tool 遇到一堆問題.

open-vm-tools

現在都是直接安裝 open-vm-tools,那什麼是 open-vm-tools ?

open-vm-tools is a set of services and modules that enable several features in VMware products for better management of, and seamless user interactions with, guests. It includes kernel modules for enhancing the performance of virtual machines running Linux or other VMware supported Unix like guest operating systems.

依據官方網頁 http://partnerweb.vmware.com/GOSIG/CentOS_7.html 說明說要安裝 open-vm-tools , open-vm-tools-deploypkg 但卻出現

[root@localhost ~]# yum install open-vm-tools open-vm-tools-deploypkg
.....
Error: Package: open-vm-tools-deploypkg-9.4.10-3.x86_64 (installed)
           Requires: open-vm-tools < 9.5
           Removing: open-vm-tools-9.4.0-6.el7.x86_64 (@anaconda/7.1)
               open-vm-tools = 9.4.0-6.el7
           Updated By: open-vm-tools-9.10.2-4.el7.x86_64 (rhel-x86_64-server-7)
               open-vm-tools = 9.10.2-4.el7
           Available: open-vm-tools-9.4.0-3.el7.x86_64 (rhel-x86_64-server-7)
               open-vm-tools = 9.4.0-3.el7
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

後來才搞清楚原來 RHEL 7.2 提供的 open-vm-tools 已經包含了 DeployPkg ,所以不需要再額外安裝.

VMware tools

我們還是一樣可以用原先 VMware tools 提供的方式,但也是不好搞定.

[root@localhost ~]# mount -o loop /dev/sr0 /media/
[root@localhost ~]# cp /media/VMwareTools-9.9.4-3193940.tar.gz /root
[root@localhost ~]# umount /media/
[root@localhost ~]# tar zxvf VMwareTools-9.9.4-3193940.tar.gz 
[root@localhost ~]# cd vmware-tools-distrib/
[root@localhost vmware-tools-distrib]# ./vmware-install.pl 
-bash: ./vmware-install.pl: /usr/bin/perl: bad interpreter: 沒有此一檔案或目錄

需要安裝 perl

[root@localhost vmware-tools-distrib]# yum update
[root@localhost vmware-tools-distrib]# yum install perl
[root@localhost vmware-tools-distrib]# ./vmware-install.pl 
......
Setup is unable to find the "ifconfig" program on your machine.  Please make 
sure it is installed.  Do you want to specify the location of this program by 
hand? [yes] 

What is the location of the "ifconfig" program on your 
machine? 

需要 ifconfig (net-tools 套件) 工具

[root@localhost vmware-tools-distrib]# yum install net-tools
[root@localhost vmware-tools-distrib]# ./vmware-install.pl 
......
Searching for GCC...
The path "" is not valid path to the gcc binary.
Would you like to change it? [yes] 

What is the location of the gcc program on your machine? 

需要 gcc 套件

[root@localhost vmware-tools-distrib]# yum install gcc
[root@localhost vmware-tools-distrib]# ./vmware-install.pl 
......
Searching for a valid kernel header path...
The path "" is not a valid path to the 3.10.0-327.el7.x86_64 kernel headers.
Would you like to change it? [yes] 

Enter the path to the kernel header files for the 3.10.0-327.el7.x86_64 
kernel? 

Kernel header 需要 kernel-devel 套件,還需要將檔案複製到固定的目錄.

[root@localhost vmware-tools-distrib]# yum install kernel-devel
[root@localhost vmware-tools-distrib]# reboot
[root@localhost ~]# uname -r
3.10.0-327.28.3.el7.x86_64
[root@localhost ~]# cd /lib/modules/3.10.0-327.28.3.el7.x86_64/build/include/ 
[root@localhost include]# cp generated/uapi/linux/version.h linux/
[root@localhost include]# cd /root/vmware-tools-distrib/
[root@localhost vmware-tools-distrib]# ./vmware-install.pl 

[root@localhost vmware-tools-distrib]# reboot

重新開機就可以了.

發表迴響