Alpine VMware 共享文件夹

Alpine VMware 共享文件夹

需要安装的依赖

apk add open-vm-tools open-vm-tools-hgfs

挂载命令

# 创建挂载的目标文件夹
mkdir -p /mnt/yysj
# 挂载共享文件夹 yysj 到 目录 /mnt/yysj
vmhgfs-fuse .host:/yysj /mnt/yysj
# yysj 共享文件夹的共享名称

执行挂载可能遇到的错误

fuse: device not found, try ‘modprobe fuse’ first

解决方案

创建 /etc/modules-load.d/modules.conf 文件

文件内容

fuse
loop

查看挂载情况

df -h
Filesystem                Size      Used Available Use% Mounted on
devtmpfs                 10.0M         0     10.0M   0% /dev
shm                     350.3M         0    350.3M   0% /dev/shm
/dev/sda3                96.2G    168.0M     91.1G   0% /
tmpfs                   140.1M    116.0K    140.0M   0% /run
/dev/sda1               271.1M     17.9M    234.2M   7% /boot
tmpfs                   350.3M         0    350.3M   0% /tmp
vmhgfs-fuse             500.1G    442.5G     57.7G  88% /mnt/yysj

取消挂载

#/mnt/yysj 挂载的目录
umount /mnt/yysj

开机自动挂载

创建文件 /etc/local.d/vmhgfs-fuse.start

vim /etc/local.d/vmhgfs-fuse.start
# 文件内容
vmhgfs-fuse .host:/yysj /mnt/yysj

文件授权

chmod +x vmhgfs-fuse.start

设置 local 服务开机启动

rc-update add local

参考链接

  • modprobe fuse 问题

https://unix.stackexchange.com/questions/496235/how-do-i-make-modprobe-fuse-and-modprobe-loop-persistent