Windows Virtual Desktop(WVD) 部署虛擬桌面


DEPLOYMENT of Windows Virtual Desktop (WVDs)

  • 搬運英文版參考文檔,侵刪!

  • 目標結構和組成

    • 在Azure上部署一個virtual的AD Service,模擬on-premise的local AD, 這是我們建立的AD root。然后在這個virtual machine上面部署domain controller做auth的控制

    • 在Azure上部署一個virtualNet, 網關,建立VPN的point2site模式,實現本地到virtual net的連接。然后將AD Server所在的virtual machine, WVDs, attach到這個NET上面,實現本地到雲端機器的訪問。

    • 配置Domain Controller

    • 在DC的virtual machine上面安裝AD Connector, 負責將AAD和AD連接起來並完成信息同步。

    • 建立HostPool以及虛擬機,連接到vnet上面,並且做domain join

    • 在AD上面建立OU/Users,對這些users賦予訪問虛擬機的權限,等這個信息sync到AAD上面去

    • 通過webclient,使用上述users可以訪問到已經分配到的Virtual Desktop 資源。

      大概包括了這幾個步驟


詳細的內容在參考文檔里寫的比較清楚了,英文可以的推薦閱讀原文,我做簡述並且列一些關鍵點

具體部署

賬號以及基本用戶設置
  • 首先假設你已經有了Azure賬號,並且已經已經解決了錢的問題。

  • 登錄Azure Portal里面,在 HOME/Azure Active Directory里面找到用戶的tenantID(GUID), 到Windows Virtual Desktop Consent Page (https://rdweb.wvd.microsoft.com/)網頁下注冊一下,Server App和 Client App都注冊下,一路確定就好。找不到可以去參考文檔里看看。

  • 去AAD下面創建一個用戶,給Global Administrator權限,然后去Enterprise applications-All application-Windows Virtual Desktop里面add user給這個用戶tenant creator權限。

  • 記住賬號。

使用命令行創建一些賬戶
  • 首先解決一些module的安裝問題

    Set-executionpolicy -executionpolicy unrestricted
    Install-Module -Name Microsoft.RDInfra.RDPowerShell -Force
    Import-Module -Name Microsoft.RDInfra.RDPowerShell
    Install-Module -Name Az -AllowClobber -Force
    Import-Module -Name Az
    
  • 連接到自己的Azure賬戶上面,使用上面的tanent creator登錄

    Add-RdsAccount -DeploymentUrl "https://rdbroker.wvd.microsoft.com"
    
  • 新建Tenant,具體的tenantId應該已經知道了,subscriptionID在自己的訂閱賬戶里面,點進去就能找到,記住這個tenant。

    New-RdsTenant -Name CompanyWVDtenant -AadTenantId a1b2c3abaa-6f7a-bc3d4-b95c-a1b2c3d4 -AzureSubscriptionId a1b2c3d4-5bef-1234-abcd-a1b2c3abaa
    
  • RDS Owner, “Default Tenant Group” 不要動

    New-RdsRoleAssignment -RoleDefinitionName "RDS Owner" -UserPrincipalName wvdTenantCreator@yourCompany.upn -TenantGroupName "Default Tenant Group" -TenantName CompanyWVDtenant
    
Create HostPool
New-RdsHostPool -TenantName CompanyWVDtenant -name “WVD-Host-Pool01"
New-RdsHostPool -TenantName CompanyWVDtenant -name “WVD-Host-Pool02"
New-RdsAppGroup -TenantName CompanyWVDtenant -HostPoolName WVD-Host-Pool01 -AppGroupName “Desktop Application Group”
New-RdsAppGroup -TenantName CompanyWVDtenant -HostPoolName WVD-Host-Pool02 -AppGroupName “Remote Application Group”
建立一個Windows Virtual Desktop(WVD)作為Domain Controller(DC)
  • 在Azure找到添加WVD的入口,新建虛擬機,應該比較明顯。
  • Resource Group如果沒有的話可以新建,就是一個資源組的名字,記住。
  • image類型,選擇Image Windows Server ** Datacenter
  • 選擇配置,量力而行(選便宜一點的,默認的感覺有點貴)
  • Public inbound port 選None, 后面會指定
  • 最好Create一個新的disk放一些數據,不過我理解不建也沒關系,demo的話
  • Host Caching 選 None
設置Virtual Network
  • 設置一個虛擬局域網用戶資源通信,建立一個gateway,步驟比較多,可以參考上面的文檔來做。

  • Create一個Virtual Network資源

  • Public IP選擇 None

  • 其他的該取名字取名字

  • 創建好以后對這個資源進行配置

  • 特別是在這個network的IP Configurations中的ipconfig里,把動態地址改成靜態地址,static

    Change dynamic to static IP address

    無恥盜圖, 侵刪, 下同

  • 設置virtual network的DNS Server,選擇custom, 添加兩個地址,一個是DC機器的局域網內地址,另一個填8.8.8.8,這是與外部Google Public DNS Server連接

  • 修改address space

    Address space

  • subnet-GatewaySubnet里面建立一個10.0.1.0/24的subnet

建立VPN
  • Create Virtual Network Gateway

    Create virtual network gateway

  • 為Gateway做配置,在point-to-site configuration -> configure now -> 添加一個address pool,文章中使用的是172.16.0.0/24,可以選擇自己之前沒有用過的地址。

  • 在本地運行腳本創建證書

    #Root cert:
    $cert = New-SelfSignedCertificate -Type Custom -KeySpec Signature `
    -Subject "CN=P2SRootCert" -KeyExportPolicy Exportable `
    -HashAlgorithm sha256 -KeyLength 2048 `
    -CertStoreLocation "Cert:\CurrentUser\My" -KeyUsageProperty Sign -KeyUsage CertSign
    
    #client cert:
    New-SelfSignedCertificate -Type Custom -DnsName P2SChildCert -KeySpec Signature `
    -Subject "CN=P2SChildCert" -KeyExportPolicy Exportable `
    -HashAlgorithm sha256 -KeyLength 2048 `
    -CertStoreLocation "Cert:\CurrentUser\My" `
    -Signer $cert -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.2")
    
  • 具體的還有幾個小步驟,可以上參考文檔看,其實就是要把創建的證書的公鑰拿出來上傳到Point-to-site configuration上面去。

    Add name for root certificate

  • 下載這個頁面里面的VPN CLient,安裝,這樣你就可以在本地通過VPN連到你上面的局域網里面,完成后可以在本地利用VPN登上你的DC 虛擬機嘗試下。

配置AD Server
  • 首先把這個vm上的AD Server打開,直接貼圖了。

    img

img

img

img

img

img

img

img

img

  • 部署完以后選擇 Promote this server to a domain controller

    img

  • 對它做具體的配置,選擇 Add a new forest, 並且選擇你的domain name,比如adds.com。后面應該都默認的。

安裝 AD Connector
  • 首先在你虛擬AD上可以建一些OU 和user 這樣在connect AAD 並且sync以后,你可以在AAD下面看到這些設置,來檢驗是不是成功。

  • 建議勾選掉用戶第一次登錄必須修改密碼的選項,挺好找的,否則有點麻煩后面驗證的時候。

    Active Directory Users and Computers

  • [下載connector](Download directly at Microsoft from here: https://www.microsoft.com/en-us/download/confirmation.aspx?id=47594)

  • 安裝

    • Express Settings ->Customize
    • install
    • Connect your directories -> Add Directory
    • Azure AD sign-in configuration -> user principal name 選擇mail
    • Domain and OU filtering -> Sync selected domains and OUs ->選擇你自己要同步的OU
    • 一路往下點就可以
配置HostPool 安裝WVDs
分配用戶資源
  • 本地連上azure,
Add-RdsAccount -DeploymentUrl "https://rdbroker.wvd.microsoft.com"
  • check

    Get-RdsSessionHost CompanyWVDtenant WVD-Host-Pool01
    

    windows-virtual-desktop-67

  • Assign Users

    Add-RdsAppGroupUser -TenantName CompanyWVDtenant -HostPoolName WVD-Host-Pool01 -AppGroupName “Desktop Application Group” -UserPrincipalName username@YourCompany.COM
    
  • 這樣你指定的用戶就可以訪問對應Group里面的資源了。

登錄Virtual Desktop 大功告成
  • webclient使用剛才這個用戶的用戶名密碼登陸上去

    windows-virtual-desktop-78

  • 看到這個就算是成功了。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM