今天重启虚拟机上的时候发现前一天设置的共享文件夹无法打开了,查了一番资料最后处理好了,但着实费了点劲,记录一下,以免下次忘记。
场景:系统deepin15.11 + 虚拟机VMware Workstation 15 Pro
问题:设置完共享文件夹后,查看 /mnt/hgfs/ 下面发现不显示设置的共享文件夹,重启、重新设置都没用
解决方法:
重新安装VMware tools。
关闭虚拟机的情况下,点击VMware选项栏中的虚拟机,选择安装VMware Tools重装完就好了。
但如果你和我一样,这里是灰色不能选的,那就继续往下看。
- 首先找到位于你VMware安装目录下的linux.iso,我的安装地址在
F:\Program Files (x86)\VMware\VMware Workstation
,所以镜像文件就在F:\Program Files (x86)\VMware\VMware Workstation\linux.iso
TIPS:找不到的小伙伴,可以编辑虚拟机配置,然后选CD/DVD,在右边的连接选项中选择,使用物理驱动器,自动检测。然后重新打开设置,就能看到了镜像地址了,复制地址以后还原即可。
- 打开虚拟机,把linux.iso直接拖到桌面上,解压,进入解压目录,执行
sudo ./vmware-install.pl
,安装完即可发现共享文件夹
TIPS:一定要覆盖安装
说明:由于 VMware tools 安装过程需要很多步确认,在选择是否覆盖的步骤时,默认是不覆盖的,这样你安装完成后还是不能解决根本问题。本来查到的很多文章都说要重装VMware tools,但就是因为一直按enter键默认安装,导致安装了好几次都没有解决问题!
所以,亲测所有确认项目要都输入 yes。
具体安装过程:共需要13步确认,其中 11 和 12 步必须输入yes,不能使用默认
[root@bogon vmware-tools-distrib]# ./vmware-install.pl
The installer has detected an existing installation of open-vm-tools packages
on this system and will not attempt to remove and replace these user-space
applications. It is recommended to use the open-vm-tools packages provided by
the operating system. If you do not want to use the existing installation of
open-vm-tools packages and use VMware Tools, you must uninstall the
open-vm-tools packages and re-run this installer.
The packages that need to be removed are:
open-vm-tools
The installer will next check if there are any missing kernel drivers. Type yes if you want to do this, otherwise type no [yes] yes 1.输入 yes
INPUT: [yes]
Creating a new VMware Tools installer database using the tar4 format.
Installing VMware Tools. In which directory do you want to install the binary files? 2.这里回车默认
[/usr/bin]
INPUT: [/usr/bin] default What is the directory that contains the init directories (rc0.d/ to rc6.d/)? 3.回车默认
[/etc/rc.d]
INPUT: [/etc/rc.d] default What is the directory that contains the init scripts? 4.回车默认
[/etc/rc.d/init.d]
INPUT: [/etc/rc.d/init.d] default
In which directory do you want to install the daemon files? 5.回车默认
[/usr/sbin]
INPUT: [/usr/sbin] default
In which directory do you want to install the library files? 6.回车默认
[/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? 7.输入 yes [yes] yes
INPUT: [yes] In which directory do you want to install the documentation files? 8.回车默认
[/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] yes 9.输入 yes
INPUT: [yes]
The installation of VMware Tools 10.3.21 build-14772444 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] yes 10.输入 yes
INPUT: [yes]
You have chosen to install VMware Tools on top of an open-vm-tools package.
You will now be given the option to replace some commands provided by
open-vm-tools. Please note that if you replace any commands at this time and
later remove VMware Tools, it may be necessary to re-install the open-vm-tools.
The file /usr/bin/vmware-hgfsclient that this program was about to install
already exists. Overwrite? [no] yes **11.!!!!!注意:这里必须输入 yes**
INPUT: [yes]
The file /usr/bin/vmhgfs-fuse that this program was about to install already
exists. Overwrite? [no] yes **12.!!!!!!注意:这里必须输入 yes**
INPUT: [yes]
Initializing...
Making sure services for VMware Tools are stopped.
Stopping vmware-tools (via systemctl): [ OK ]
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 installer
or 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 13.输入 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)
Skipping configuring automatic kernel modules as no drivers were installed by
this installer.
Skipping rebuilding initrd boot image for kernel as no drivers to be included in boot image were installed by this installer.
The configuration of VMware Tools 10.3.21 build-14772444 for Linux for this
running kernel completed successfully.
Found VMware Tools CDROM mounted at /run/media/tys/VMware Tools. Ejecting
device /dev/sr0 ...
Enjoy, --the VMware team