VMware创建共享文件夹

VMware创建共享文件夹

𝓓𝓸𝓷 Lv6

VMware Workstation创建共享目录

一、创建共享文件夹

image-20230326225024967

二、VMware开启共享文件夹

虚拟机—设置—选项—共享文件夹—总是启用

image-20230326225516792

image-20230326230052896

image-20230326230306805

image-20230326230326436

image-20230326230417025

另一台服务器按以上相同的步骤创建共享文件夹。

三、虚拟机挂载目录
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
[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

四、设置开机自动挂载
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
[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

  • Title: VMware创建共享文件夹
  • Author: 𝓓𝓸𝓷
  • Created at : 2024-07-01 09:28:19
  • Updated at : 2024-07-20 09:20:46
  • Link: https://www.zhangdong.me/create-shared-folder-on-vmware.html
  • License: This work is licensed under CC BY-NC-SA 4.0.
评论