GPUs on Compute Engine  |  Compute Engine Documentation  |  Google Cloud

Establishing Chrome Distant Desktop for Home windows on Compute Engine

Interactive set up utilizing RDP

To put in Chrome Distant Desktop interactively, you want to have the ability to
connect with the distant VM with RDP. On this tutorial, you create the VM within the
default VPC with default firewall guidelines,
which exposes the RDP port 3339 to the web.

If this isn’t potential in your setting, use the
non-interactive technique
that is described later on this doc.

Create a Compute Engine occasion

Console

  1. Within the Cloud Console, go to the VM Situations web page:

    Go to the VM Situations web page

  2. Click on Create.

  3. Set the occasion identify to crdhost.

  4. Optionally, choose a area and zone that is near you.

  5. Underneath Machine configuration, change Machine variety to
    n1-standard-2 (2 vCPU).

  6. Click on CPU platform and GPU to broaden the part.

  7. Allow the Activate screen gadget checkbox as a result of Chrome Distant
    Desktop requires a screen gadget on Home windows VMs.

  8. Subsequent to the Boot disk description, click on Change to open the Boot
    disk
    panel

  9. Click on the Working system dropdown, after which choose Home windows Server.

  10. Click on the Model dropdown, after which choose Home windows Server 2019
    Datacenter
    .

  11. Be certain that the next values are set:

    • Boot disk variety is ready to Customary persistent disk.
    • Measurement (GB) is ready to 50.
  12. Click on Choose to shut the panel.

  13. Click on Create.

Cloud Shell

  1. Open Cloud Shell.

    Open Cloud Shell

  2. Set your most popular zone:

    ZONE=us-east1-b
    REGION=us-east1
    gcloud config set compute/zone "${ZONE}"
    
  3. Create a Compute Engine occasion through the use of the app graphic for
    Home windows Server 2019 Datacenter:

    gcloud compute cases create crdhost 
        --machine-type=n1-standard-2 
        --scopes=cloud-platform 
        --enable-display-device 
        --image-family=windows-2019 
        --image-project=windows-cloud 
        --boot-disk-size=50GB 
        --boot-disk-device-name=crdhost
    

    This command creates a Home windows Server 2019 digital machine that has an
    hooked up screen gadget (required for Chrome Distant Desktop on Home windows
    VMs) a 50GB boot disk, and grants the occasion full entry to
    Google Cloud APIs.

    Ignore the disk efficiency warning since you do not want excessive
    efficiency for this tutorial.

It takes a about 5 minutes to create your occasion.

Connect with the VM occasion through the use of RDP

  1. Within the Cloud Console, go to the VM cases web page.

    Go to the VM cases web page

  2. Be certain a inexperienced examine mark
    is displayed subsequent to the identify of your crdhost occasion,
    indicating that the occasion is prepared.

  3. Click on the occasion identify crdhost to open the VM occasion
    particulars
    web page.

  4. Underneath Distant entry, click on Set Home windows password, after which click on
    Set to create your account on the distant machine.

    This step generates a password for you. Make an observation of the password or copy
    it to a safe non permanent file.

  5. To hook up with the distant occasion through the use of the Chrome RDP app, click on
    the RDP button.

    If you happen to want to make use of an alternate RDP shopper, click on the drop-down
    arrow
    subsequent to the RDP button, after which choose Obtain the RDP
    file
    . You may open the RDP file through the use of your most popular RDP shopper.

  6. While you’re prompted, enter the password you simply generated, after which click on
    OK.

  7. To simply accept the server certificates and log into your distant Home windows occasion,
    click on Proceed.

  8. While you’re prompted whether or not you need your pc discoverable by
    different PCs and units on the community, click on No.

  9. Shut the Server Supervisor Dashboard whether it is open.

READ  Hack a Fb Account On XAMPP/WAMP

Set up Chrome and Chrome Distant Desktop

