Console命令
针对网上VM虚拟机如何设置共享文件夹不做赘述,自己搜索。
sudo vmhgfs-fuse .host:/ /mnt/ -o nonempty -o allow_other
Ubuntu启动运行
上述命令的缺点就是每次linux启动的时候都需要手动执行上述命令,所以我们需要修改启动文件自己执行。
sudo vim /etc/rc.local
编写文件内容
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
vmhgfs-fuse .host:/ /mnt/ -o nonempty -o allow_other #加载VM共享文件夹
修改执行权限
sudo chmod 777 /etc/rc.local
重启命令
init 6