Setting Up a Windows 11 Virtual Machine with Azure on a MacOs

Setting Up a Windows 11 Virtual Machine with Azure on a MacOs

In this post, I’d like to share how I created a “resource” in Azure portal. By definition, a resource in an Azure portal is a service required to create a product or solution. In Microsoft Azure, everything needed for a business solution is colloquially called “resource”. In this case, the resource that I will be creating in Microsoft Azure Portal is called a “virtual machine”. Virtual machines are scalable computing resources that can be used to deploy applications on the cloud. VMs -short for virtual machines – are listed under Microsoft Azure’s Infrastructure as a Service (IaaS) category.

The first step in creating a virtual machine is getting a Microsoft account. Once you have a Microsoft account click this link to create an Azure free trial account.

Click on the “Try Azure for free” button. This takes you to the page below.

Scroll and click “sign up” for the Azure free account card.

The next page will ask for your Microsoft login details. On the next page, fill in the required information. You need to enter your credit card details at some point during the registration. Note that only $1 is deducted initially for the 30-day free Azure service and after 30 days, Microsoft begins to charge for the services used.

This Free Azure account is designed to offer customers free tier services to test new applications and evaluate the benefits of cloud computing. When you start using Azure with a free account, you get a $200 credit to spend in the first 30 days after you sign up.

At the Azure platform (after completing the Registration ) like the image below:

There are three options available to create a virtual machine resource. The first approach is the search bar labeled “1” in the image above. At the search bar, you can search for “virtual machine”, and from the dropdown, select “virtual machine” from the list. The second approach is labeled as “2” and in this option, you can select the virtual machines icon to create a virtual machine. The third option is to click the “Create a resource” icon. Either way allows for the creation of a virtual machine.

After selecting the “Virtual Machines” icon and the “create” button

that appears on the next page displayed, select “Azure Virtual Machine” from the list.

Basics Tab

This takes us to the “Create a Virtual Machine” page below:

There are 8 tabs at the top level of that page, and the first tab of concern is “Basics” annotated in a red rectangle.

Project details

Below the top-level tab is the “Project details” section which consists of “Subscription” and “Resource group”. The “Subscription” gives you the admin privilege to create resources. “Resource group” is a container for grouping similar items in Azure. In Azure, there will be a need for a container to group similar things. Give the “Subscriptions” and the “Resource group” labels names. I gave mine “Azure subscription 1” and “AzureRG” as shown in the above image.
For the “Resource group” label select “Create new” to give it a name.

Instance details

The next section of concern is the “Instance details” labeled “1” in the below image:

Virtual machine name

Under this section there are subheadings like:
“Virtual machine name”, “Region”, “Availability Options”, and “Availability zone” just to mention a few.

The Virtual machine is just like a computer in the cloud, and normally your physical computers have a name. So in this section, give the virtual machine a name. I named mine “BusinessVM” as shown in the image below:

Region

Next, move to the “Region” label. “Region” describes a geographical location where data centers are located. The Region selection should be done based on the understanding of the availability of support and other factors.

Availability options

The next label is the “availability options”.

This infers that the user should set up alternatives per adventure if something goes wrong. As you can see in the image below, I chose the “Availability zone” option.

Availability zone

After “availability options” the next label is “Availability zone”. This is a drop-down list of available zones for users to select the number of data centers to use. Availability zones in Microsoft Azure are made up of physical & logical data centers that have been segregated. This drop-down list is made up of zone 1, zone 2, and zone 3 and they are interconnected with highspeed internet network, cooling, and power. I selected zone 1 and zone 3 in the image below.

It is possible to select all three zones, but my preferred size (discussed in 3 labels below ) dictates the number of zones I can use in my virtual machine. Note also that the number of zones selected will alter the virtual machine names. In this example, I selected 2 zones: “zone 1” and “zone 3”. As a result, I will end up with 2 virtual machine names called “BusinessVM-1” and “BusinessVM-2”. This means I will have 2 virtual machines distributed between the 2 zones I selected earlier.

Security type

For the “security type” label, select “Trusted launch virtual machines” from the drop-down menu. (see below)

image

Next, it is required that I select the Operating System that will be running in the virtual machines. This post is about Setting Up a Windows 11 Virtual Machine. So at the “image” label, select the drop down list to reveal operating systems that can run in the virtual machine being created.

I selected Windows 11 as the preferred Operating System.

VM Architecture

The “VM Architecture” label radio button selection should be retained at “x64”.

Run with Azure Spot discount

Do not tick “Run with Azure Spot discount” box

size

At the “size” label, there was a warning in “2” in the image below saying “This size is not available in zone 1,2,3. Zones 1,3 are supported”. It says the “Standard_B1s…” isn’t available in zone 1,2,3. This made me select the “see all sizes” in “3” below to see my options.

I am taken to a page titled “Select a VM Size”

This displays the various sizes that can be used with the virtual machine being created. I selected the “B Series v2” list on the page as shown in the image above. This further shows a sub-list under the “B Series v2”. In the image below, I selected the “B2as_V2” size option.

After this selection click on the “Select” button at the bottom part of the page.

This returns to the “Create a Virtual Machine” page. The next section of focus is the “Administrator Account”.

Administrator Account

This section requires that a “username”, to be used in the operating system is supplied, as well as the “password”. I have set my “username” as “azureUser” and my password too.

