VMware创建共享文件夹
一、创建共享文件夹
二、VMware开启共享文件夹
虚拟机---设置---选项---共享文件夹---总是启用
另一台服务器按以上相同的步骤创建共享文件夹。
三、虚拟机挂载目录
[root@server01 ~]# mkdir /ogg
[root@server01 ~]# vmhgfs-fuse .host:/ShareDir /ogg -o subtype=vmhgfs-fuse,allow_other
ShareDir: Windows文件夹
ogg: 服务器目录
[root@server01 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 3.8G 0 3.8G 0% /dev
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 3.9G 13M 3.8G 1% /run
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/mapper/cl_server01-root 42G 38G 4.6G 90% /
vmhgfs-fuse 1.8T 1.6T 114G 94% /ogg
/dev/sda1 297M 216M 82M 73% /boot
tmpfs 781M 8.0K 781M 1% /run/user/42
tmpfs 781M 0 781M 0% /run/user/0
四、设置开机自动挂载
[root@server01 ~]# vim /etc/fstab
.host:/ShareDir /ogg fuse.vmhgfs-fuse defaults,allow_other 0 0
Persistent Mounts
There are 2 ways to specify the Shared Folders mounts persistently in /etc/fstab
Below there are both samples /etc/fstab line to mount a FUSE vmhgfs export.
Method 1: Specifying the file system
<file system> <mount point> <type> <options> <dump> <pass>
Replace <file system> with vmhgfs-fuse.
Replace <mount point> with the local file system on which the exported directory is mounted, which default replacement is to use /mnt/hgfs
Replace <type> with fuse.
Example:
vmhgfs-fuse /mnt/hgfs fuse defaults,allow_other 0 0
Method 2: Specifying the remote server and share
<server>:</remote/export> </local/directory> <fuse-type> <options> <dump> <pass>
Replace <server> with the hostname .host the shared folders name of the host server exporting the hosts file system.
Replace </remote/export> with the path to the exported directory which defaults to/or you can use the /share-name-you-created.
Replace </local/directory> with the local file system on which the exported directory is mounted, which defaults to /mnt/hgfs.
Replace <fuse-type> with fuse.vmhgfs-fuse.
Example:
.host:/ /mnt/hgfs fuse.vmhgfs-fuse defaults,allow_other 0 0
Note: Using either of the above formats should be fine