Was this page helpful?

VMWARE ESX 與 Guest os (VM) NFS SAMBA共享

    內容表格
    沒有標頭

    原創OSSLab thx, alang
    本篇文章目前適用於ESX 3.5 , esx 4 應該也可行, 3i,4i  部份沒有測試 若有人可回報可行否 請告知
    .筆者認為應該可行

    如果ESX 本身環境是用來做測試, 需要大量掛載ISO 安裝,ESX ISO檔案在Host OS內才能使用安裝.一般方法是用電腦或VM下載好ISO用Fastscp(http://s852254.blogspot.com/2008/04/...sx-server.html)再傳送到Vmware ESX,但如果大量ISO files時,就會有點麻煩並且佔據ESX host os 空間.另外VM 與VM 之間交換檔案也是問題.

    本文目地就是為 方便Vmware ESX Host os與Guest os, 還有Guest os(VM) 之間交換files 方便. 

    為了Host OS穩定性與安全性,不建議在vmware esx 上做samba  或是nfs server,vmware esx host os 為Client 端.
    另外於新VM上面安裝 NFS 和 SAMBA Server.

    環境準備:

    在VM下的Samba server 和 NFS server 作業系統: CentOS 5.1
    在VM下的Samba Client : windows xp
    NFS Client : VMware ESX Server


    一、NFS Server 和 NFS Client配置

    1、NFS Server  配置  (作業系統:CentOS)

    [root@centos ~]# mkdir /vm-share                               // 新建立要掛載的目錄

    [root@centos ~]# yum install nfs-utils                           // 安裝NFS服務套件

    [root@centos ~]# vi /etc/exports                                  // 編輯配置文件
    /vm-share 192.168.0.0/24(rw,sync,) *(ro,sync)              // 添加此行,并保存后退出

    [root@centos ~]# /etc/init.d/portmap start                    // 啟動portmap服務
    [root@centos ~]# /etc/init.d/nfs start                           //  啟動nfs服務


    2、NFS client 配置 (作業系統:ESX Host OS)
    使用 VI 修改 vmserver 防火墻,允許 NFS Client 通過防火墻
    啟動 VI---切換到 Configuration---選擇“Security Profile”---選擇“Properties”---勾選“NFS Client”---確認

    [root@vmserver root]# /etc/init.d/portmap start             //  啟動portmap服務

    [root@vmserver root]# /usr/sbin/showmount -e 192.168.0.101     //  查看 NFS Server 可掛載的目錄
    Export list for 192.168.0.101:
    /vm-share (everyone)                                                   //  這裡顯示的就是可掛載的目錄

    [root@vmserver root]# mkdir /vmimages/installtools-from-centos        //  Esx Host os 讀取ISO 限制從 /vmimages/下  要創建共享目錄在這之下

    [root@vmserver root]# mount -t nfs 192.168.0.101:/vm-share /vmimages/installtools-from-centos          
                                                                                                             //  掛載 NFS Server的目錄到剛剛創建的文件目錄下

    [root@vmserver root]# mount                                                             //  查看掛載是否成功
    192.168.0.101:/vm-share on /vmimages/installtools-from-centos type nfs (rw,addr=192.168.0.101)   // 顯示此行表示掛載成功!


    二、Samba Server 和 Samba Client 配置

    1、Samba Server 配置 (作業系統:CentOS)

    [root@centos ~]# vi /etc/samba/smb.conf                      //  修改配置文件

    [global]                                                                       //   在此處進行修改
    security = user 改成 security = share

    [vm-share]                                                                  //   添加下面這些語句
    comment = Public file
    path = /vm-share
    read only = no
    public = yes

    [root@centos ~]# /etc/init.d/smb start                          //  啟動samba服務
     

    2、Samba Client 配置(作業系統:Windows XP
    開始 ==> 運行 ==> 輸入“192.168.0.101” 就會看到 centos 共享的目錄 /vm-share

    Was this page helpful?
    標籤 (Edit tags)
    • No tags
    您必須 登入 才能發佈評論。
    Powered by MindTouch Core