Experience: is what you get soon after you need it.

Experience: is what you get soon after you need it.



My Cloud Certifications:

GIAC Cloud Penetration Tester (GCPN)

GIAC Cloud Security Automation (GCSA)

GIAC Security Essentials (GSEC)

Certified Kubernetes Administrator (CKA)

Cloud Certified Security Professional (ISC2)

CyberSecurity Certified Professional (ISC2)

AWS Certified Solutions Architect Associate

Azure Certified Architect Expert

Azure Certified Architect

Azure Certified Administrator

Oracle Cloud Infrastructure 2018 Certified Architect Associate.

Oracle Cloud Infrastructure Classic 2018 Certified Architect Associate.

Oracle Database Cloud Administrator Certified Professional.

Oracle Database Cloud Service Operations Certified Associate.

Search This Blog

Showing posts with label Azure. Show all posts
Showing posts with label Azure. Show all posts

Thursday, April 21, 2022

‘D:\home\site\wwwroot\host.json’ is denied.

 Function App will not start or deployment will thrown an error as below:

'D:\home\site\wwwroot\host.json' is denied.


If you receive a System.UnauthorizedAccessException with a message Access to the path ‘D:\home\site\wwwroot\host.json’ is denied, 

then mostly likely access from functionapp to the Azure Storage Account is being blocked where Azure Function is hosted.  



1) Check if your functionapp is restricted to a specific VNET  as shown below:




If it is not configured to a specific VNET then make sure the storage account where the function app is hosted has selected "ALL Networks" as shown below






If the function app is configured to a specific VNET then make sure the storage account where the function app is hosted has selected "Specific Networks" and the VNET is selected from the listed as shown below





Wednesday, May 19, 2021

How to import a resource in terraform if not is not being managed already

 If a cloud resource is not being managed by your terraform scripts then in the below post I will show you how you can make terraform mange it.

I have a resource already created by ARM templates but now I want it managed by terraform.

Ex:-

azurerm_subnet.app-subnet: Creating...


