在CentOS虚拟机中设置共享文件夹可以通过以下几种方法实现:
安装VMware Tools:
设置共享文件夹:
挂载共享文件夹:
mkdir /mnt/hgfs
。vmhgfs-fuse .host:/共享文件夹名 /mnt/hgfs
。自动挂载:
/etc/fstab
文件,添加如下内容:.host:/共享文件夹名 /mnt/hgfs fuse.vmhgfs-fuse allow_other,defaults 0 0
mount -a
。Windows端设置共享文件夹:
CentOS端设置:
smbclient
和 cifs-utils
:sudo yum install cifs-utils -y
。sudo mkdir /mnt/smb
。sudo mount -t cifs //Windows IP/共享文件夹名 /mnt/smb -o username=Windows用户名,password=Windows密码
。访问挂载点:
ls /mnt/smb
查看共享文件夹中的文件。通过以上步骤,可以在CentOS虚拟机中成功设置和访问共享文件夹。