All Products
Search
Document Center

Elastic Compute Service:Connect to a Windows instance by using a username and password

Last Updated:Jul 21, 2023

This topic describes how to connect to a Windows instance from an on-premises client.

Prerequisites

  • The instance is in the Running state. If the instance is not in the Running state, start the instance. For more information, see Start an instance.

  • A logon password is set for the instance. If you have not set a password or if you have forgotten the password, you must reset the password for the instance. For more information, see Reset the logon password of an instance.

  • The instance has Internet connectivity.

    • To provide Internet connectivity to an instance that resides in a virtual private cloud (VPC), you can assign a public IP address and purchase public bandwidth during the creation of the instance, or associate an elastic IP address (EIP) with the instance after the instance is created. For more information, see Create an IPv4 VPC.

    • To provide Internet connectivity to an instance that resides in the classic network, you can assign a public IP address and purchase public bandwidth during the creation of the instance, or modify the public bandwidth configurations after the instance is created. For more information, see Modify the bandwidth configurations of subscription instances or Modify the bandwidth configurations of pay-as-you-go instances.

  • The following rules are added to the security group to which the instance belongs. For more information, see Add a security group rule.

    Network type

    Rule direction

    Action

    Port range

    Priority

    Authorization object

    VPC

    Inbound

    Allow

    • To open the default port 3389 on the Windows instance, select RDP (3389).

    • To open other ports on the Windows instance, enter a port range.

    1

    The public IP address of your on-premises client, not the public IP address of the instance.

    Important

    You can also specify 0.0.0.0/0 as the authorization object to allow inbound access from all IP addresses. However, this imposes security risks. Proceed with caution.

    Classic network

    Internet ingress

Connect to a Windows instance

Use an appropriate method based on your on-premises device environment to connect to a Windows instance.

Connect from an on-premises client that runs a Windows operating system

If your on-premises client runs a Windows operating system, you can use Windows built-in Microsoft Terminal Services Client (MSTSC) to connect to a Windows instance from the client.

  1. Use one of the following methods to start Remote Desktop Connection (MSTSC):

    • Choose Start > Windows Accessories > Remote Desktop Connection.

    • Click the Start icon, enter mstsc in the search box, and then press the Enter key.

    • Press Win (Windows logo key)+R to open the Run dialog box, enter mstsc, and then press the Enter key.

  2. In the Remote Desktop Connection dialog box, perform the following steps:

    1. Click Show Options.

    2. In the Computer filed, enter the public IP address or EIP of the instance.

    3. In the User name filed, enter a username. The default username is Administrator.

      If you do not want to manually enter your username and password again the next time you connect to the instance, you can select Allow me to save credentials.

    4. (Optional) If you want to copy files from your on-premises client to the instance, click the Local Resources tab to view the options for sharing on-premises computer resources.

      • If you want to copy only text, select Clipboard.

      • If you want to copy files, click More..., select Drives, and then select the letters of the drives from which you want to copy files.

    5. (Optional) If you have specific requirements on the size of the remote desktop window, click the Display tab to resize the remote desktop window. We recommend that you use Full Screen.

    6. Click Connect.

    7. In the Remote Desktop Connection dialog box that displays the "Do you trust this remote connection?" message, click Connect.

Connect from an on-premises client that runs a Linux operating system

If your on-premises client runs a Linux operating system, you can use a remote connection tool to connect to a Windows instance from the client. In this example, rdesktop and an instance that runs a CentOS 7.9 operating system are used.

Important

The on-premises client must be installed with a GUI. For information about how to install a GUI on your Linux client, see Installing a graphical desktop environment for a Linux instance.

  1. Run the following commands to download and install rdesktop:

    yum -y install epel-release
    wget http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
    rpm -Uvh nux-dextop-release*rpm
    yum install rdesktop -y
  2. Run the following command to connect to the Windows instance.

    Important

    The command must be run in a GUI.

    This sample command is for your reference. Configure the parameters in the command based on your needs.

    rdesktop -u administrator -p password -f -g 1024*720 192.168.1.1 -r clipboard:PRIMARYCLIPBOARD -r disk:sunray=/home/yz16184

    The following table describes the parameters.

    Parameter

    Description

    -u

    The username to use to log on to the Windows instance. The default username is Administrator.

    -p

    The password to use to log on to the Windows instance.

    -f

    The full-screen mode. You can press Ctrl+Alt+Enter to switch the mode.

    -g

    The screen resolution. An asterisk (*) is used between the pixel width and height. This parameter can be left empty. If this parameter is not specified, the full-screen mode is used.

    192.168.1.1

    The IP address of the instance that you want to connect to. Set this parameter to the public IP address or EIP of your Windows instance.

    -d

    The domain name. For example, if the domain name is INC, set this parameter to -d inc.

    -r

    Multimedia redirection. Examples:

    • -r sound: turns on sound.

    • -r sound : local: uses a local sound card.

    • -r disk:usb=/mnt/usbdevice: enables the USB flash drive.

    -r clipboard:PRIMARYCLIPBOARD

    Allows text, including Chinese characters, to be copied between the on-premises client that runs a Linux operating system and the Windows instance.

    -r disk:sunray=/home/yz16184

    Maps a directory in the Linux operating system of the on-premises client to a disk on the Windows instance. This way, Samba and FTP are not required for transferring files.

Connect from an on-premises client that runs a macOS operating system

For information about how to connect to a Windows instance from an on-premises client that runs a macOS operating system, see Get started with the macOS client.