azurerm_subnet.app-subnet: Creating...

 Error: A resource with the ID "/subscriptions/12XXXXXXX058f0/resourceGroups/XXXcare-rg/providers/Microsoft.Network/virtualNetworks/datacare-vnet/subnets/xxxcare-appsubnet" already exists - to be managed via Terraform this resource needs to be imported into the State. Please see the resource documentation for "azurerm_subnet" for more information.

  on main.tf line 29, in resource "azurerm_subnet" "app-subnet":

   29: resource "azurerm_subnet" "app-subnet" {


Now if we want terraform to manage this resource we need to add (import) this resource into the state file. 

First get the resource id of this resource from properties blade.


Then use the below command to import the resource into the state file.


terraform import azurerm_subnet.app-subnet /subscriptions/12XXX58f0/resourceGroups/care-rg/providers/Microsoft.Network/virtualNetworks/my-vnet


Ex:-

samshaik@shaikprod:~/terraform/azure/confluence$ terraform import azurerm_subnet.app-subnet /subscriptions/12XXX58f0/resourceGroups/care-rg/providers/Microsoft.Network/virtualNetworks/my-vnet

azurerm_subnet.app-subnet: Importing from ID "/subscriptions/12XXX58f0/resourceGroups/care-rg/providers/Microsoft.Network/virtualNetworks/my-vnet"...

azurerm_subnet.app-subnet: Import prepared!

  Prepared azurerm_subnet for import

azurerm_subnet.app-subnet: Refreshing state... [id=/ssubscriptions/12XXX58f0/resourceGroups/care-rg/providers/Microsoft.Network/virtualNetworks/my-vnet]


Import successful!


The resources that were imported are shown above. These resources are now in your Terraform state and will henceforth be managed by Terraform.


Now create the plan again:

samshaik@shaikprod:~/terraform/azure/confluence$ terraform plan -out confluencedev.plan

Plan: 3 to add, 0 to change, 1 to destroy.


Saved the plan to: confluencedev.plan

To perform exactly these actions, run the following command to apply:

    terraform apply "confluencedev.plan"


Now apply the plan to create the resources:

Plan: 3 to add, 0 to change, 0 to destroy.


Do you want to perform these actions?

  Terraform will perform the actions described above.

  Only 'yes' will be accepted to approve.


  Enter a value: yes


Wednesday, April 28, 2021

How to export VM Image in Azure



How to export VM Image in Azure



Create the snapshot using the below JSON template, if you already have a snapshot then you can skip this step.


{

  "id": "/subscriptions/subid/resourceGroups/MYAPP/providers/Microsoft.Resources/deployments/Snapshot.az-mydisk-os-post-upgrade-20210428111917",

  "name": "Snapshot.az-mydisk-os-post-upgrade-20210428111917",

  "type": "Microsoft.Resources/deployments",

  "tags": {

    "primaryResourceId": "/subscriptions/subid/resourceGroups/MYAPP/providers/Microsoft.Compute/snapshots/az-mydisk-os-post-upgrade",

    "marketplaceItemId": "Microsoft.Snapshot"

  },

  "properties": {

    "templateHash": "13238197693155926102",

    "parameters": {

      "apiVersion": {

        "type": "String",

        "value": "2020-09-30"

      },

      "name": {

        "type": "String",

        "value": "az-mydisk-os-post-upgrade"

      },

      "location": {

        "type": "String",

        "value": "eastus"

      },

      "accountType": {

        "type": "String",

        "value": "Standard_LRS"

      },

      "createOption": {

        "type": "String",

        "value": "Copy"

      },

      "sourceUri": {

        "type": "String",

        "value": "/subscriptions/subid/resourceGroups/MYAPP/providers/Microsoft.Compute/disks/mydisk_OsDisk_1_29a2c78fb9b8b27"

      },

      "incremental": {

        "type": "String",

        "value": "false"

      },

      "diskEncryptionSetType": {

        "type": "String",

        "value": "EncryptionAtRestWithPlatformKey"

      },

      "networkAccessPolicy": {

        "type": "String",

        "value": "DenyAll"

      }

    },

    "mode": "Incremental",

    "debugSetting": {

      "detailLevel": "None"

    },

    "provisioningState": "Succeeded",

    "timestamp": "2021-04-28T15:19:28.849237Z",

    "duration": "PT12.642492S",

    "correlationId": "2008b5e6-9306-4413-b595-0663861bd405",

    "providers": [

      {

        "namespace": "Microsoft.Compute",

        "resourceTypes": [

          {

            "resourceType": "snapshots",

            "locations": [

              "eastus"

            ]

          }

        ]

      }

    ],

    "dependencies": [],

    "outputResources": [

      {

        "id": "/subscriptions/subid/resourceGroups/MYAPP/providers/Microsoft.Compute/snapshots/az-mydisk-os-post-upgrade"

      }

    ],

    "validationLevel": "Template"

  }

}


Make sure that you have appropriate access level set while creating the snapshot. Only with public endpoint connectivity method you will be able to export the snapshot and share it outside of your VNET.













Then snapshot export:


















If you don't see the Generate URL option then change the networking settings to public for this snapshot.















Now click on Generate URL:




Now copy the url in a browser and download the entire image, you can also use wget via command line to download the image.







Monday, April 26, 2021

How to create cloud infrastructure using terraform scripts.


Here is the sample code to create few resource groups/Network and storage in the cloud.

Here is my main.tf file which will call variables file to lookup the variables that I have defined.

# Provider source and version being used
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "=2.46.0"
}
}
}

# Configure the Microsoft Azure Provider
provider "azurerm" {
features {}
}

# Create a resource group in existing VNET
resource "azurerm_resource_group" "dev-rg" {
name = "${var.resource_group_name}"
location = "${var.locations["location1"]}"
}

