> ## Documentation Index
> Fetch the complete documentation index at: https://cloud-architect.ipoint-labs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create EC2 Instance and Connect to a windows machine using RDC

> Hands-on lab · 45m

Launch this lab in the IP Lab Portal, then follow the steps below in the AWS console.

<a className="ip-lab-portal-btn" href="https://labs.intellectualpoint.com/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc" target="_blank" rel="noreferrer">
  Open IP Lab Portal
</a>

## Overview

### Lab details

1. This lab walks you through the steps to launch and configure a virtual machine in the Amazon cloud.
2. You will practice using Amazon Machine Images to launch Windows EC2 Instance and connect it using Remote Desktop Connection(RDC)
3. Duration: **45 minutes**
4. AWS Region: **US East (N. Virginia) us-east-1**

### Introduction

#### What is EC2?

* EC2 stands for Elastic Compute Cloud, which is a service provided by Amazon Web Services (AWS).
* It is a virtual environment where you can create and manage virtual machines (referred to as instances) in the cloud.
* EC2 instances can be launched from preconfigured templates called images, which are provided by AWS in the form of Amazon Machine Images (AMIs).
* You can also install custom applications and services on EC2 instances.
* EC2 allows you to scale your infrastructure up or down easily based on demand.
* You can choose from multiple configurations of CPU, memory, storage, and other resources.
* There is no limitation on storage, and you can pick the storage type based on the instance type you are working on.
* EC2 provides temporary storage volumes called Instance Store Volumes, which are deleted when the instance is terminated. Persistent storage volumes are also available as Elastic Block Store (EBS) volumes.

### Architecture diagram

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/001.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=654dd2e4e83d69e5c0eda3dd0431df1d" alt="" width="1800" height="923" data-path="images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/001.png" />

### Task details

1. Sign in to AWS Management Console
2. Create an Amazon Windows Instance from Microsoft Windows Server.
3. Connect your EC2 Instance using Remote Desktop Connection.
4. Installing IIS server using Command Line.
5. Testing the default Web Page.
6. Creating a Custom Web Page.
7. Validation of the lab.

### Prerequisites

In order to proceed with the lab, you should have a Remote Desktop application on your computer.

#### For Windows users

1. Click on the **Start** button, and search for **RDC**. You will find the Remote Desktop Connection application.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/002.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=092f745a92115d1749d2f766a78fea42" alt="" width="221" height="42" data-path="images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/002.png" />

#### For Mac users

1. On Mac, we have to download the Remote Desktop application.
2. Go to the App Store, and search for **Windows App** and download the following application.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/003.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=626b99a981729de6a443bf4d20ddb7eb" alt="" width="702" height="178" data-path="images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/003.png" />

#### For Linux users

