开发中须要用到linux环境,因此使用共享模式开发。经过samba服务器来实现。html
环境:linux
虚拟机 virtualboxmacos
虚拟系统 centos 6.6 windows
本机 macos 192.168.1.102centos
虚拟机选择桥接模式链接。在centos中使用ifconfig查看IP 获得192.168.1.107服务器
主机和客机防火墙都关掉而且相互ping通 service iptables status测试
参考:http://www.cnblogs.com/mchina/archive/2012/12/18/2816717.htmlrest
1.安装sambahtm
yum -y install samba samba-clientblog
2.配置samba
cp /etc/samba/smb.conf.bak /etc/samba/smb.conf #备份配置
vi /etc/samba/smb.conf
#======================= Global Settings ===================================== workgroup = WORKGROUP //定义工做组,也就是windows中的工做组概念 # ----------------------- Standalone Server Options ------------------------ security = share //共享级别,用户不须要帐号和密码便可访问 #============================ Share Definitions ============================== [public] //设置针对的是共享目录个别的设置,只对当前的共享资源起做用 comment = Public Stuff //对共享目录的说明文件,本身能够定义说明信息 path = /var/www/html //用来指定共享的目录,必选项 public = yes //全部人可查看,等效于guest ok = yes
service smb restart #重启服务
3.链接测试
mac下 finder,前往,链接服务器 或者是 command+K
smb://192.168.1.107