# Create a virtual network within the resource group
resource "azurerm_virtual_network" "dev-vnet" {
name = "${var.virtual_network_name}"
resource_group_name = "${var.resource_group_name}"
location = "${var.locations["location1"]}"
address_space = "${var.address_prefixes}"
depends_on = [azurerm_resource_group.dev-rg]
}

# Create a Subnet in existing VNET
resource "azurerm_subnet" "dev-app-subnet" {
name = "db-subnet"
resource_group_name = "${var.resource_group_name}"
virtual_network_name = "${var.virtual_network_name}"
address_prefixes = ["10.0.1.0/24"]
depends_on = [azurerm_resource_group.dev-rg, azurerm_virtual_network.dev-vnet]

delegation {
name = "delegation"

service_delegation {
name = "Microsoft.ContainerInstance/containerGroups"
actions = ["Microsoft.Network/virtualNetworks/subnets/join/action", "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action"]
}
}
}

Here is my variables file:

variable "resource_group_name" {
default = "dev-rg"
}

variable "locations" {
type = map(string)
default = {
location1 = "eastus"
location2 = "westus"
}
}

variable "virtual_network_name" {
default = "dev-vnet"
}

variable "address_prefixes" {
type = list(string)
default = ["10.0.0.0/16"]
}

variable "vnet_app_subnet" {
description = "The subnet id of the virtual network where the virtual machines will reside."
type = list(string)
default = ["10.0.1.0/24"]
}






samshaik@shaikprod:~/terraform/lab$ terraform init

Initializing the backend...

Initializing provider plugins...
- Reusing previous version of hashicorp/azurerm from the dependency lock file
- Using previously-installed hashicorp/azurerm v2.46.0

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.


samshaik@shaikprod:~/terraform/lab$ terraform plan
azurerm_resource_group.dev-rg: Refreshing state... [id=/subscriptions/cdc85617-7bc1-49b9-9350-1091dac2c37b/resourceGroups/dev-rg]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # azurerm_subnet.dev-app-subnet will be created
  + resource "azurerm_subnet" "dev-app-subnet" {
      + address_prefix                                 = (known after apply)
      + address_prefixes                               = [
          + "10.0.1.0/24",
        ]
      + enforce_private_link_endpoint_network_policies = false
      + enforce_private_link_service_network_policies  = false
      + id                                             = (known after apply)
      + name                                           = "db-subnet"
      + resource_group_name                            = "dev-rg"
      + virtual_network_name                           = "dev-vnet"

      + delegation {
          + name = "delegation"

          + service_delegation {
              + actions = [
                  + "Microsoft.Network/virtualNetworks/subnets/join/action",
                  + "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action",
                ]
              + name    = "Microsoft.ContainerInstance/containerGroups"
            }
        }
    }

  # azurerm_virtual_network.dev-vnet will be created
  + resource "azurerm_virtual_network" "dev-vnet" {
      + address_space         = [
          + "10.0.0.0/16",
        ]
      + guid                  = (known after apply)
      + id                    = (known after apply)
      + location              = "eastus"
      + name                  = "dev-vnet"
      + resource_group_name   = "dev-rg"
      + subnet                = (known after apply)
      + vm_protection_enabled = false
    }

Plan: 2 to add, 0 to change, 0 to destroy.



