美文网首页
CentOS7安装VMware Tools

CentOS7安装VMware Tools

作者: 追梦小窝 | 来源:发表于2020-12-24 14:13 被阅读0次

    环境

    • 系统:Windows 10
    • 虚拟机:VMware ® Workstation 15 Pro 15.5.6 build-16341506
    • Centos:7.8

    检查

    首先检查系统里面是否安装了 VMware Tools

    • 卸载预装的 open-vm-tools 包,检测是否预装了 open-vm-tools
    yum list installed | grep open-vm-*
    
    • 卸载预装的程序包
    yum remove open-vm-tools
    
    • 再次确认是否卸载成功
    rpm -qa | grep open-vm-*
    
    • 重启虚拟机
    reboot
    

    安装

    点击 VMware菜单栏【虚拟机(M)】,选择【安装VMware Tools(T)...】;如果安装了早期版本的 VMware Tools,则菜单项为【更新 VMware Tools】

    image-20201224111517844 image-20201224111837353 image-20201224111911403 image-20201224112027332 image-20201224112249454

    挂载目录

    • 查看 cdrom 目录,在虚拟机中,以 root 身份登录客户机操作系统,打开终端窗口并运行ls /dev命令查看是否含有 cdrom 目录
    image-20201224112556535
    • 创建 /mnt/cdrom

    CD-ROM 挂载到其他目录下,一般是将 /dev/cdrom 挂载到 /mnt/cdrom 目录 使用 ls /mnt 查看是否已经含有 /cdrom 目录

    image-20201224112815961

    从上图中可以发现 /mnt 中含有 /cdrom 目录,如果没有出现上图的 cdrom 目录,则自己手动创建一个,使用命令 mkdir /mnt/cdrommkdir -p /mnt/cdrom(带上 -p 则可以一次创建多个目录),使用命令 ls /mnt 查看目录是否创建成功

    • 挂载目录

    使用命令 mount -t iso9660 /dev/cdrom /mnt/cdrom 将光盘挂载在 /mnt/cdrom 目录,并使用命令 ls /mnt/cdrom 查看是否挂载成功

    image-20201224113339736

    拷贝安装包

    • 拷贝安装包到 root 目录

    将后缀名为 tar.gz 的文件拷贝到 root 目录下,使用命令 cp /mnt/cdrom/ VMwareTools-10.3.21-14772444.tar.gz ~ ,并用命令 ls ~ 查看是否复制成功

    image-20201224113822688
    • 解除挂载

    使用命令 umount /dev/cdrom 解除挂载

    • 解压安装包,解压完成后使用命令ls ~查看是否解压成功
    [root@localhost ~]# tar -zxvf VMwareTools-10.3.21-14772444.tar.gz
    [root@localhost ~]# ls ~
    anaconda-ks.cfg  lnmp1.7  lnmp1.7.tar.gz  lnmp-install.log  VMwareTools-10.3.21-14772444.tar.gz  vmware-tools-distrib
    [root@localhost ~]#
    

    安装VMware Tools

    • 进入源码文件目录,使用命令 cd vmware-tools-distrib 进入到解压后的源码文件目录

    • 运行 vmware-install.pl 文件

    [root@localhost ~]# cd vmware-tools-distrib/
    [root@localhost vmware-tools-distrib]# 
    [root@localhost vmware-tools-distrib]# ./vmware-install.pl
    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? [no] yes
    
    INPUT: [yes]
    
    

    输入 yes 一路回车,然后检查是否成功

    Skipping rebuilding initrd boot image for kernel as no drivers to be included 
    in boot image were installed by this installer.
    
    Generating the key and certificate files.
    Successfully generated the key and certificate files.
    The configuration of VMware Tools 10.3.21 build-14772444 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-user
    2. Log out and log back into your desktop session
    3. Restart your X session.
    
    Enjoy,
    
    --the VMware team
    
    [root@localhost vmware-tools-distrib]# ls /mnt/hgfs/
    project
    [root@localhost vmware-tools-distrib]# 
    
    

    搞定!

    相关文章

      网友评论

          本文标题:CentOS7安装VMware Tools

          本文链接:https://www.haomeiwen.com/subject/pqjmnktx.html