虚拟机共享文件夹失效
荆轲刺秦王虚拟机:VMware Workstation Pro系统:CentOS 7配置本地环境时,每次重启虚拟机,共享文件夹就失效,一开始是
·
荆轲刺秦王
虚拟机:VMware Workstation Pro
系统:CentOS 7
配置本地环境时,每次重启虚拟机,共享文件夹就失效,一开始我是每次重启后都将共享文件夹关闭后再开启,这样也能使共享文件夹生效,缺点就是太麻烦
于是找到解决方案如下:
vim /etc/rc.local
在最后一行加入:
vmhgfs-fuse .host:/ /mnt/hgfs
//如果需要普通用户也能使用共享目录,则需使用下面的命令挂载
vmhgfs-fuse -o allow_other .host:/ /mnt/hgfs
我的 rc.local 文件内容:
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.
touch /var/lock/subsys/local
ulimit -n 65535
service nginx start
vmhgfs-fuse -o allow_other .host:/ /mnt/hgfs
更多推荐
已为社区贡献5条内容
所有评论(0)