Inbound port rules

In the image below, “inbound port rules” is captured in the red rectangle (“1”), and it has 2 labels namely: “Public inbound ports” and “select inbound ports”.

For the first label “Public inbound ports” I selected “Allow selected ports” while for the second label, I selected “RDP (3389)” from the list of options. This applies to only Windows-based Operating Systems. For Linux-based Operating Systems, “SSH(22)” applies.

Licensing

The last label in the “Basics” Tab is “Licensing”.

Tick the box to “confirm I have an eligible Windows 10/11 license..”

Networking Tab

At the “Networking” Tab, scroll to the “Load balancing” section,

and select the “None” radio button under the “Load balancing options” label

Monitoring Tab

The Monitoring Tab has 3 headings namely “Alerts”, “Diagnostics” and “Health”.

The focus of this post is “Diagnostics” and the “Boot diagnostics” label. I selected the “Disable” radio button.

Tags Tab


Tags are name/value pairs that enable you to categorize resources and view consolidated billing by applying the same tag to multiple resources and resource groups.
In the image below, I wrote “Department” as the “Name” and “IT” as the “Value”. In the “Resources” column, I selected “All resources”.

Review + create

This is the last button to select after following and applying the above-mentioned steps. “Review + create” will validate all the settings supplied and proceed to the next step in creating the “virtual machine”. If there is an issue with any of the settings, an error will show up on the affected Tab(s)

when Azure portal is done validating all the settings provided, the page below will display “Validation Passed”. After that, you can then go ahead and click the “Create” button (“2”) at the bottom of the page to create the virtual machine.

Subsequently, the “create” button triggers a page showing the deployment’s progress. As you can see in the image below, “Deployment is in progress” is displayed and labeled as “1”.

At the same time “2” in the image above shows the stage of deployment of the resource “BusinessVM-1” and “BusinessVM-2”.
When the deployment is successful, the page will display “Your deployment is complete” as shown in the image below.

The next step is to click the “Go to resource” button on the page displayed to go to the created resource. (See below)

The next page contains details about the Virtual Machine. The virtual machine’s name is displayed at the top left corner of the page. Below the name is a “search bar” and a sidebar for quick access to tools.

The next step is to change the “idle timeout” of the virtual machine. On the page look for the “Essentials” panel on the right-hand side of the sidebar. Search for the “Public IP address” label as shown below,

and click on the IP. This navigates to the “Configuration” page. The “Idle timeout(minutes)” label has a slider. By default, the idle timeout in minutes is set at 4.

The desirable thing to do is to set it to the maximum to prevent the virtual machine from timing out. So the slider is dragged from the left-hand side to the right-hand side of the slider. Now the idle timeout in minutes is set to 30: the maximum timeout allowable. When this is done click on the “Save” icon at the top of the page.

It returns to the virtual machine page. The next step is to locate the “Connect” button on the sidebar. This will connect the virtual machine after all the configurations performed earlier.

Once the “connect” button is selected, it sets the machine up for another round of validation (see image below). Under the “Native RDP” bar, the labels numbered “2” & “4” indicate the validation process.

Once the validation is complete, labels “1” to “3” will display a green check mark, and label “4” will display “Configured”.

Once this is completed look out for label “1” in the image below and click the “Download RDP file”

It’s 90% done if you’re following these steps on a MacOS computer.
The “RDP” file is downloaded into the downloads directory on a Mac.

The RDP file represents the Windows 11 virtual machine that was created. To check if it works, log in using the credentials created previously. Before signing in, Mac users need to go to the App Store, download and install the Microsoft Remote Desktop app. After installing the Microsoft Remote Desktop app, double-click the downloaded RDP file.

The dialog box will request the password created at the “Administrator Account” subheading above.
If the correct login credentials are submitted there will be a Windows 11 starting page like below.

This is followed by a setup page below.

Click the “Accept” button on this page, and it displays the Windows 11 desktop.

With all the aforementioned steps, I have created a Windows 11 virtual machine on an Azure portal.

The virtual machine runs on a free account, and if left running on the MacOS computer and the Azure portal, it may drain out the free $200 credit. So it is advised that the resource group is deleted. However, before deleting the resource group in the Azure portal, there is a need to shut down the Windows 11 virtual machine on the MacOS. Since the Windows 11 desktop is still on, it needs to be shut down properly as it is done for any physical system. The power button for the Windows 11 virtual machine is located at the bottom labeled “1” in the image below.

On clicking this button, a fly-out card of options appears. (see label “2” below)

From this fly-out card, the Windows 11 virtual machine on MacOS can be shut down.

Next, the resource group should be deleted to prevent incurring charges. I went back to the Azure portal page as shown below.

My resource group labeled “1” above is “AzureRG”. Another way to locate the resource group is to search for it at the top-level search bar on the page. Click on the resource group name and it navigates to the resource group page. At the upper part of the page, there is a “Delete resource group” option.

Click on the “Delete resource group” option, and a notification box on the upper right-hand of the page shows “Deleting resource group AzureRG” like in the image below.

The process completes by showing “Deleted resource group AzureRG” in the notifications bell icon at the upper part of the page.

This post describes a high-level approach to creating a Windows 11 virtual machine on a MacOS computer. More posts on cloud DevOps with Azure will be coming up in my journey into Cloud development.