摘要:本文主要記錄瞭如何在VMware中的CentOS系統中,安裝VMware Tools。node
查看系統相關信息:c++
1 [root@localhost ~]# uname -r 2 3.10.0-327.el7.x86_64
查看已經安裝的kernel版本:centos
1 [root@localhost ~]# rpm -qa | grep kernel 2 kernel-tools-libs-3.10.0-327.el7.x86_64 3 kernel-3.10.0-327.el7.x86_64 4 kernel-tools-3.10.0-327.el7.x86_64
若是結果列表中有同系統版本不相同的版本,即後綴不是「3.10.0-327.el7.x86_64」的版本,則須要手動卸載和系統版本不相同的版本:session
1 [root@localhost ~]# yum remove kernel-3.10.0-1127.13.1.el7.x86_64
安裝所需依賴:app
1 [root@localhost ~]# yum -y install perl gcc gcc-c++ make cmake kernel kernel-headers kernel-devel net-tools
缺乏的包能夠下載:ide
https://buildlogs.centos.org/c7.1511.00/kernelpost
首先要將Vmware Tools加載到光驅裏,點擊菜單中的「虛擬機」,選擇「安裝 VMware Tools(T)...」:ui
將加載的光驅掛載到設備目錄,一般狀況下都是將設備目錄「/dev/cdrom」掛載到「/mnt/cdrom」目錄。this
先建立「/mnt/cdrom」目錄:spa
1 [root@localhost ~]# mkdir /mnt/cdrom
而後進行掛載:
1 [root@localhost ~]# mount /dev/cdrom /mnt/cdrom 2 mount: /dev/sr0 寫保護,將以只讀方式掛載
查看掛載後的目錄,並將安裝包複製到安裝目錄:
1 [root@localhost ~]# ll /mnt/cdrom/ 2 總用量 55889 3 -r-xr-xr-x. 1 root root 1975 3月 22 2018 manifest.txt 4 -r-xr-xr-x. 1 root root 4393 3月 22 2018 run_upgrader.sh 5 -r--r--r--. 1 root root 55485539 3月 22 2018 VMwareTools-10.2.5-8068393.tar.gz 6 -r-xr-xr-x. 1 root root 843372 3月 22 2018 vmware-tools-upgrader-32 7 -r-xr-xr-x. 1 root root 893640 3月 22 2018 vmware-tools-upgrader-64 8 [root@localhost ~]# cp /mnt/cdrom/VMwareTools-10.2.5-8068393.tar.gz ~
既然已經複製了安裝包,那麼就能夠解除掛載了:
1 [root@localhost ~]# umount /dev/cdrom
解壓並安裝:
1 [root@localhost ~]# tar -zxvf VMwareTools-10.2.5-8068393.tar.gz 2 ... 3 vmware-tools-distrib/vmware-install.pl 4 [root@localhost ~]# ./vmware-tools-distrib/vmware-install.pl
安裝過程以下:
1 [root@localhost ~]# ./vmware-tools-distrib/vmware-install.pl 2 open-vm-tools packages are available from the OS vendor and VMware recommends 3 using open-vm-tools packages. See http://kb.vmware.com/kb/2073803 for more 4 information. 5 Do you still want to proceed with this installation? [no] 6 7 INPUT: [no] default 8 9 [root@localhost ~]# ./vmware-tools-distrib/vmware-install.pl 10 open-vm-tools packages are available from the OS vendor and VMware recommends 11 using open-vm-tools packages. See http://kb.vmware.com/kb/2073803 for more 12 information. 13 Do you still want to proceed with this installation? [no] yes 14 15 INPUT: [yes] 16 17 Creating a new VMware Tools installer database using the tar4 format. 18 19 Installing VMware Tools. 20 21 In which directory do you want to install the binary files? 22 [/usr/bin] 23 24 INPUT: [/usr/bin] default 25 26 What is the directory that contains the init directories (rc0.d/ to rc6.d/)? 27 [/etc/rc.d] 28 29 INPUT: [/etc/rc.d] default 30 31 What is the directory that contains the init scripts? 32 [/etc/rc.d/init.d] 33 34 INPUT: [/etc/rc.d/init.d] default 35 36 In which directory do you want to install the daemon files? 37 [/usr/sbin] 38 39 INPUT: [/usr/sbin] default 40 41 In which directory do you want to install the library files? 42 [/usr/lib/vmware-tools] 43 44 INPUT: [/usr/lib/vmware-tools] default 45 46 The path "/usr/lib/vmware-tools" does not exist currently. This program is 47 going to create it, including needed parent directories. Is this what you want? 48 [yes] 49 50 INPUT: [yes] default 51 52 In which directory do you want to install the common agent library files? 53 [/usr/lib] 54 55 INPUT: [/usr/lib] default 56 57 In which directory do you want to install the common agent transient files? 58 [/var/lib] 59 60 INPUT: [/var/lib] default 61 62 In which directory do you want to install the documentation files? 63 [/usr/share/doc/vmware-tools] 64 65 INPUT: [/usr/share/doc/vmware-tools] default 66 67 The path "/usr/share/doc/vmware-tools" does not exist currently. This program 68 is going to create it, including needed parent directories. Is this what you 69 want? [yes] 70 71 INPUT: [yes] default 72 73 The installation of VMware Tools 10.2.5 build-8068393 for Linux completed 74 successfully. You can decide to remove this software from your system at any 75 time by invoking the following command: "/usr/bin/vmware-uninstall-tools.pl". 76 77 Before running VMware Tools for the first time, you need to configure it by 78 invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want 79 this program to invoke the command for you now? [yes] 80 81 INPUT: [yes] default 82 83 Initializing... 84 85 86 Making sure services for VMware Tools are stopped. 87 88 Stopping Thinprint services in the virtual machine: 89 Stopping Virtual Printing daemon: done 90 Stopping vmware-tools (via systemctl): [ 肯定 ] 91 92 93 The module vmci has already been installed on this system by another installer 94 or package and will not be modified by this installer. 95 96 The module vsock has already been installed on this system by another installer 97 or package and will not be modified by this installer. 98 99 The module vmxnet3 has already been installed on this system by another 100 installer or package and will not be modified by this installer. 101 102 The module pvscsi has already been installed on this system by another 103 installer or package and will not be modified by this installer. 104 105 The module vmmemctl has already been installed on this system by another 106 installer or package and will not be modified by this installer. 107 108 The VMware Host-Guest Filesystem allows for shared folders between the host OS 109 and the guest OS in a Fusion or Workstation virtual environment. Do you wish 110 to enable this feature? [yes] 111 112 INPUT: [yes] default 113 114 115 Before you can compile modules, you need to have the following installed... 116 117 make 118 gcc 119 kernel headers of the running kernel 120 121 122 Searching for GCC... 123 Detected GCC binary at "/bin/gcc". 124 The path "/bin/gcc" appears to be a valid path to the gcc binary. 125 Would you like to change it? [no] 126 127 INPUT: [no] default 128 129 Searching for a valid kernel header path... 130 Detected the kernel headers at 131 "/lib/modules/3.10.0-327.el7.x86_64/build/include". 132 The path "/lib/modules/3.10.0-327.el7.x86_64/build/include" appears to be a 133 valid path to the 3.10.0-327.el7.x86_64 kernel headers. 134 Would you like to change it? [no] 135 136 INPUT: [no] default 137 138 Using kernel build system. 139 make: 進入目錄「/tmp/modconfig-ZhY8Lb/vmhgfs-only」 140 /bin/make -C /lib/modules/3.10.0-327.el7.x86_64/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \ 141 MODULEBUILDDIR= modules 142 make[1]: 進入目錄「/usr/src/kernels/3.10.0-327.el7.x86_64」 143 CC [M] /tmp/modconfig-ZhY8Lb/vmhgfs-only/message.o 144 CC [M] /tmp/modconfig-ZhY8Lb/vmhgfs-only/dir.o 145 CC [M] /tmp/modconfig-ZhY8Lb/vmhgfs-only/request.o 146 CC [M] /tmp/modconfig-ZhY8Lb/vmhgfs-only/filesystem.o 147 CC [M] /tmp/modconfig-ZhY8Lb/vmhgfs-only/cpName.o 148 CC [M] /tmp/modconfig-ZhY8Lb/vmhgfs-only/rpcout.o 149 CC [M] /tmp/modconfig-ZhY8Lb/vmhgfs-only/stubs.o 150 CC [M] /tmp/modconfig-ZhY8Lb/vmhgfs-only/hgfsUtil.o 151 CC [M] /tmp/modconfig-ZhY8Lb/vmhgfs-only/hgfsEscape.o 152 CC [M] /tmp/modconfig-ZhY8Lb/vmhgfs-only/link.o 153 CC [M] /tmp/modconfig-ZhY8Lb/vmhgfs-only/transport.o 154 CC [M] /tmp/modconfig-ZhY8Lb/vmhgfs-only/module.o 155 CC [M] /tmp/modconfig-ZhY8Lb/vmhgfs-only/file.o 156 CC [M] /tmp/modconfig-ZhY8Lb/vmhgfs-only/super.o 157 CC [M] /tmp/modconfig-ZhY8Lb/vmhgfs-only/bdhandler.o 158 CC [M] /tmp/modconfig-ZhY8Lb/vmhgfs-only/fsutil.o 159 CC [M] /tmp/modconfig-ZhY8Lb/vmhgfs-only/cpNameLinux.o 160 CC [M] /tmp/modconfig-ZhY8Lb/vmhgfs-only/hgfsBd.o 161 CC [M] /tmp/modconfig-ZhY8Lb/vmhgfs-only/backdoorGcc64.o 162 CC [M] /tmp/modconfig-ZhY8Lb/vmhgfs-only/page.o 163 CC [M] /tmp/modconfig-ZhY8Lb/vmhgfs-only/backdoor.o 164 CC [M] /tmp/modconfig-ZhY8Lb/vmhgfs-only/inode.o 165 CC [M] /tmp/modconfig-ZhY8Lb/vmhgfs-only/dentry.o 166 CC [M] /tmp/modconfig-ZhY8Lb/vmhgfs-only/cpNameLite.o 167 CC [M] /tmp/modconfig-ZhY8Lb/vmhgfs-only/kernelStubsLinux.o 168 LD [M] /tmp/modconfig-ZhY8Lb/vmhgfs-only/vmhgfs.o 169 Building modules, stage 2. 170 MODPOST 1 modules 171 CC /tmp/modconfig-ZhY8Lb/vmhgfs-only/vmhgfs.mod.o 172 LD [M] /tmp/modconfig-ZhY8Lb/vmhgfs-only/vmhgfs.ko 173 make[1]: 離開目錄「/usr/src/kernels/3.10.0-327.el7.x86_64」 174 /bin/make -C $PWD SRCROOT=$PWD/. \ 175 MODULEBUILDDIR= postbuild 176 make[1]: 進入目錄「/tmp/modconfig-ZhY8Lb/vmhgfs-only」 177 make[1]: 「postbuild」是最新的。 178 make[1]: 離開目錄「/tmp/modconfig-ZhY8Lb/vmhgfs-only」 179 cp -f vmhgfs.ko ./../vmhgfs.o 180 make: 離開目錄「/tmp/modconfig-ZhY8Lb/vmhgfs-only」 181 182 The vmxnet driver is no longer supported on kernels 3.3 and greater. Please 183 upgrade to a newer virtual NIC. (e.g., vmxnet3 or e1000e) 184 185 The vmblock enables dragging or copying files between host and guest in a 186 Fusion or Workstation virtual environment. Do you wish to enable this feature? 187 [yes] 188 189 INPUT: [yes] default 190 191 NOTICE: It appears your system does not have the required fuse packages 192 installed. The VMware blocking filesystem requires the fuse packages and its 193 libraries to function properly. Please install the fuse or fuse-utils package 194 using your systems package management utility and re-run this script in order 195 to enable the VMware blocking filesystem. 196 197 VMware automatic kernel modules enables automatic building and installation of 198 VMware kernel modules at boot that are not already present. This feature can 199 be enabled/disabled by re-running vmware-config-tools.pl. 200 201 Would you like to enable VMware automatic kernel modules? 202 [yes] 203 204 INPUT: [yes] default 205 206 Do you want to enable Guest Authentication (vgauth)? Enabling vgauth is needed 207 if you want to enable Common Agent (caf). [yes] 208 209 INPUT: [yes] default 210 211 Do you want to enable Common Agent (caf)? [no] 212 213 INPUT: [no] default 214 215 No X install found. 216 217 Creating a new initrd boot image for the kernel. 218 Generating the key and certificate files. 219 Successfully generated the key and certificate files. 220 manageSELinux install: The 'semanage' utility was not found. 221 There was an error configuring the SELinux security context for VMware Tools. 222 Please make certain that SELinux is configured correctly. 223 224 The configuration of VMware Tools 10.2.5 build-8068393 for Linux for this 225 running kernel completed successfully. 226 227 You must restart your X session before any mouse or graphics changes take 228 effect. 229 230 To enable advanced X features (e.g., guest resolution fit, drag and drop, and 231 file and text copy/paste), you will need to do one (or more) of the following: 232 1. Manually start /usr/bin/vmware-user 233 2. Log out and log back into your desktop session 234 3. Restart your X session. 235 236 Enjoy, 237 238 --the VMware team 239 240 [root@localhost ~]#