實作Horizon View for Linux VDI

千呼萬喚的Linux VDI終於在6/4/2015 release了,這幾天下來實測後做些整理,希望可以幫到有需要的IT同伴.

  1. 環境介紹
    1. vSphere platform : 6.0
      • Powershell 6.x 並安裝在vCenter上
    2. Horizon environment : 6.1.1
    3. Horizon Client : 3.4 (Windows/Mac OS X)
    4. Windows AD : 2008 R2
    5. DNS解析須可以解析View broker 位置
  2. Linux OS for VDI
    1. CentOS 6.6 x64 with jre-7u79
    2. RHEL6.6 x64 with jre-7u79
    3. ubuntu 12.04 with jre-7u80
    4. RHEL5.8 x64安裝設定皆正常,但無法連線
      • 有搭配過jre7u75, jre7u76,jreu79
  3. Protocol
    • 並非PCoIP,也不是RDP,是Blast (port 5443必須要跟security srv或是connection srv 之間的防火牆開通)
    • View Agent 與Connection Srv 須開通4001:4002:LDAP
    • Linux VDI 與vCenter 要開通 SSH:22,在透過powershell deploy view agent時會用到
  4. Horizon 6 for Linux VDI的功能
    • 不支援HTML Access
    • 不支援Client裝置(USB,Printer, Copy/Paste)對應的Linux VDI
    • 不支援Single Sign-On - 連線上Linux VDI後須再輸入Linux 的帳號密碼
    • 支援單向Audio (Linux VDI to Client)
    • 支援兩個螢幕以上 - 需要在虛擬顯示卡上作相對應的設定,一般我會建議雙螢幕+32MB 記憶體
    • KDE桌面沒有經過View Agent 認證,所以不建議使用
  5. Bug
    • 當在全螢幕輸入完帳號密碼登入桌面後,畫面會並不會AutoFit, 需要手動將畫面縮小或是放大使其重新AutoFit.
  6. 實作流程
    1. 創建guest customization specification, 名稱為linuxagent
      • Target Virtual Machine OS : Linux
      • Computer Name User the virtual machine name
      • Domain : 依照你的環境
      • Network Setting : Use standard network settings
      • Primary DNS : 依照你的環境
    2. 創建VM並設定顯示卡為2 monitor with 32MB 記憶體
    3. 安裝Linux OS (RHEL6.6, CentOS6.6, ubuntu12.04)
      • 不需要安裝KDE 桌面
    4. 安裝VMtools
      • tar zxvf /mnt/cdrom/VMwareTools-x.x.x-yyyy.tar.gz
      • sudo ./vmware-install.pa -d
    5. 安裝JRE
      • CentOS6.6/RHEL6.6 --> jre-7u79
        • Download jre-7u79-linux-i586.rpm or jre-7u79-linux-x64.rpm from http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html
        • Install the rpm: sudo rpm -i jre-7u79-linux-i586.rpm or sudo rpm -i jre-7u79-linux-x64.rpm
      • ubuntu12.04 --> jre-7u80
        • sudo add-apt-repository -y ppa:webupd8team/java
        • b sudo apt-get update
        • c sudo apt-get -y install oracle-java7-installer
    6. 創建一各Linux 帳號 ViewUser,並將該帳號home 搬移到/ "root"下,要設定該帳號之密碼
      • 當你的Linux有join NIS domain且將home mount到NFS上時,這點很重要,一定要作。
      • 編輯/etc/sudoers 並新增這行ViewUser ALL=(ALL) NOPASSWD:ALL
      • 若是使用RHEL/CentOS 須編輯/etc/sudoers 並將Defaults requiretty and Defaults !visiblepw 這兩行comment out.
    7. 關閉VM並創建snapshot
    8. 在vCenter上編輯input file 名稱為CloneVMs.csv,樣板如下
      • VMName,Parentvm,CustomSpec,Datastore,Host,FromSnapshot,DeleteIfPresent
      • linux-001,Ubuntu1204x64,linuxagent,datastore1,10.117.44.172,snapshot1,TRUE
      • linux-002,Ubuntu1204x64,linuxagent,datastore1,10.117.44.172,snapshot1,TRUE
      • linux-003,Ubuntu1204x64,linuxagent,datastore1,10.117.44.172,snapshot1,TRUE
      • linux-004,Ubuntu1204x64,linuxagent,datastore1,10.117.44.172,snapshot1,TRUE
      • linux-005,Ubuntu1204x64,linuxagent,datastore1,10.117.44.172,snapshot1,TRUE
    9. 創建CloneVMs.ps1,script 內容可從下列網址copy/paste
    10. 將CloneVMs.vcs 與CloneVMs.ps1放在同路徑下(Ex. C:\)
    11. 開啟VMware vSphere PowerCLI 並將路徑切換到C:\ 
      • 執行./CloneVMs.ps1
      • 輸入vCenter 位置
      • 輸入vCenter 管理員帳號
      • 輸入該帳號之密碼
      • 選擇要使用"Linked" 還是"Full" 模式
      • 是否要關閉vSphere VM Console, 預設為"Yes"
    12. vCenter將會創建Linux VDI VM
    13. 創建Installagent.ps1,script 可以從下列網址copy/paste
    14. 在VMware vSphere PowerCLI上執行 ./Installagent.ps1
      • 輸入vCenter 位置
      • 輸入vCenter 管理員帳號
      • 輸入該帳號之密碼
      • 輸入ESXi host帳號
      • 輸入該帳號之密碼
      • 輸入step6 的帳號 'ViewUser'
      • 輸入'ViewUser'的密碼
      • 輸入View Agent tar ball的位置 --> C:\VMware-viewagent-linux-x86_64-1.0-xxxx.tar
      • 輸入Horizon View Connection server位置
      • 輸入Horizon View Connection 管理員帳號
      • 輸入該帳號之密碼
      • 輸入該帳號之網域 
    15. 當script跑完後,在Horizon View\View Configuration\Registered Machines\Other檢查Linux VDI是否註冊上來
    16. 在Horizon View上創建Manual Pool並將這些Linux VDI 新增至該Pool
    17. 測試連線

還有兩個Script 還滿實用的,建議一併創建出來

  1. Uninstall View Agent on Linux Desktops
  2. Perform Operations on Linux Desktop Machines

留言

這個網誌中的熱門文章

How to build PrivacyIdea HA with MySQL with master and master replication

Update X710 firmware

Align Windows disk in ESX