Ubuntu 虚拟机无法共享文件夹

  • 1. 什么是虚拟机共享文件夹
  • 2. 如何开启虚拟机的共享文件夹
  • 3. 重新安装 VMware-tools
  • 参考链接

1. 什么是虚拟机共享文件夹

最近,遇到了一个很糟心的问题:我没办法将 Ubuntu 虚拟机中的文件复制粘贴到 Windows 主机中,或者说我无法通过 Windows 主机访问 Ubuntu 虚拟机中的文件。

经过搜索,我发现共享文件夹可以实现虚拟机和主机间的文件共享。

2. 如何开启虚拟机的共享文件夹

点击虚拟机软件最上方的菜单栏:
虚拟机->设置->选项,启用共享文件夹,并配置它在主机中的路径。

顺利的话,你会在/mnt/hgfs下发现你刚刚配置好的共享文件夹。我的共享文件夹是 sharey。

不顺利的话,/mnt下将没有任何文件。
如果你是这样的情况,那么可以接着往下看了。

3. 重新安装 VMware-tools

vmware-tools 可以实现虚拟机的文件共享。我的虚拟机“重新安装 VMware-tools” 是灰色的。

那么我们就需要找到 VMware-tools 的安装包进行安装了。
在虚拟机的安装目录下,有一个叫 linux.so 的文件,它就是我们需要的文件。

找到文件后,我们需要将这个镜像文件挂载到虚拟机上。还是点击最上方的菜单栏,
虚拟机->设置->硬件->CD/DVD,连接选择使用 ISO 映像文件,通过浏览打开刚才找到的 linux.so 文件。

之后重启虚拟机,桌面上就可以看到 VMware Tools 光盘文件了。

现在打开光盘文件,并解压 VMware tools 压缩包。

这里有一个值得注意的地方:不要在当前文件夹下解压。否则就会出现如下报错:提示空间不足。

解决办法也很简单,就是:把压缩包复制或剪切到另一个文件夹下,在另一个文件夹下解压即可。
如下图所示,解压成功。

之后,打开terminal,cd 到 vmware-tools-distrib, 执行 sudo ./vmware-install.pl

重点来了

一定要覆盖安装。

注意比对安装过程,不是每一步都选择 default 的。有些地方需要输入 yes 。
具体安装过程,参考了 VMware虚拟机设置了共享文件夹却找不到。

小伙伴们,千万要小心。因为我输了第二次才成功,一定要认真比对。
最后重启虚拟机,就可以在 /mnt/hgfs下发现你刚刚配置好的共享文件夹了。

