首页 > 其他 > 详细

vm 将宿主机文件夹 映射至 虚拟机

时间:2019-08-04 15:17:26      阅读:51      评论:0      收藏:0      [点我收藏+]

一、关于centos如何安装(自行百度)

二、设置共享文件夹

  • 添加共享文件夹
虚拟机->设置->选项->共享文件夹

技术分享图片

三、安装vm-tools (请用root用户执行)

  • 3.1 安装vm-tools
yum install open-vm-tools open-vm-tools-desktop
  • 3.2 挂载
# 1 查看共享的目录
vmware-hgfsclient
# www

# 2 创建hgfs
mkdir -p /mnt/hgfs

# 3 用vmhgfs-fuse命令挂载目录
vmhgfs-fuse .host:/ /mnt/hgfs

# 4 此刻 www 目录即 真正挂载到 虚拟机上了
ls /mnt/hgfs
# www
  • 3.3 系统启动即自动挂载
    因为每次开机需要重新执行上述命令 ,所以想让系统自动挂载
# 1 执行命令
mount -t fuse.vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other
# 2 添加数据
vim /etc/fstab
# 在末尾另起一行 添加下面一行
.host:/ /mnt/hgfs fuse.vmhgfs-fuse allow_other 0 0
# 3 重新挂载
vmhgfs-fuse .host:/ /mnt/hgfs

四、软连接至/home 目录下

ln -s /mnt/hgfs/www /home/www

vm 将宿主机文件夹 映射至 虚拟机

原文:https://www.cnblogs.com/xiaobaiskill/p/11298236.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!