Centos shared file settings

Centos set shared folder

1. Mount the image file: Virtual Machine -> Settings -> Hardware -> CD/DVD. Select "Use IOS Image File" under "Connection" on the right, browse and select linux.iso under the virtual machine package directory (note that it is the virtual machine VMware installation directory)

2. Mount the VMware Tools installer to /mnt/cdrom/

mkdir /mnt/cdrom
mount /dev/cdrom /mnt/cdrom

3. Unzip and install VMware Tools

cd /mnt/cdrom
tar -zxvf VMware Tools-9.6.tar.gz -C /tmp

4. Install, press Enter all the way after entering

cd /tmp/vmware-tools-distrib/
./vmware-install.pl

5. Set the shared directory on the virtual machine interface: Virtual Machine -> Settings -> Options -> Shared Files

After the above steps are completed, generally speaking, there are folders shared above in /mnt/hgfs.

If not, follow the steps below:

The solution to the shared folder cannot be found after VMware-tools is installed

1. The general shared folder is /mnt/hgfsbelow , if not, use the following steps to see if there is a shared folder.

vmware-hgfsclient

2. /mnt/hgfsThere is no shared folder below, because it is not mounted, we can mount it. Use the following steps to mount all shares to /home/zxb/Share

/usr/bin/vmhgfs-fuse .host:/ /home/zxb/Share -o subtype=vmhgfs-fuse,allow_other

3. After restarting, if the following problems occur

[root@localhost zxb]# ls
ls: cannot access 'Share': Transport endpoint is not connected

Then you can use the following command to clear the mount. Note that Share is the file name. Repeat operation 2 again.

fusermount -u Share

postscript

The reason for the above problem is that every time you restart or switch users, the shared files need to be mounted again manually, that is, use the following command

vmhgfs-fuse .host:/ /mnt/hgfs

If you want the system to automatically mount after each reboot

vi /etc/fstab: 

Add a line at the end:

.host:/ /home/zxb/Share fuse.vmhgfs-fuse allow_other 0 0

Guess you like

Origin blog.csdn.net/watershed1993/article/details/115552637