virtualbox虛擬機中的centos與macos共享文件夾

開發中須要用到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

相關文章
相關標籤/搜索