samshaik@shaikprod:~/terraform/lab$ terraform apply
azurerm_resource_group.dev-rg: Refreshing state... [id=/subscriptions/cdc85617-7bc1-49b9-9350-1091dac2c37b/resourceGroups/dev-rg]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # azurerm_subnet.dev-app-subnet will be created
  + resource "azurerm_subnet" "dev-app-subnet" {
      + address_prefix                                 = (known after apply)
      + address_prefixes                               = [
          + "10.0.1.0/24",
        ]
      + enforce_private_link_endpoint_network_policies = false
      + enforce_private_link_service_network_policies  = false
      + id                                             = (known after apply)
      + name                                           = "db-subnet"
      + resource_group_name                            = "dev-rg"
      + virtual_network_name                           = "dev-vnet"

      + delegation {
          + name = "delegation"

          + service_delegation {
              + actions = [
                  + "Microsoft.Network/virtualNetworks/subnets/join/action",
                  + "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action",
                ]
              + name    = "Microsoft.ContainerInstance/containerGroups"
            }
        }
    }

  # azurerm_virtual_network.dev-vnet will be created
  + resource "azurerm_virtual_network" "dev-vnet" {
      + address_space         = [
          + "10.0.0.0/16",
        ]
      + guid                  = (known after apply)
      + id                    = (known after apply)
      + location              = "eastus"
      + name                  = "dev-vnet"
      + resource_group_name   = "dev-rg"
      + subnet                = (known after apply)
      + vm_protection_enabled = false
    }

Plan: 2 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

azurerm_virtual_network.dev-vnet: Creating...
azurerm_virtual_network.dev-vnet: Creation complete after 4s [id=/subscriptions/cdc85617-7bc1-49b9-9350-1091dac2c37b/resourceGroups/dev-rg/providers/Microsoft.Network/virtualNetworks/dev-vnet]
azurerm_subnet.dev-app-subnet: Creating...
azurerm_subnet.dev-app-subnet: Creation complete after 4s [id=/subscriptions/cdc85617-7bc1-49b9-9350-1091dac2c37b/resourceGroups/dev-rg/providers/Microsoft.Network/virtualNetworks/dev-vnet/subnets/db-subnet]

Apply complete! Resources: 2 added, 0 changed, 0 destroyed.




samshaik@shaikprod:~/terraform/lab$ terraform destroy
azurerm_resource_group.dev-rg: Refreshing state... [id=/subscriptions/cdc85617-7bc1-49b9-9350-1091dac2c37b/resourceGroups/dev-rg]
azurerm_virtual_network.dev-vnet: Refreshing state... [id=/subscriptions/cdc85617-7bc1-49b9-9350-1091dac2c37b/resourceGroups/dev-rg/providers/Microsoft.Network/virtualNetworks/dev-vnet]
azurerm_subnet.dev-app-subnet: Refreshing state... [id=/subscriptions/cdc85617-7bc1-49b9-9350-1091dac2c37b/resourceGroups/dev-rg/providers/Microsoft.Network/virtualNetworks/dev-vnet/subnets/db-subnet]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  - destroy

Terraform will perform the following actions:

  # azurerm_resource_group.dev-rg will be destroyed
  - resource "azurerm_resource_group" "dev-rg" {
      - id       = "/subscriptions/cdc85617-7bc1-49b9-9350-1091dac2c37b/resourceGroups/dev-rg" -> null
      - location = "eastus" -> null
      - name     = "dev-rg" -> null
      - tags     = {} -> null
    }

  # azurerm_subnet.dev-app-subnet will be destroyed
  - resource "azurerm_subnet" "dev-app-subnet" {
      - address_prefix                                 = "10.0.1.0/24" -> null
      - address_prefixes                               = [
          - "10.0.1.0/24",
        ] -> null
      - enforce_private_link_endpoint_network_policies = false -> null
      - enforce_private_link_service_network_policies  = false -> null
      - id                                             = "/subscriptions/cdc85617-7bc1-49b9-9350-1091dac2c37b/resourceGroups/dev-rg/providers/Microsoft.Network/virtualNetworks/dev-vnet/subnets/db-subnet" -> null
      - name                                           = "db-subnet" -> null
      - resource_group_name                            = "dev-rg" -> null
      - service_endpoint_policy_ids                    = [] -> null
      - service_endpoints                              = [] -> null
      - virtual_network_name                           = "dev-vnet" -> null

      - delegation {
          - name = "delegation" -> null

          - service_delegation {
              - actions = [
                  - "Microsoft.Network/virtualNetworks/subnets/action",
                ] -> null
              - name    = "Microsoft.ContainerInstance/containerGroups" -> null
            }
        }
    }

  # azurerm_virtual_network.dev-vnet will be destroyed
  - resource "azurerm_virtual_network" "dev-vnet" {
      - address_space         = [
          - "10.0.0.0/16",
        ] -> null
      - dns_servers           = [] -> null
      - guid                  = "53edc62c-1259-4de2-8f6b-60beebee5466" -> null
      - id                    = "/subscriptions/cdc85617-7bc1-49b9-9350-1091dac2c37b/resourceGroups/dev-rg/providers/Microsoft.Network/virtualNetworks/dev-vnet" -> null
      - location              = "eastus" -> null
      - name                  = "dev-vnet" -> null
      - resource_group_name   = "dev-rg" -> null
      - subnet                = [
          - {
              - address_prefix = "10.0.1.0/24"
              - id             = "/subscriptions/cdc85617-7bc1-49b9-9350-1091dac2c37b/resourceGroups/dev-rg/providers/Microsoft.Network/virtualNetworks/dev-vnet/subnets/db-subnet"
              - name           = "db-subnet"
              - security_group = ""
            },
        ] -> null
      - tags                  = {} -> null
      - vm_protection_enabled = false -> null
    }

