y45t4r3 发表于 2015-1-4 09:17:34

vm虚拟机smb访问宿主主机共享文件

从linux上访问windows共享文件夹

环境: linux rhel 6.3 无界面安装
       vmvare workstation 9.0
虚拟机连网方式:host-only
                固定ip



[*]linux安装smb服务
#yum install samba


[*]检查linux防火墙和selinux设置。
关闭防火墙/etc/init.d/iptables stop
关闭selinux:    setenforce 0

3.windows上把文件夹共享设置,注意window的网络设置





4. client //计算机名/共享目录名    smbclient //5AEXHORF6ZEPK6D/softwares注:我用smbclient //ip地址/softwares没有成功,试了window主机的ip地址,也试了虚拟的ip地址,都没有成功,如果有朋友知道什么原因,希望留言帮助解答。
5.挂载windows共享目录,
# mount -t cifs //5AEXHORF6ZQPK4D/softwares /windows/
mount: wrong fs type, bad option, bad superblock on //5AEXHORF6ZQPK4D/softwares,
       missing codepage or helper program, or other error
       (for several filesystems (e.g. nfs, cifs) you might
       need a /sbin/mount.<type> helper program)
       In some cases useful info is found in syslog - try
       dmesg | tailor so

# dme
dmesg   dmeventd
# dme
dmesg   dmeventd
# dmesg |tail
Registering the dns_resolver key type
CIFS VFS: cifs_mount failed w/return code = -22
CIFS VFS: cifs_mount failed w/return code = -22
CIFS VFS: cifs_mount failed w/return code = -22
CIFS VFS: cifs_mount failed w/return code = -22
CIFS VFS: cifs_mount failed w/return code = -22
CIFS VFS: cifs_mount failed w/return code = -22
CIFS VFS: cifs_mount failed w/return code = -22
CIFS VFS: cifs_mount failed w/return code = -22
CIFS VFS: cifs_mount failed w/return code = -22

暂未解决。

6. 简单的传输文件可以用
# smbclient //5AEXHORF6ZQPK4D/softwares
Enter root's password:
Domain= OS= Server=
smb: \>


页: [1]
查看完整版本: vm虚拟机smb访问宿主主机共享文件