一、前言
有时候需要在Linux环境下进行开发,会通过安装虚拟机的方式使用Linux。如果不安装VMtool,虚拟机分辨率不方便设置,并且不能和宿主机之间进行复制粘贴,安装VMtool后虚拟机分辨率会自动随窗口大小变化,也可以直接右键进行复制粘贴。比如窗口是这样的:
二、软件环境
Vmware Workstation 16,Ubuntu 20.04 Desktop
三、流程
1、 在菜单的虚拟机菜单项下选择重新安装VMware Tools
2、 这时候虚拟机的光驱中会插入VMware Tools的安装光盘,将光盘中的文件复制出来解压,然后执行文件夹中的vmware-install.pl脚本文件,一直按回车下一步就可以安装完成。安装完成后重启,虚拟机的分辨率就可以随窗口大小自动变化了,也可以跟物理机直接进行复制粘贴操作。具体安装过程命令行贴在下面。
root@ubuntu:~# cp /media/pan/VMware\ Tools/VMwareTools-10.0.10-4301679.tar.gz ~/
root@ubuntu:~# tar -xzf VMwareTools-10.0.10-4301679.tar.gz
root@ubuntu:~# ./vmware-tools-distrib/vmware-install.pl
open-vm-tools are available from the OS vendor and VMware recommends using
open-vm-tools. See http://kb.vmware.com/kb/2073803 for more information.
Do you still want to proceed with this legacy installer? [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]
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
Common Agent: done
VGAuthService: done
VMware User Agent (vmware-user): done
Blocking file system: done
Unmounting HGFS shares: done
Guest filesystem driver: done
Stopping Thinprint services in the virtual machine:
Stopping Virtual Printing da