HOW TO CREATE A VIRTUAL MACHINE, CONNECT TO IT USING REMOTE DESKTOP AND INSTALL A WEB BROWSER- (MAC USERS)
Tags: azure, beginners, cloud, cloudskills
Published: 2022-10-28 02:00:57

One of the common ways to connect to an Azure VM is through the Remote Desktop Protocol. This article will take you through the steps in creating a remote desktop connection to your VM already created and running in Azure. 

STEP ONE: 
Open your web browser, navigate to portal.azure.com and sign in using your Azure credentials 

![Azure page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/53zmufbn4623ol756oh9.jpg)
 
STEP TWO: 
Click on Virtual machines in the home page and then click create to see options for creating VMs in Azure. Click on the first option (Azure Virtual machine) and this will take you to create a virtual machine. 

![Creating a VM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0qt22rp68lrmb1rpxmx0.jpg)

STEP THREE: 
Under the Basics tab, fill in the appropriate information in your project details by first, selecting the correct subscription. For the resource group, you have the option of choosing existing resource groups earlier created using the drop-down option. If none, then click on the Create New option to create a new resource group. For this tutorial, we will use **psr_group. **

![Providing Project details](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1fjm79139wt2gn5wdh9y.jpg)


Set up the instance details with the following information: 
•	Virtual machine: **windowsvm**
•	Region: From the drop-down icon, you have the option of selecting the region closest to you. This helps minimize network latency when connecting to your VM. For this tutorial, we will select **(Europe) UK South**. 
•	Image: Select Windows Server 2019 Datacenter- Gen 2
•	Size: Standard_DS1_V2 -1 vcpus, 3.5 GiB Memory 

 
![Setting up instance details](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a4qnwak9xeedt7eveyfw.jpg)

Next, input a username and password of choice for the administrator account. This tutorial will use **azureuser** as username. For the inbound rules, select allow selected ports and from the drop-down menu in select inbound ports, click HTTP and RDP before proceeding to click on Review + create. 

![Seeing up administrator account and port rules](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mp8fky28tvyxwf7yoy33.jpg)

Upon selecting the Review +create button, it will run a final validation check for some minutes and if all details were inputted correctly, it will show a “validation passed” message on the top of the screen. When seen, click on create to finalize the creation and deployment of the VM. Once deployment is complete, you should see the VM page appear as the one below. 

![Validation and deployment of VM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3kpt34kn18irq4frt7wf.jpg)

STEP FOUR: 
Click on Go to resource and this will take you to the overview page of the VM created. The overview page gives you a breakdown of information about your VM such as the resource group, Public IP address, size, status of your VM etc. Note that even though you may have successfully deployed your VM and the status shows running, you cannot make use of it until you connect to it. 

![Accessing VM's information](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yvdsl6x4f7up4r19ztqo.jpg)
 
STEP FIVE: 
While on the overview page, click on the connect option. It will give you a list of how you can connect to your VM. Select RDP and click on download RDP file. 


![Downloading RDP file](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j6gbdun28ojtbblswrum.jpg)
 
STEP SIX:
Once the RDP file is downloaded, double-click on the file to initiate connection to your VM. A pop-up screen demanding for username and password will appear. Enter the username: azureuser and the password you created for your administrator account. 

![Providing password and username](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/001gvq27sfi0px1kkr1o.jpg)
 
Next, click continue when this next pop-up window appears. 

![Connecting to VM via RDP](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i87gln3h2h4rss31gtnq.jpg)
 
If successful, you will get to your VM’s desktop like the picture shown below. At this point, you can use the VM for any task just like your physical computer. 

![VM's Desktop](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oq9pbpwypojqdo0temil.jpg) 

STEP SEVEN: 
Once logged into your VM’s desktop, click on the search icon and type PowerShell.

![Accessing PowerShell](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6exqy95axqzi836aqtn1.jpg)

Next, right-click on Windows PowerShell ISE and select the Run as administrator option from the menu presented.  

![Run as administrator](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0n9nrcxeq4gahqzxx886.jpg)
 
STEP EIGHT: 
The picture below should appear on your screen next. 

![Loading PowerShell](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/njlmavgo9t1xn80h682p.jpg)
 
Once seen, paste the following command in the box to install the webserver feature: **Install-WindowsFeature Web-Server **

![webserver installation](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ydlsu8gum37t00hrrqld.jpg)
 
STEP NINE: 
Upon completion of the instalment, your screen will display the following information attached below. 

![Successful installation](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ct2lryvkj8fmjtz56uvg.jpg)

Return to the overview page of your VM in your azure portal and copy your Public IP address. Run the copied address on a new browser page. If successful, your browser page should appear like the picture.

![Access web browser](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/emx6rnwl58gqqfsx4lkd.jpg)
 
STEP TEN: 
After successfully connecting to your VM and installing a web browser, it is always advisable to clean up your resources to avoid being charged. To clean up, you will need to delete the VM or the resource group that houses all the resources used. To initiate a clean-up, navigate to your virtual machine page, tick the box on the lefthand-side next to your VM, and click on the Delete icon (top-right corner) to initialise deleting your VM. 

![Cleaning up resource](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xsiefyjuesx70ha2jg16.jpg)

A box will pop up requiring you to confirm deleting your VM. Type yes in the Confirm Delete box and select Delete. This will finalize the deleting of your VM, and you will not be charged for the resource. 

![Deleting VM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qwyj3d14ql78mxw83mzx.jpg)
 
CONCLUSION 
In this tutorial, you have learnt how to create a VM and connect to your VM using the Remote Desktop as well as installing a web browser via PowerShell.