標籤:
開發中需要用到linux環境,所以使用共用模式開發。通過samba伺服器來實現。
環境:
虛擬機器 virtualbox
虛擬系統 centos 6.6
本機 macos 192.168.1.102
虛擬機器選擇橋接模式串連。在centos中使用ifconfig查看IP 得到192.168.1.107
主機和客機防火牆都關掉並且相互ping通 service iptables status
參考:http://www.cnblogs.com/mchina/archive/2012/12/18/2816717.html
1.安裝samba
yum -y install samba samba-client
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
virtualbox虛擬機器中的centos與macos共用資料夾