1. On Linux, **Remmina** is usually included in the distribution.
2. If not, go to [https://remmina.org/how-to-install-remmina/](https://remmina.org/how-to-install-remmina/) and follow the instructions to install for any Linux distribution.

### Launching the lab environment

1. To launch the lab environment, click on the **Launch lab** button.
2. Please wait until the cloud environment is provisioned. It will take less than a minute to provision.
3. Once the Lab is started, you will be provided with **IAM username**, **Password**, **Access** **Key**, and **Secret** **Access** **Key**.

<Note>
  You can only start one lab at any given time
</Note>

## Lab guide

### Lab steps

#### Task 1: Sign in to AWS Management Console

1. Click on the **Open console** button, and you will get redirected to AWS Console in a new browser tab.
2. On the AWS sign-in page,

   * Leave the Account ID as default. Never edit/remove the 12-digit Account ID present in the AWS Console. Otherwise, you cannot proceed with the lab.
   * Now copy your **Username** and **Password** in the Lab Console to the **IAM Username and Password** in AWS Console and click on the **Sign-in** button.
3. Once Signed In to the AWS Management Console, make the default AWS Region as **US East (N. Virginia) us-east-1.**

<Note>
  If you face any issues, please go through [**FAQs and Troubleshooting**](/aws-cp/support/faqs-and-troubleshooting).
</Note>

#### Task 2: Launching an EC2 Instance

In this task, we are going to launch an Amazon Elastic Compute Cloud (EC2) instance from a preconfigured Amazon Machine Image (AMI) and connecting to it using Remote Desktop Connection (RDC).

1. Make sure you are in the **US East (N. Virginia) us-east-1** Region.
2. Navigate to **EC2** by clicking on the **Services** menu in the top, then click on **EC2** in the **Compute** section.
3. Click on **Instances** from the left sidebar and then click on **Launch instances**

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/004.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=7c15af474708dfc2c4f6598b84e00f11" alt="" width="1615" height="316" data-path="images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/004.png" />

4. Name : Enter ***MyEC2Server***
5. Select "**Windows**" under the "**Quick Start**" section.
6. Click on the search option and search "**Microsoft Windows Server 2022 Base**" image for the instance.
7. **For Instance Type:** select ***t2.micro.***

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/005.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=1492069e598e213e72773d3f4e21769b" alt="" width="1908" height="1334" data-path="images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/005.png" />

8. **For Key pair:** Select **Create a new key pair** Button

   * Key pair name: **MyEC2Key**
   * Private key file format: **.pem**

9. Select **Create key pair** Button.

10. In Network Settings, Click on **Edit**:

    * Auto-assign public IP: **Enable**
    * Select **Create security group**
    * Security group name : Enter **whizlabs\_SG**

      * To add **RDP:**

        * Choose Type: **RDP**
        * Source: **Anywhere**

11. Click on the "**Launch Instance**" button to launch the EC2 instance. Wait for the instance to be launched and initialized, which can take a few minutes.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/006.jpg?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=e5308fa1e4952c41da9a47240d6b980c" alt="" width="1013" height="108" data-path="images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/006.jpg" />

12. Once the instance is running, select it from the instances list and note the IPv4 Public IP Address of the EC2 instance.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/007.jpg?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=5e0627abdc7df5a5b0bf5c13e00f520f" alt="" width="956" height="230" data-path="images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/007.jpg" />

#### Task 3: Connecting EC2 Instance with Remote Desktop Connection

In this task, we are going to remotely access the Windows Server running on the EC2 Instance using RDP. This allows you to manage the server and its resources from a remote location, which can be useful in many scenarios.

1. Select your **EC2** Instance, click on **Connect**, and then click on **RDP Client** in the next screen. This will download a remote desktop file on your local machine.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/008.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=5fbeff7d673df3bfbb95ebc89103fcdc" alt="" width="868" height="153" data-path="images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/008.png" />

2. Click on **Download remote desktop file**. This will help you download the RDP file that will enable you to connect to the Windows Server.

   <img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/009.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=f995d8db359488597da1fd9f12355e3c" alt="" width="892" height="748" data-path="images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/009.png" />
3. Click on **Get password** to retrieve the password required to log in to the Windows Server. The password is encrypted with the **Key Pair** associated with the EC2 Instance.
4. The Key Pair associated with your Instance will be shown.

   <img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/010.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=dc68b0b3941352b0ffb709f986ee0194" alt="" width="916" height="683" data-path="images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/010.png" />
5. **Decrypt** the password by uploading the **Key Pair** that you downloaded in Task 2. This will display the username and password required to access the Windows Server.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/011.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=b4f694860836ba56fccfa996e87abd94" alt="" width="903" height="731" data-path="images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/011.png" />

6. **Username** and **Password** will be shown on the Dialog Box. Make sure you record these somewhere for later use.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/012.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=e518080a4e17b3e230807ad9bda42ac8" alt="" width="910" height="196" data-path="images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/012.png" />

7. Make sure you already have a Remote Desktop application on your computer.
8. Go to your download file and click to open.

   <img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/013.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=c9f52faae02695b67c1c0be9abf1f7fb" alt="" width="114" height="161" data-path="images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/013.png" />
9. Paste the copied password here. This will start the instance and connect you to the Windows Server.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/014.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=8f17188c379a3bfd071e6b9974cda6bd" alt="" width="573" height="415" data-path="images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/014.png" />

10. You may get a warning regarding the security certificate while connecting to the instance. Choose **Yes** or **Continue** to continue if you trust the certificate.

    <img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/015.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=84e8aa9c0ccb9fc04e0d97f8112603c2" alt="" width="393" height="402" data-path="images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/015.png" />
11. Once you are connected, you can find the Public IP, Private IP, RAM, etc. in the top-right corner of the window. This information can be useful to manage the EC2 Instance.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/016.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=bc1940bb1eefa972b483e725607e9cbe" alt="" width="1884" height="692" data-path="images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/016.png" />

> Note : For mac users follow below steps.

* Double-click on the downloaded rdp file

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/017.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=aef13a12609e1cccd96e9cb13aaabe2c" alt="" width="238" height="222" data-path="images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/017.png" />

* It will prompt a pop-up to add credentials, give your decripted password.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/018.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=5e4cf004f87584550e55b8cd320cfa12" alt="" width="868" height="464" data-path="images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/018.png" />

* Click on the Continue button and again click on Continue. It will redirect to Windows Server.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/019.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=6f3acf78c9d8004cfb2e48e32858658e" alt="" width="1940" height="1258" data-path="images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/019.png" />

#### Task 4: Installing IIS server using Command Line

In this step, we are going is to install the Internet Information Services (IIS) server on the Windows Server. IIS is a web server software that enables hosting of websites and web applications on the Windows operating system. By installing IIS, we can create and launch web pages using the Windows Server.

1. Click on the Windows Start button in the bottom left corner and type **cmd**.
2. Right-click on the command prompt and select **run as administrator**.

   <img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/020.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=ca0f5c5cac8add0d39456b2853700e1c" alt="" width="782" height="637" data-path="images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/020.png" />
3. Type the command and hit Enter.

   ```
   DISM /online /enable-feature /featureName:IIS-DefaultDocument /All
   ```
4. Once the progress is 100%, you will see a message, “**The operation completed successfully**.”

   <img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/021.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=8c38f019eff86cc1824c7e71db540b85" alt="" width="893" height="330" data-path="images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/021.png" />
5. Close the command prompt and click on the Start button again and type **IIS**, now you will be seeing the **Internet Information Services Manager** installed successfully.

   <img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/022.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=e56a4bda7f3fab013747ed6a53c3375e" alt="" width="774" height="636" data-path="images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/022.png" />

#### Task 5: Testing the default Web Page

In this step, we will try to verify that the IIS server is up and running, and it is serving web pages correctly. By browsing the default web page, we can confirm that the IIS server is ready to host our own web pages and applications.

1. Click on the **Internet Information services Manager**.
2. Under the **Connections** page, double-click on the **first name** you see under Start Page to **expand** it. Then, double-click on Sites to see the list of available websites.

   <img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/023.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=0895e206b4727b0be62d7642d9f30b90" alt="" width="1362" height="456" data-path="images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/023.png" />
3. Click on **Default Web Site** and on the right side of the panel, under the **Browse Website** section, click on the **Browse \*:80 (http)** link
4. You will be redirected to a default web page, and you can see the web address of the default web page (localhost) in the address bar of your browser.
5. This ensures that the IIS server is working properly, and you can access the default web page.

   <img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/024.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=f59601aa5aa5e8c6ef2651f56acac112" alt="" width="1231" height="628" data-path="images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/024.png" />

#### Task 6: Creating a Custom Web Page

In this task, we are going to demonstrate how to create a custom web page and host it on the IIS server. By creating a custom web page, we can display any content we want on our website. This task helps in understanding the process of creating an HTML file, saving it to the appropriate directory, and accessing it through the webserver.

1. Type **notepad** in the search bar near the Start button and right click on it and select **run as administrator**.
2. Copy and paste the provided HTML code into Notepad to create a custom web page.

   \<html>

   \<body>

   \<h1>Hello Whizlabs User!\</h1>

   \<h2>You have successfully created a custom web page.\</h2>

   \</body>

   \</html>
3. Save the file as "**index.html**" with the file type set to "**All Files**".
4. Now for the destination, navigate to the "**inetpub**" folder on the **C drive** and open the "**wwwroot**" folder.
5. Save the "**index.html**" file in the "**wwwroot**" folder.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/025.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=515e779c826f5740cfde8867eed8078e" alt="" width="958" height="659" data-path="images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/025.png" />

6. Open a web browser and navigate to the default web page of the IIS web server.
7. Refresh the page to see the custom web page displayed instead.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/026.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=76fc9129b0eb8e109d5b2bba4c9fa648" alt="" width="694" height="284" data-path="images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/026.png" />

> #### Do you Know?
>
> Amazon provides a free RDP client called "**Amazon WorkSpaces**" that can be used to connect to Windows-based EC2 instances. This client provides a secure and reliable way to access your EC2 instances remotely from anywhere, using any device with an internet connection.

#### Task 7: Validation Test

1. Once the lab steps are completed, please click on the **Check my work** button on the right side panel.
2. This will validate the resources in the AWS account and shows you whether you have completed this lab successfully or not.
3. Sample output :

   <img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/027.gif?s=875967981d6a27a19ec761f91f58f13e" alt="" width="976" height="522" data-path="images/labs/create-ec2-instance-and-connect-to-a-windows-machine-using-rdc/027.gif" />

### Completion and conclusion

1. You have successfully created and launched a Windows EC2 Instance.
2. You have successfully connected to the Windows Server Using Remote Desktop Connection.

### End lab

1. Sign out of the AWS Account.
2. You have successfully completed the lab.
3. Once you have completed the steps, click on **End lab** in the IP Lab Portal.

## What gets checked

When you press **Check my work**, the platform verifies each of these:

* **Launch an EC2 Instance** — Check whether an EC2 Instance is launched or not.
* **Launch EC2 AMI type windows** — Check whether the EC2 instance is launched using an Windows AMI.

## Related help

* [FAQs and Troubleshooting](/aws-cp/support/faqs-and-troubleshooting)
