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

从linux上访问windows共享文件夹


环境: linux rhel 6.3 无界面安装

       vmvare workstation 9.0

虚拟机连网方式:host-only

                固定ip

                

  1. linux安装smb服务

    #yum install samba

  2. 检查linux防火墙和selinux设置。

    关闭防火墙/etc/init.d/iptables stop

    关闭selinux:    setenforce 0

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


wKiom1Sngo_RqbyNAAFUU59UDDM905.jpg





 4. client //计算机名/共享目录名

    smbclient //5AEXHORF6ZEPK6D/softwares

注:我用smbclient //ip地址/softwares没有成功,试了window主机的ip地址,也试了虚拟的ip地址,都没有成功,如果有朋友知道什么原因,希望留言帮助解答。


5.  挂载windows共享目录,


[root@vm1 httpd-2.4.10]# 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 | tail  or so


[root@vm1 httpd-2.4.10]# dme

dmesg     dmeventd  

[root@vm1 httpd-2.4.10]# dme

dmesg     dmeventd  

[root@vm1 httpd-2.4.10]# 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. 简单的传输文件可以用

[root@vm1 httpd-2.4.10]# smbclient //5AEXHORF6ZQPK4D/softwares

Enter root's password: 

Domain=[5AEXHORF6ZQPK4D] OS=[Windows 7 Ultimate 7601 Service Pack 1] Server=[Windows 7 Ultimate 6.1]

smb: \> 

你可能感兴趣的:(windows,计算机,IP地址,linux安装)