前言
通常VMware再安裝完虛擬機後,會自動安裝VMware Tools, 但有時候會因為各種原因導致Tool工具沒有正常安裝,下面就來講下如何重新安裝VMWare Tools及各類常見問題排查。
配置環境
VMware 15.1.0
Ubuntu 18.04
安裝流程
首選,保證虛擬機處於開機狀態,然後選擇「虛擬機->重新安裝VMware Tools(T)...」 或者 「虛擬機->安裝VMware Tools(T)...」:
此時會在虛擬的桌面生成「VMware Tools」的DVD光碟機掛載點,如下所示:
通過「mount | grep VM」,我們可以看到實際掛載在「/media/linux/VMware Tools」目錄,如下:
linux@ubuntu:~$ mount | grep VM/dev/sr0 on /media/linux/VMware Tools type iso9660 (ro,nosuid,nodev,relatime,nojoliet,check=s,map=n,blocksize=2048,uid=1000,gid=1000,dmode=500,fmode=400,uhelper=udisks2)linux@ubuntu:~$因此,我們可以進入到「/media/linux/VMware Tools」目錄,將VMwareTools壓縮包拷貝到家目錄下,如下所示:
linux@ubuntu:~$ cd /media/linux/VMware\ Toolslinux@ubuntu:/media/linux/VMware Tools$ lsmanifest.txtrun_upgrader.shVMwareTools-10.3.10-12406962.tar.gzvmware-tools-upgrader-32vmware-tools-upgrader-64linux@ubuntu:/media/linux/VMware Tools$ cp VMwareTools-10.3.10-12406962.tar.gz /home/linux/linux@ubuntu:/media/linux/VMware Tools$ cdlinux@ubuntu:~$ ls VMwareTools-10.3.10-12406962.tar.gzVMwareTools-10.3.10-12406962.tar.gzlinux@ubuntu:~$
然後解壓該壓縮包,得到vmware-tools-distrib目錄,如下:
linux@ubuntu:~$ tar -xf VMwareTools-10.3.10-12406962.tar.gzlinux@ubuntu:~$ lsDesktop PublicDocuments TemplatesDownloads Videosexamples.desktop VMwareTools-10.3.10-12406962.tar.gzMusic vmware-tools-distribPictureslinux@ubuntu:~$
進入「vmware-tools-distrib」目錄,運行「sudo ./vmware-install.pl 」 命令,然後一路的yes和回車即可,如下所示:
linux@ubuntu:~/vmware-tools-distrib$ cd ..linux@ubuntu:~$ cd vmware-tools-distrib/linux@ubuntu:~/vmware-tools-distrib$ lsbin doc FILES installer vgauthcaf etc INSTALL lib vmware-install.pllinux@ubuntu:~/vmware-tools-distrib$ sudo ./vmware-install.pl [sudo] password for linux: open-vm-tools packages are available from the OS vendor and VMware recommends using open-vm-tools packages. See http://kb.vmware.com/kb/2073803 for more information.Do you still want to proceed with this installation? [yes] yes
INPUT: [yes]
A previous installation of VMware Tools has been detected.
The previous installation was made by the tar installer (version 4).
Keeping the tar4 installer database format.
You have a version of VMware Tools installed. Continuing this install will first uninstall the currently installed version. Do you wish to continue? (yes/no) [yes] yes
INPUT: [yes]
Uninstalling the tar installation of VMware Tools.
Stopping services for VMware Tools
Stopping VMware Tools services in the virtual machine: Guest operating system daemon: done VGAuthService: done VMware User Agent (vmware-user): done Blocking file system: done Unmounting HGFS shares: done Guest filesystem driver: done
cat: /tmp/_cafenv-appconfig_: No such file or directoryThis program previously created the directory /etc/vmware-caf/pme/config, and was about to remove it. Since there are files in that directory that this program did not create, it will not be removed.
This program previously created the directory /etc/vmware-caf/pme, and was about to remove it. Since there are files in that directory that this program did not create, it will not be removed.
This program previously created the directory /etc/vmware-tools, and was about to remove it. Since there are files in that directory that this program did notcreate, it will not be removed.
This program previously created the directory /etc/vmware-caf, and was about toremove it. Since there are files in that directory that this program did not create, it will not be removed.
File /etc/pulse/default.pa is backed up to /etc/pulse/default.pa.old.0.
The removal of VMware Tools 10.3.10 build-12406962 for Linux completed successfully.
Installing VMware Tools.
In which directory do you want to install the binary files? [/usr/bin]
INPUT: [/usr/bin] default
What is the directory that contains the init directories (rc0.d/ to rc6.d/)? [/etc]
INPUT: [/etc] default
What is the directory that contains the init scripts? [/etc/init.d]
INPUT: [/etc/init.d] default
In which directory do you want to install the daemon files? [/usr/sbin]
INPUT: [/usr/sbin] default
In which directory do you want to install the library files? [/usr/lib/vmware-tools]
INPUT: [/usr/lib/vmware-tools] default
The path "/usr/lib/vmware-tools" does not exist currently. This program is going to create it, including needed parent directories. Is this what you want?[yes]
INPUT: [yes] default
In which directory do you want to install the common agent library files? [/usr/lib]
INPUT: [/usr/lib] default
In which directory do you want to install the common agent transient files? [/var/lib]
INPUT: [/var/lib] default
In which directory do you want to install the documentation files? [/usr/share/doc/vmware-tools]
INPUT: [/usr/share/doc/vmware-tools] default
The path "/usr/share/doc/vmware-tools" does not exist currently. This program is going to create it, including needed parent directories. Is this what you want? [yes]
INPUT: [yes] default
The installation of VMware Tools 10.3.10 build-12406962 for Linux completed successfully. You can decide to remove this software from your system at any time by invoking the following command: "/usr/bin/vmware-uninstall-tools.pl".
Before running VMware Tools for the first time, you need to configure it by invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want this program to invoke the command for you now? [yes]
INPUT: [yes] default
Initializing...
Making sure services for VMware Tools are stopped.
Stopping VMware Tools services in the virtual machine: Guest operating system daemon: done VGAuthService: done VMware User Agent (vmware-user): done Blocking file system: done Unmounting HGFS shares: done Guest filesystem driver: done
The module vmci has already been installed on this system by another installer or package and will not be modified by this installer.
The module vsock has already been installed on this system by another installeror package and will not be modified by this installer.
The module vmxnet3 has already been installed on this system by another installer or package and will not be modified by this installer.
The module pvscsi has already been installed on this system by another installer or package and will not be modified by this installer.
The module vmmemctl has already been installed on this system by another installer or package and will not be modified by this installer.
The VMware Host-Guest Filesystem allows for shared folders between the host OS and the guest OS in a Fusion or Workstation virtual environment. Do you wish to enable this feature? [yes] yes
INPUT: [yes]
The vmxnet driver is no longer supported on kernels 3.3 and greater. Please upgrade to a newer virtual NIC. (e.g., vmxnet3 or e1000e)
The vmblock enables dragging or copying files between host and guest in a Fusion or Workstation virtual environment. Do you wish to enable this feature?[yes] yes
INPUT: [yes]
Skipping configuring automatic kernel modules as no drivers were installed by this installer.
Disabling timer-based audio scheduling in pulseaudio.
Do you want to enable Guest Authentication (vgauth)? Enabling vgauth is needed if you want to enable Common Agent (caf). [yes] yes
INPUT: [yes]
Do you want to enable Common Agent (caf)? [no] yes
INPUT: [yes]
Detected X server version 1.20.5
Distribution provided drivers for Xorg X server are used.
Skipping X configuration because X drivers are not included.
Skipping rebuilding initrd boot image for kernel as no drivers to be included in boot image were installed by this installer.
NOTE: both /etc/vmware-tools/GuestProxyData/server/key.pem and /etc/vmware-tools/GuestProxyData/server/cert.pem already exist. They are not generated again. To regenerate them by force, use the "vmware-guestproxycerttool -g -f" command.
The configuration of VMware Tools 10.3.10 build-12406962 for Linux for this running kernel completed successfully.
You must restart your X session before any mouse or graphics changes take effect.
To enable advanced X features (e.g., guest resolution fit, drag and drop, and file and text copy/paste), you will need to do one (or more) of the following:1. Manually start /usr/bin/vmware-user2. Log out and log back into your desktop session3. Restart your X session.
Found VMware Tools CDROM mounted at /media/linux/VMware Tools. Ejecting device /dev/sr0 ...Enjoy,
linux@ubuntu:~/vmware-tools-distrib$
這樣正常就把VMware Tools安裝好了,至於在安裝之前和安裝之後出現的幾種常見問題,可根據如下常見問題排查進行排查.
常見問題排查
問題一:「安裝VMware Tools(T)...」處於灰化狀態
啟動虛機後,無法選擇「安裝VMware Tools(T)...」選項的,如下圖:
這可能是由於安裝了精簡版的workstations所致,可通過官網下載對應的tools工具包,官網地址如下:
http://softwareupdate.vmware.com/cds/vmw-desktop/ws/
以VMware workstations 15.1.0為例, 下載如下所示的工具包:
然後提取其中的ISO文件(如VMware workstatons 15.1.0對應的VMware-tools-windows-10.3.10-12406962.iso),然後通過菜單欄上的 「設置->虛擬機設置->CD/DVD->使用ISO鏡像文件」(虛擬機保持啟動狀態),選擇提取出來的ISO文件,此時就可以重新安裝Tools。
問題二、虛擬機窗口顯示太小
選擇菜單中的「查看->自動調整大小->自動適應客戶機」,即可自適應虛擬機窗口大小,將其平鋪至VMware主窗口中,如下:
問題三、如何掛載Windows主機的共享目錄
通過菜單欄上的「設置->虛擬機設置->選項->共享文件夾」,選擇「總是啟用」,並通過「添加「按鈕添加需要共享的目錄,點擊「確定」即可,如下所示:
此時,通過cd命令進入"/mnt/hgfs/",就可以看到已經掛載的目錄,如下所示:
linux@ubuntu:~/vmware-tools-distrib$ cd /mnt/hgfs/linux@ubuntu:/mnt/hgfs$ lsFlinux@ubuntu:/mnt/hgfs$喜歡的朋友關注下微信公眾號,並幫忙點個「贊」和「在看」吧
END