安装桌面
安装xf86-video-vmware open-vm-tools open-vm-kmod fusefs-libs包
pkg install -y xf86-video-vmware open-vm-tools open-vm-kmod fusefs-libs
启动时自动加载fuse
echo 'fusefs_load="YES"'>>/boot/loader.conf
建立/mnt/hgfs目录
mkdir /mnt/hgfs
建立/usr/local/etc/rc.d/vmhgs文件
#!/bin/sh
# PROVIDE: vmhgfs
# REQUIRE: NETWORKING vmware_guestd
# BEFORE: LOGIN
. /etc/rc.subr
name="vmhgfs"
rcvar="${name}_enable"
command="/usr/local/bin/vmhgfs-fuse"
command_args="-o allow_other,default_permissions /mnt/hgfs"
start_cmd="${name}_start"
stop_cmd="${name}_stop"
vmhgfs_start() {
if ! mount | grep -q "/mnt/hgfs"; then
echo "Mounting VMware HGFS share"
mkdir -p /mnt/hgfs
${command} ${command_args}
fi
}
vmhgfs_stop() {
if mount | grep -q "/mnt/hgfs"; then
echo "Unmounting VMware HGFS share"
umount -f /mnt/hgfs
fi
}
load_rc_config $name
run_rc_command "$1"
设置运行权限,设置启动时运行服务,以及运行次序
chmod 755 /usr/local/etc/rc.d/vmhgfs
sysrc vmhgfs_enable=YES
sysrc vmhgfs_after="netif vmware-guestd"
重启,显示正常了,也可以访问主机目录了
某AI的回复不能说完全没用,只能说是屎里淘金 ----------某知名不具的懒得学习的菜鸟留



3453

被折叠的 条评论
为什么被折叠?