Plan: 0 to add, 0 to change, 3 to destroy.

Do you really want to destroy all resources?
  Terraform will destroy all your managed infrastructure, as shown above.
  There is no undo. Only 'yes' will be accepted to confirm.

  Enter a value: yes

azurerm_subnet.dev-app-subnet: Destroying... [id=/subscriptions/cdc85617-7bc1-49b9-9350-1091dac2c37b/resourceGroups/dev-rg/providers/Microsoft.Network/virtualNetworks/dev-vnet/subnets/db-subnet]
azurerm_subnet.dev-app-subnet: Still destroying... [id=/subscriptions/cdc85617-7bc1-49b9-9350-...ualNetworks/dev-vnet/subnets/db-subnet, 10s elapsed]
azurerm_subnet.dev-app-subnet: Destruction complete after 10s
azurerm_virtual_network.dev-vnet: Destroying... [id=/subscriptions/cdc85617-7bc1-49b9-9350-1091dac2c37b/resourceGroups/dev-rg/providers/Microsoft.Network/virtualNetworks/dev-vnet]
azurerm_virtual_network.dev-vnet: Still destroying... [id=/subscriptions/cdc85617-7bc1-49b9-9350-...osoft.Network/virtualNetworks/dev-vnet, 10s elapsed]
azurerm_virtual_network.dev-vnet: Destruction complete after 11s
azurerm_resource_group.dev-rg: Destroying... [id=/subscriptions/cdc85617-7bc1-49b9-9350-1091dac2c37b/resourceGroups/dev-rg]
azurerm_resource_group.dev-rg: Still destroying... [id=/subscriptions/cdc85617-7bc1-49b9-9350-1091dac2c37b/resourceGroups/dev-rg, 10s elapsed]
azurerm_resource_group.dev-rg: Still destroying... [id=/subscriptions/cdc85617-7bc1-49b9-9350-1091dac2c37b/resourceGroups/dev-rg, 20s elapsed]
azurerm_resource_group.dev-rg: Still destroying... [id=/subscriptions/cdc85617-7bc1-49b9-9350-1091dac2c37b/resourceGroups/dev-rg, 30s elapsed]
azurerm_resource_group.dev-rg: Still destroying... [id=/subscriptions/cdc85617-7bc1-49b9-9350-1091dac2c37b/resourceGroups/dev-rg, 40s elapsed]
azurerm_resource_group.dev-rg: Destruction complete after 45s

Destroy complete! Resources: 3 destroyed.













Tuesday, April 20, 2021

Install Azure cli

 How to install azure cli on Ubuntu:


I am using wsl (Windows Subsystem for Linux) i.e I have a working Ubuntu v20 on my windows desktop & laptop and can you use my windows machine as a regular linux vm. 