[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.输入 yesINPUT: [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]  defaultIn which directory do you want to install the daemon files? 5.回车默认
[/usr/sbin] INPUT: [/usr/sbin]  defaultIn 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] yesINPUT: [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.输入 yesINPUT: [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.输入 yesINPUT: [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

共享文件夹出现了。

参考链接

  1. VMware虚拟机设置了共享文件夹却找不到
  2. 虚拟机中安装VMwareTools出错的解决办法:Not enough free space to extract VMwareTools

【亲测有效】解决 Ubuntu 虚拟机无法共享文件夹的问题相关推荐

  1. Ubuntu虚拟机设置共享文件夹

    Ubuntu虚拟机设置共享文件夹 注:个人笔记,小白笔记. 点击设置 进入到Ubuntu 中 cd /mnt/hgfs/ 后   我们会看到自己设置的共享文件夹. 转载于:https://www.cn ...

  2. Ubuntu虚拟机设置共享文件夹后/mnt下找不到hgfs文件夹

    --------------------------------- 今天用VMware装Ubuntu时设置共享文件夹出了问题.设置共享文件夹时没有报错,但虚拟机内/mnt下找不到hgfs文件夹. 找了 ...

  3. 虚拟机中Ubuntu与主机共享文件夹

    虚拟机中Ubuntu与主机共享文件夹,以及/mnt目录为空,没有共享文件夹时的解决方案 1.启用共享文件夹 首先将虚拟机关机,在虚拟机设置中,选择选项面板,选择共享文件夹,选择总是启用 点击添加,在弹 ...

  4. VMware 解决 ubuntu 虚拟机 复制文件 失败 闪退

    VMware 解决 ubuntu 虚拟机 复制文件 失败 闪退 问题 解决办法一 解决方法二 解决办法三(共享文件夹) 问题 在尝试将主机文件复制粘贴入虚拟机的文件夹中,会出现文件夹崩溃闪退的情况. ...

  5. 计算机桌面曝光,win7电脑桌面壁纸曝光过高影响图标怎么办?亲测实用解决方法...

    原标题:win7电脑桌面壁纸曝光过高影响图标怎么办?亲测实用解决方法 现在用win7系统的人应该还是挺多的吧,虽然说windows家族已经升级到现在的win11了,相信大多数人家用的电脑系统还是win ...

  6. 打开一个浏览器跳转到2345浏览器主页 这里以Google为例 亲测已解决。

    打开一个浏览器跳转到2345浏览器主页 这里以Google为例 亲测已解决. 1,打开浏览器,找到设置. 2,在设置里边找到 代理设置 点开. 3,点开常规,将方框内箭头位置的2345浏览器主页换成 ...

  7. pycharm安装第三方库:Try to run this command from the system terminal. Make sure that you use the问题,亲测已解决

    pycharm安装第三方库:报错Try to run this command from the system terminal. Make sure that you use the correct ...

  8. 如何解决电脑的电流声吱吱滋滋和爆破声咔咔,困扰一个月了亲测已经解决

    如何解决电脑的电流声吱吱滋滋和爆破声咔咔,困扰一个月了亲测已经解决 首先声明我的电脑配置: 华硕飞行堡垒FX系列  INTEL 酷睿 I5-4200H  原装硬盘大小 1TB  已使用2年 电脑出现的 ...

  9. Mac 活动监视器 闪退 pro发热耗电过快问题解决,亲测可用解决

    Mac 活动监视器 闪退 pro发热耗电过快问题解决,亲测可用解决 参考文章: (1)Mac 活动监视器 闪退 pro发热耗电过快问题解决,亲测可用解决 (2)https://www.cnblogs. ...

最新文章

  1. java bufferedwrite_Java BufferedWriter BufferedReader 源码分析
  2. 【BLE MIDI】MIDI 文件格式分析 ( FF 03 轨道名称 | FF 51 03 四分音符时长 )
  3. Python入门学习(四)
  4. hive怎样决定reducer个数
  5. Xshell5 评估过期,需要采购,不能使用
  6. PHP实现调用淘宝SDK开放接口返回天猫或淘宝商品详情
  7. VC6.0的工程设置解读Project--Settings
  8. oracle java 映射_java程序访问映射后的oracle
  9. linux shell 命令批量杀死进程
  10. Java同步队列(非阻塞队列与阻塞队列)——java并发容器
  11. sqlserver 汉字转拼音(转载)
  12. elementUI 输入框添加小图标
  13. 通过PCF8591读取电压值(AD转换)
  14. [shell] find 指令的使用 (如:找到大于10M的文件)
  15. anaconda python更换清华源
  16. ForestBlog博客源码学习笔记
  17. 信息孤岛影响_解读制造业信息化转型的11大关键点!
  18. 面试经验|计算机网络面试相关知识
  19. Gaze360: Physically Unconstrained Gaze Estimation in the Wild(在野外非受控的360°视线估计)
  20. 【闲书杂谈】《断舍离》——[日]山下英子

热门文章

  1. 如何有效地帮助新人融入项目中
  2. 计算机系统概述学后感,计算机操作系统学习心得体会总结(2)
  3. 李白 三五七言·秋风词
  4. vs2010c语言一闪而过,[转载]关于vs2010运行C程序时,运行结果窗口一闪而过的问题...
  5. 电子方面相关术语英中对照表
  6. 强化学习入门项目 Spinning up OpenAI (1) installation
  7. c语言 二分查找法 及二分查找法的时间复杂度。
  8. U盘启动模式USB-HDD/HDD+/ZIP/ZIP+/CDROM/FDD的区别
  9. 将单元格中的内容拆分成多列/行
  10. cfd-post 流线很少