DEV Community

etidoekom
etidoekom

Posted on • Updated on

HOW TO CREATE A VIRTUAL MACHINE, CONNECT TO IT USING REMOTE DESKTOP AND INSTALL A WEB BROWSER- (MAC USERS)

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

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

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

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

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

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

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

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

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

Next, click continue when this next pop-up window appears.

Connecting to VM via RDP

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

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

Accessing PowerShell

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

Run as administrator

STEP EIGHT:
The picture below should appear on your screen next.

Loading PowerShell

Once seen, paste the following command in the box to install the webserver feature: *Install-WindowsFeature Web-Server *

webserver installation

STEP NINE:
Upon completion of the instalment, your screen will display the following information attached below.

Successful installation

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

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

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

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.

Top comments (0)