The subsequent step is to put in Google Chrome and the Chrome Distant Desktop service
on the VM occasion.

  1. In your RDP session, click on the Begin button on the Home windows taskbar,
    variety PowerShell, after which choose the Home windows PowerShell app.

  2. On the PowerShell immediate, allow HTTPS requests:

    [Net.ServicePointManager]::SecurityProtocol = "tls12, tls11, tls"
    
  3. Obtain and run the Chrome Distant Desktop Host installer.

    & {$P = $env:TEMP + 'chromeremotedesktophost.msi'; Invoke-WebRequest 'https://dl.google.com/edgedl/chrome-remote-desktop/chromeremotedesktophost.msi' -OutFile $P; Begin-Course of $P -Wait; Take away-Merchandise $P}
    
  4. While you’re prompted, affirm that you really want the installer to make
    adjustments.

  5. Obtain and run the Google Chrome installer.

    & {$P = $env:TEMP + 'chrome_installer.exe'; Invoke-WebRequest 'https://dl.google.com/chrome/set up/newest/chrome_installer.exe' -OutFile $P; Begin-Course of -FilePath $P -Args '/set up' -Verb RunAs -Wait; Take away-Merchandise $P}
    
  6. While you’re prompted, affirm that you really want the installer to make
    adjustments.

    When the set up completes, a Google Chrome window shall be opened on
    your distant desktop.

Arrange the Chrome Distant Desktop service

  1. Within the Google Chrome window in your distant desktop, go to the next URL:

    https://remotedesktop.google.com/entry/
    
  2. Log into the Google Account that you just wish to use to entry this machine.

  3. Within the Arrange distant entry dialog, click on Obtain


    to go to the Chrome Net Retailer web page.

  4. To put in the extension, click on Add to Chrome after which click on Add
    extension
    .

  5. On the Chrome Distant Desktop Setup web page, click on Subsequent to simply accept the
    pc identify.

  6. While you’re prompted, enter a 6-digit PIN. This quantity shall be used for
    extra authorization once you join later.

  7. Click on Begin.

  8. While you’re prompted, affirm that you really want the applying to make
    adjustments.

    The distant desktop service begins, and the standing proven for
    crdhost adjustments from Beginning to On-line

  9. Shut the Chrome home windows.

  10. Shut PowerShell.

  11. Shut the Distant Desktop window.

Now you can connect with the VM utilizing Chrome Distant Desktop.

Non-interactive set up

On this strategy, you configure the VM occasion to have a
GCESysprep specialize script
that runs when the VM is created.

With this strategy, the VM doesn’t have to be instantly accessible from the
web, though it nonetheless wants entry to the web.

Authorize the Chrome Distant Desktop service

You now generate a Home windows command that you just use later within the specialize script.
As a part of this process, you present authorization info that is included
within the command.

  1. In your native pc, utilizing the Chrome browser, go to the
    Chrome Distant Desktop command line setup web page

  2. If you happen to’re not already signed in, sign up with a Google Account. That is the
    account that shall be used for authorizing distant entry.

  3. Click on Start, then click on Subsequent.

  4. Click on Authorize.

  5. Enable Chrome Distant Desktop to entry your account.

    The web page now accommodates a number of command traces, one in all which is for Home windows
    (Cmd)
    that appears like the next:

    "%PROGRAMFILES(X86)%GoogleChrome Remote DesktopCurrentVersionremoting_start_host.exe" --code="4/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_XXXXXXXX" --redirect-url="https://remotedesktop.google.com/_/oauthredirect" --name=%COMPUTERNAME%
    

    The --code flag accommodates a singular short-lived OAuth token.

    The authorization code within the command line is legitimate for only some
    minutes, and you should utilize it solely as soon as.

    Maintain this web page open.

Copy the startup command to Cloud Shell

The subsequent step is to create a file in your Cloud Shell occasion
that accommodates the startup command that you just simply generated.

  1. Open Cloud Shell.

    Open Cloud Shell

  2. Create a file for the startup command:

    cat  > crd-auth-command.txt
    
  3. Go to the web page that has the Chrome Distant Desktop startup command and duplicate
    the Home windows (Cmd) command line.

  4. In Cloud Shell paste the command so as to add it to the file.

  5. Press Enter to finish the road, after which press Management-D
    to shut the file.

