VMware player16 虚拟机 Ubuntu20.04

本文详细记录了解决在Ubuntu 20.04中使用VMware Player 16配置共享文件夹时遇到的vmshare文件夹丢失、挂载失败及open-vm-tools安装问题。通过切换用户、安装open-vm-tools并尝试不同挂载命令,最终找到解决方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

前言

为了熟悉Linux系统,以及学习Linux内核,在Win10系统装了VMware player16,跑Ubuntu 20.04(官网下载)。
要保证下载VMware tool,解压并安装好。


一、共享文件夹设置

在这里插入图片描述
在这里插入图片描述

二、问题:找不到vmshare文件夹

输入vmware-hgfsclient 能看到设置的共享文件夹

xxxxxxx@ubuntu:/$ vmware-hgfsclient
vmshare

然而,ls找不到该共享文件夹:
在这里插入图片描述

解决方法:

1.从普通用户切换到root用户

xxxxxx@ubuntu:/$ su
Password: 
root@ubuntu:/#

2.出现文件挂载的问题?

root@ubuntu:/# mount  -t vmhgfs .host:/vmshare /mnt/hgfs
Error: cannot mount filesystem: No such device

安装open-vm-dkms出现问题:

root@ubuntu:/# sudo apt-get install open-vm-dkms
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package open-vm-dkms

安装open-vm-tools成功,但依然出现文件挂载的问题:

root@ubuntu:/# apt-get install open-vm-tools
Reading package lists... Done
Building dependency tree       
Reading state information... Done
open-vm-tools is already the newest version (2:11.3.0-2ubuntu0~ubuntu20.04.2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

root@ubuntu:/# mount  -t vmhgfs .host:/vmshare /mnt/hgfs
Error: cannot mount filesystem: No such device

root@ubuntu:/# sudo mount -t  vmhgfs .host:/vmshare /mnt/hgfs
Error: cannot mount filesystem: No such device

更换一种挂载命令?

root@ubuntu:/mnt/hgfs# sudo vmhgfs-fuse .host:/ /mnt/hgfs
fuse: mountpoint is not empty
fuse: if you are sure this is safe, use the 'nonempty' mount option

root@ubuntu:/mnt/hgfs# sudo vmhgfs-fuse .host:/vmshare /mnt/hgfs
fuse: mountpoint is not empty
fuse: if you are sure this is safe, use the 'nonempty' mount option

解决:

root@ubuntu:/# sudo vmhgfs-fuse .host:/ /mnt/hgfs -o nonempty -o allow_other
root@ubuntu:/# ls /mnt/hgfs/
vmshare

3.此时切换到普通用户,共享文件夹也显示也正常了

root@ubuntu:/# su chuanye
xxxxxx@ubuntu:/$ ls /mnt/hgfs/
vmshare

参考资料:

资料1
资料2
资料3

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值