More on WSL  https://docs.microsoft.com/en-us/windows/wsl/install-win10


My Ubuntu:

samshaik@shaikprod:~$ cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.4 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.4 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

If you have already azure cli installed then you can remove it as below:

sudo apt remove azure-cli -y && sudo apt autoremove -y

samshaik@shaikprod:~$ sudo apt remove azure-cli -y && sudo apt autoremove -y
[sudo] password for samshaik:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  libdumbnet1
Use 'sudo apt autoremove' to remove it.
The following packages will be REMOVED:
  azure-cli
0 upgraded, 0 newly installed, 1 to remove and 6 not upgraded.
After this operation, 496 MB disk space will be freed.
(Reading database ... 67032 files and directories currently installed.)
Removing azure-cli (2.1.0-1~bionic) ...
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  libdumbnet1
0 upgraded, 0 newly installed, 1 to remove and 6 not upgraded.
After this operation, 91.1 kB disk space will be freed.
(Reading database ... 30029 files and directories currently installed.)
Removing libdumbnet1:amd64 (1.12-7build1) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...


You can install azure cli in a single command as below:
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash


samshaik@shaikprod:~$ curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]


Selecting previously unselected package azure-cli.
(Reading database ... 30020 files and directories currently installed.)
Preparing to unpack .../azure-cli_2.22.1-1~bionic_all.deb ...
Unpacking azure-cli (2.22.1-1~bionic) ...
Setting up azure-cli (2.22.1-1~bionic) ...


Verify the version:

samshaik@shaikprod:~$ az -v
azure-cli                         2.22.1

core                              2.22.1
telemetry                          1.0.6

Python location '/opt/az/bin/python3'
Extensions directory '/home/samshaik/.azure/cliextensions'

Python (Linux) 3.6.10 (default, Apr 19 2021, 07:29:42)
[GCC 7.5.0]

Legal docs and information: aka.ms/AzureCliLegal


Your CLI is up-to-date.






Thursday, July 25, 2019

Azure move pagefile and change drive letter for D drive



In Azure on windows VMs, D:\ drive is reserved for pagefile and any data you store on this drive will be deleted. But there are few apps or you have jobs on your on-prem that have been hard coded to use the D drive as data disk. Rather changing the drive path in your jobs it is easy to change the pagefile drive to a different drive.



So How do we move the pagefile to a different drive and rename the D drive to a drive.





Temporarily move pagefile.sys to C drive

  1. Connect to the virtual machine.
  2. Right-click the Start menu and select System.
  3. In the left-hand menu, select Advanced system settings.
  4. In the Performance section, select Settings.
  5. Select the Advanced tab.
  6. In the Virtual memory section, select Change.
  7. Select the C drive and then click System managed size and then click Set.
  8. Select the D drive and then click No paging file and then click Set.
  9. Click Apply. You will get a warning that the computer needs to be restarted for the changes to take affect.
  10. Restart the virtual machine.

Change the drive letters

  1. Once the VM restarts, log back on to the VM.
  2. Click the Start menu and type diskmgmt.msc and hit Enter. Disk Management will start.
  3. Right-click on D, the Temporary Storage drive, and select Change Drive Letter and Paths.
  4. Under Drive letter, select a new drive such as T and then click OK.
  5. Right-click on the data disk, and select Change Drive Letter and Paths.
  6. Under Drive letter, select drive D and then click OK.


Move pagefile.sys back to the temporary storage drive

  1. Right-click the Start menu and select System
  2. In the left-hand menu, select Advanced system settings.
  3. In the Performance section, select Settings.
  4. Select the Advanced tab.
  5. In the Virtual memory section, select Change.
  6. Select the OS drive C and click No paging file and then click Set.
  7. Select the temporary storage drive T and then click System managed size and then click Set.
  8. Click Apply. You will get a warning that the computer needs to be restarted for the changes to take affect.
  9. Restart the virtual machine.