Create the GCESysprep specialize script

  • Copy the next code block and paste it into Cloud Shell.

    cat << "EOF" > crd-sysprep-script.ps1
    <#
    .SYNOPSIS
    GCESysprep specialize script for unattended Chrome Remote Desktop installation.
    #>
    $ErrorActionPreference = 'cease'
    perform Get-Metadata([String]$metadataName) {
    attempt {
    $worth = (Invoke-RestMethod `
    -Headers @{'Metadata-Taste' = 'Google'} `
    -Uri "http://metadata.google.internal/computeMetadata/v1/instance/attributes/$metadataName")
    }
    catch {
    # Report however ignore REST errors.
    Write-Host $_
    }
    if ($worth -eq $null -or $worth.Size -eq 0) {
    throw "Metadata value for ""$metadataName"" not specified. Skipping Chrome Remote Desktop service installation."
    }
    return $worth
    }
    # Get config from metadata
    #
    $crdCommand = Get-Metadata('crd-command')
    $crdPin = Get-Metadata('crd-pin')
    $crdName = Get-Metadata('crd-name')
    if ($crdPin -isNot [Int32] -or $crdPin -gt 999999 -or $crdPin -lt 0) {
    throw "Metadata ""crd-pin""=""$crdPin"" is not a 6 digit number. Skipping Chrome Remote Desktop service installation."
    }
    # Prefix $crdPin with zeros if required.
    $crdPin = $crdPin.ToString("000000");
    # The command from distant desktop authentication doesn't have the right path to the applying,
    # and is lacking the --pin and --name arguments that are required for unattended set up.
    #
    $crdCommandArgs = $crdCommand.Cut up(' ')
    $codeArg = $crdCommandArgs | Choose-String -Sample '--code="[^"]+"'
    $redirectArg = $crdCommandArgs | Choose-String -Sample '--redirect-url="[^"]+"'
    if (-not $codeArg) {
    throw 'Can't get --code= parameter from crd-command. Skipping Chrome Distant Desktop service set up.'
    }
    if (-not $redirectArg) {
    throw 'Can't get --redirect-url= parameter from crd-command. Skipping Chrome Distant Desktop service set up.'
    }
    [Net.ServicePointManager]::SecurityProtocol = 'tls13, tls12, tls11, tls'
    Write-Host 'Downloading Chrome Distant Desktop.'
    $installer = "$env:TEMPchromeremotedesktophost.msi"
    Invoke-WebRequest 'https://dl.google.com/edgedl/chrome-remote-desktop/chromeremotedesktophost.msi' `
    -OutFile $installer
    Write-Host 'Putting in Chrome Distant Desktop.'
    & msiexec.exe /I $installer /qn /quiet | Out-Default
    Take away-Merchandise $installer
    $installer = "$env:TEMPchrome_installer.exe"
    Write-Host 'Downloading Chrome.'
    Invoke-WebRequest  'https://dl.google.com/chrome/set up/newest/chrome_installer.exe' `
    -OutFile $installer
    Write-Host 'Putting in Chrome.'
    & $installer /silent /set up | Out-Default
    Take away-Merchandise $installer
    Write-Host 'Beginning Chrome Distant Desktop service.'
    & "${env:ProgramFiles(x86)}GoogleChrome Remote DesktopCurrentVersionremoting_start_host.exe" `
    $codeArg $redirectArg --name="$crdName" -pin="$crdPin" | Out-Default
    EOF
    

    This code block is a PowerShell specialize script that shall be
    run when the VM is created. It performs the next actions:

    • Obtain and set up the Chrome Distant Desktop host service.
    • Obtain and set up the Chrome browser.
    • Retrieve the next metadata parameters:
      • crd-command – the Home windows authentication and startup command.
      • crd-pin – the 6-digit PIN used for added authentication.
      • crd-name – the identify for this occasion.
    • Configure and begin the Chrome Distant Desktop host service.

Create a brand new Home windows digital machine

You now create a brand new Home windows VM utilizing the information you created earlier
to configure and arrange Chrome Distant Desktop.

  1. In Cloud Shell, set your most popular zone:

    ZONE=us-east1-b
    REGION=us-east1
    gcloud config set compute/zone "${ZONE}"
    
  2. Set a 6-digit PIN for added authentication to Chrome Distant Desktop:

    CRD_PIN=your-pin 

    Change your-pin with a 6-digit quantity.

  3. Set a reputation for this VM occasion:

    INSTANCE_NAME=crdhost 
  4. Create the occasion:

    gcloud compute cases create ${INSTANCE_NAME} --machine-type=n1-standard-2 --scopes=cloud-platform --enable-display-device --image-family=windows-2019 --image-project=windows-cloud --boot-disk-size=50GB --boot-disk-device-name=${INSTANCE_NAME} --metadata=crd-pin=${CRD_PIN},crd-name=${INSTANCE_NAME} --metadata-from-file=crd-command=crd-auth-command.txt,sysprep-specialize-script-ps1=crd-sysprep-script.ps1 

    This command creates a Home windows Server 2019 digital machine within the default
    VPC that has an hooked up screen gadget (required for Chrome Distant Desktop
    on Home windows VMs) and a 50GB boot disk, and grants the occasion full entry
    to Google Cloud APIs.

    The metadata values specify the specialize script, Home windows startup command
    line, and the parameters required to begin the Chrome Distant Desktop
    service.

Monitoring the VM startup

You may confirm that the startup script is profitable by checking the messages
logged to the VM’s serial port whereas it’s being created.

  1. In Cloud Shell, screen the messages logged throughout VM startup:

    gcloud compute cases tail-serial-port-output ${INSTANCE_NAME} 

    If the Chrome Distant Desktop configuration is profitable, you see the
    following log traces:

     Discovered sysprep-specialize-script-ps1 in metadata. sysprep-specialize-script-ps1: Downloading Chrome Distant Desktop. sysprep-specialize-script-ps1: Putting in Chrome Distant Desktop. sysprep-specialize-script-ps1: Downloading Chrome. sysprep-specialize-script-ps1: Putting in Chrome. sysprep-specialize-script-ps1: Beginning Chrome Distant Desktop service. sysprep-specialize-script-ps1 exit standing 0 Completed operating specialize scripts. 

    If the Chrome Distant Desktop configuration fails, you see an error message
    indicating the issue, for instance:

     sysprep-specialize-script-ps1: Could not begin host: OAuth error. 

    This error signifies that the OAuth token from the Chrome Distant Desktop
    authentication web page is not legitimate, both as a result of it has already been
    used, or as a result of it has expired.

    To appropriate this error, both join by way of RDP and
    carry out an interactive setup as described beforehand, or delete the VM and
    retry the setup course of.

    While you see the next message within the serial port monitor, the VM is
    prepared.

     GCEInstanceSetup: ------------------------------------------------------------ GCEInstanceSetup: Occasion setup completed. crdhost is able to use. GCEInstanceSetup: ------------------------------------------------------------ 
  2. Press Management-C to cease displaying the startup messages.

Create a Home windows person account

  1. Within the Cloud Console, go to the VM cases web page.

    Go to the VM cases web page

  2. Click on the occasion identify crdhost to open the VM occasion
    particulars
    web page.

  3. Underneath Distant entry, click on Set Home windows password, after which click on
    Set to create your account on the distant machine.

    This step generates a password for you. Make an observation of the username and
    password or copy it to a safe non permanent file.

Connecting to the VM occasion with Chrome Distant Desktop

You may connect with the VM occasion utilizing the Chrome Distant Desktop net
software.

  1. In your native pc, go to the
    Chrome Distant Desktop
    web page.

  2. If you happen to’re not already signed in to Google, sign up with the identical Google
    Account that you just used to arrange the Chrome Distant Desktop service.

    You see your new crdhost VM occasion within the Distant Units checklist.

    List of remote devices available to connect to.

  3. Click on the identify of the occasion.

  4. While you’re prompted, enter the PIN that you just created earlier, after which
    click on the arrow

    button to attach.

    You are actually linked to the Home windows login display screen in your distant
    Compute Engine occasion.

  5. Press any key, and enter the password for the Home windows person that
    you generated earlier. Notice that the default distant keyboard has a
    US-English structure, so the characters entered might not match the characters
    in your native keyboard. You additionally can’t copy and paste the password.

You are actually linked and logged in to the distant Home windows desktop.

Bettering the distant desktop expertise

This part offers directions for altering settings so as
to enhance the distant desktop expertise.

Allow Clipboard Synchronization

Clipboard Synchronization permits the contents of the clipboard to be
shared between the native and distant machines. If this characteristic isn’t already enabled, do the next:

  1. Open the Session Choices panel utilizing the button

    on the facet of the window.
  2. Within the Allow Clipboard Synchronization part, click on Start.
  3. Click on Enable.

Set up the Distant Desktop Chrome app

The Distant Desktop Chrome app offers a separate windowed expertise and permits
extra keyboard shortcuts for use on the distant system. If this app isn’t
put in, do the next:

  1. Open the Session Choices panel utilizing the button

    on the facet of the window.
  2. Within the Set up App part, click on Start.
  3. Click on Set up.

    The distant desktop session reopens in a separate window.

You may transfer any distant desktop classes from a Chrome tab to
the app window by clicking the Open With

icon within the URL bar.

Enhance the display screen decision

The default distant desktop decision can modified to raised fit your native
computer systems desktop decision.

  1. Proper-click the distant desktop’s background and choose Show Settings.
  2. Within the Decision drop-down checklist, choose a special display screen decision.
  3. Affirm the brand new display screen decision within the dialog.

Re-enable the service

In case you have mistakenly disabled connections to the distant occasion within the
shopper app, you may reconfigure the service and re-enable it by following the
directions in
Establishing the Chrome Distant Desktop Service.

Leave a Reply

Your email address will not be published. Required fields are marked *