Deploy a Windows Instance in Oracle Cloud Infrastructure

From Iwan
Jump to: navigation, search

In this tutorial, we will deploy a Windows Instance (hop on machine, OCI Bastion host) in Oracle Cloud Infrastructure (OCI) which can be used as the first point of entry into your OCI environment and can be used to connect to other private instances inside your OCI environment or for testing purposes.

Profile.jpg

The following image illustrates how the environment will look like when we finish with the deployment and configuration.

C16bd81ecc28fcf804a3a6bc9d0d9668.png

Objective

- Deploy a Windows instance in OCI. We will make the necessary infrastructure changes on the VCN like allowing the RDP port on the security list and adding a default route towards the internet gateway.

Prerequisites

- VCN, a public subnet, and internet gateway. - See this tutorial-CHANGE LINK to create the VCNs, public subnet and internet gateway.

Task 1 - Create a Windows Instance

- Create an OCI Compute instances.

1. Click the Oracle Cloud logo to return to the OCI Console homepage.
2. Click Instances or click hamburger menu and then navigate to Compute, Instances.

C5e1fca8397689322d9e570038e51f51.png

- Click Create Instance.

0d4c7183987083729c6923f599de36f0.png

1. Enter the name of instance.
2. Scroll down.

04f910a33ff10556647c9337f066db95.png

- Click Change Image to change from the default Oracle Linux 8 Image to a Windows Image.

B9de89cbdd403ca69f743af0f0bdb9ca.png

1. In the Select an Image page, select Windows.
2. Scroll down.

B6c8c289f481c79f823e3cfc5181db14.png

1. Select Windows Server 2022 Standard.
2. Select I have reviewed and accept the following documents.
3. Click Select Image.

73ce6de3f1468447b148ecfdfe052da2.png

1. Notice that the Windows Server 2022 Standard Image is selected.
2. Scroll down.

087f0b14faaf97230fca2cc0f8487f11.png

1. Select the VCN that you want to attach to the instance.
2. Select a Subnet.
3. Scroll down.

51edd34975005a07e8f818a28f2a5850.png

- Scroll down.

55e2d078e30512d205af52ba24d9e00d.png

Ce7161b97f7a5115adc91000eec869a7.png

- Click Create to create the instance.

8991a6e7632f0c90d0b7a34cd8f35fc2.png

- Notice that the status of the instance is PROVISIONING.

68c95980d05d3fe94021b6f2d9fe4ec2.png

1. After a few minutes, the status is changed to RUNNING.
2. Note your Public IP address and your login credentials. You will need this in the later task when you try to log in to the instance.

Af3c682920ec25ae6ba68fad2272b4d6.png

- The following image illustrates the visual representation of what we have created.

D776a4edd6be0208141e04b99f746ee4.png

Task 2 - Allow TCP 3389 Port on the Security List

We need to allow the TCP/`3389` Microsoft Remote Desktop Protocol (RDP) port on the security list that is currently attached to the VCN that includes your new Windows instance.

- Add ingress rules.

1. Click the hamburger menu (≡) in the OCI Console.
2. Click Virtual cloud networks.

Bfbf9ebc41a70f2ae52213091e40cb3d.png

- Click the VCN that includes your instance. In this tutorial, it is `HUB-VCN`.

D6315b3654dd2b6dbe4e136691ccac21.png

1. Scroll down.
2. Click Security Lists.
3. Click the Default Security List for HUB-VCN for the VCN.

9544779687129ea524ed4d85320c4b81.png

- Click Add Ingress Rules.

A4c088f501942467d43f57a1f19fbddf.png

- Enter the following information.

1. Source: Enter CIDR.
2. Source CIDR: Enter `0.0.0.0/0`.
3. IP Protocol: Enter TCP.
4. Destination Port Range: Enter `3389`.
5. Click Add Ingress Rules.

2367f6da34776579a88e9c9cb047b98e.png

- Notice that the security rule is added to allow the TCP/`3389` port on the security list that is attached to VCN. This will allow you to set up an RDP connection from the internet towards this new Windows instance.

8c814ee3cd15a1e7c48e23e46a795ccd.png

- The following image illustrates the visual representation of what we have created.

6e3c61832b4c8306192400ffb6184871.png

Task 3 - Add a Default Route towards the Internet Gateway

A public subnet and the VCN is not routing traffic to the internet. So you need to make sure that a route is present to route all traffic from the public subnet to the internet gateway.

- Go to Networking and Virtual Cloud networks.

- Click the VCN that includes your instance. In this tutorial, it is `HUB-VCN`.

B05f5d56073d6b25512b47fe0899f193.png

1. Click Route Tables.
2. Click the Default Route Table for the VCN.

1047d280cc507c36b84631b2b3306777.png

- Click Add Route Rules.

5a9f604f0c320bf628196b9cdd2be52a.png

- Enter the following information.

1. Target Type: Enter Internet Gateway.
2. Destination CIDR Block: Enter `0.0.0.0/0`.
3. Target Internet Gateway: For this tutorial, it is `hub-internet-gw`.
4. Click Add Route Rules.

35706250d8845b1627c1d6be811c4908.png

- Notice that the default route towards the internet gateway is added.

Af3113f2d925a756ecd273322527ed2f.png

Note

The route tables you configured at the VCN level are attached to a subnet. By default the VCN has the default route table and that the Default Route Table is associated with all the subnets. As this is also the case for your public subnet, instances attached to the public subnet will know how to route traffic towards the internet.

note

- The following image illustrates visual representation of what we have created. Notice that the colors of the routing table match the association of the subnets (The orange blocks with "RT").

3c76ff2c4145395db42a96d0bffa983e.png

Task 4 - Connect to the Windows Instance using Microsoft Remote Desktop Protocol -RDP-

We have done instance creation, allowed TCP/`3389` port to the security list, and configured routing towards the internet. Now, we can connect to the Windows instance from the internet.

In this tutorial, we are using an application called Royal TSX for the connection but you can use any RDP client.

- In the Remote Desktop Connection Settings page, enter the following information.

1. Enter Display Name.
2. In Computer Name, enter the IP address of the Windows instance created in Task 1.
3. In Port, specify the RDP port.
4. Click Credentials.

8720e223c7ecd83c003fd44a1084db49.png

1. Select Specify username and passwords.
2. Enter Username created in the Task 1.
3. Enter Password create in the Task 1.
4. Click Apply & Close to save the session.

186d941fa8f22db9688702eb515bbf90.png

- Double-click on the saved session to connect to the Windows instance. When you can successfully connect you will get a prompt to change your initial password.

- Click OK.

290fe77897c9f1efd176442c356aeaca.png

1. Enter old password.
2. Enter new password.
3. Enter new password again.
4. Click right arrow (→).

8db6e19e3d3d04b3ea31c88502865529.png

- When you changed your password successfully, click OK.

2e22a3f19098abc29155cb86c37d3615.png

- Click Yes.

7870e00b5d97f6d7441e8f9e1a713b23.png

- Now, you can use your new Windows instance as your first point of entry into your OCI environment and use it to connect to other private instances inside your OCI environment, or for testing purposes.

D07b3061be028642729421453e19b618.png

- The following image illustrates the visual representation of what we have created so far.

0bfc3be8e78d51ca1b0eddaebe465445.png

Conclusion

In this tutorial, you have deployed a Windows step stone Instance (hop on machine, bastion host) into OCI. You have also made the necessary Infrastructure changes on the VCN like allowing the RDP port on the Security List and adding a default route towards the Internet Gateway.