cPanel

Azure Virtual Machine Management


Overview

After you launch a virtual machine with cPanel & WHM on Azure®, you can manage it from the Azure portal. This document describes common tasks that your Azure virtual machine with cPanel & WHM may require.

Note:

For more information, read Azure’s Documentation.

Accessing your virtual machine

You can access your virtual machine using one of the following options:

  • At the bottom of the Your deployment is complete message, click Go to resource.
  • Enter Virtual Machines in the search bar, then select your machine.
  • Your Azure portal home page.

Logging in to WHM for the first time

Logging in to WHM for the first time differs based on your administrator account’s authentication method.

Using a password

If you use a password for your administrator account, you can log into WHM using your administrator username and password. In a web browser, connect to your virtual machine’s public IP address using HTTPS on port 2087. For example: https://192.0.2.0:2087. The cPanel & WHM installation process creates a limited version of a reseller account using that username and password.

If you need to access your virtual machine’s root account, perform the following steps:

  1. Log in to WHM.
  2. Navigate to WHM’s Change Root Password interface (WHM >> Server Configuration >> Change Root Password).

Using an SSH key

If you choose to use an SSH key rather than a password, you must perform the following extra steps before you can log in to WHM for the first time:

  1. If using a new key pair, add your key to your computer.

    Note:

    If you did not download your key while launching your virtual machine, you can access it from Azure’s Resource groups interface. Click the name of your virtual machine’s resource group then the name of the key.

    On an macOS® computer that uses the default download folder:

    1. Run the following command, where example represents the key pair’s name:

      mv ~/Downloads/example.pem ~/.ssh
      
    2. Run the following command to modify the permissions for the .pem file, where example represents the key pair’s name:

      chmod 600 ~/.ssh/example.pem
      
    3. Run the following command to add the key pair, where example represents the key pair’s name:

      ssh-add ~/.ssh/example.pem
      

    On a Windows® computer that runs the PuTTY client and uses the default download folder, perform the following steps:

    1. From the Windows Start menu, open PuttyGen.

    2. Under the Conversions heading, click Import.

    3. Navigate to the PuTTY Key Generator interface and select the .pem key you downloaded. Click Open.

    4. Enter a passphrase in the Key passphrase and Confirm passphrase text boxes.

    5. Click Save private key and save the key as a .ppk file.

    6. From the Windows Start menu, open PuTTY.

    7. In the Session interface, enter the following information:

      • Hostname (or IP address) — You virtual machine’s IP address.
      • Port — Enter 22.
      • Connection type — Select SSH.
      • Saved sessions — Enter a name for your session. Then click Save.
    8. Navigate to the Auth interface under the SSH category.

    9. Click Browse, select the .ppk file you created, and click Open.

  2. After completing the installation of WHM on your virtual machine, log in as your virtual machine’s administrator user over SSH. Use the following command, where key represents the file path of your SSH key, user represents the user you created with your virtual machine and IP represents your virtual machine’s IP address:

    ssh -i key user@IP
    
  3. To get a temporary WHM login URL, run the following command:

    sudo whmlogin
    
  4. Use that login URL to add a password to the root user.

Manage virtual machines

To manage an Azure virtual machine, perform the following steps:

  1. Access your virtual machine from your Azure portal.

  2. Select the desired action from the menu bar below your virtual machine’s name:

    • Connect — This action will help you connect your virtual machine with SSH clients.

      Warning:

      While Remote Desktop Protocols (RDP) and Azure’s Bastion service are listed as other options, these do not work with cPanel & WHM.

    • Start — This action will start a stopped virtual machine. This is not available for virtual machines that are already running.

    • Restart — This action will restart the instance. This is not available for stopped virtual machines.

      • You will be asked to confirm you want to restart your virtual machine.
      • Click Yes.
      • A progress message will appear. It will inform you when your virtual machine finishes restarting.
    • Stop — This action will stop your virtual machine.

      • You will be asked if you want to reserve the public IP address your machine is currently using.
        Warning:

        Your cPanel & WHM license is tied to your IP address. You must select this to avoid issues when restarting your instance.

      • You will be asked to confirm you want to stop your virtual machine.
      • Click OK.
      • If you selected to save the public IP address, a progress message confirming that will appear.
      • A progress message confirming your virtual machine is stopped will appear.
    • Capture — This action will create an image based on your virtual machine.

      Warning:

      We strongly recommend you do not capture images of your cPanel & WHM virtual machines. Capturing images can result in privacy and data issues for you and your users.

    • Delete — This action will delete the virtual machine.

      Warning:

      This will only delete the virtual machine. This will not delete any of the resources associated with the virtual machine. Read the Delete a virtual machine section below for more information.

    • Refresh — This action refreshes the page you are currently on. This is useful after you stop or restart your virtual machine as the menu might not automatically update.

    • Share to mobile — This action will provide you with a QR code and a direct link to the Azure interface of your virtual machine.

Delete a virtual machine or resource group

Important:

Azure will bill you for all active resources on your account. We recommend that you delete unused resource groups rather than only deleting unused virtual machines.

Running a virtual machine on Azure requires more resources than the virtual machine itself. These resources are grouped together in a resource group. If you only delete the virtual machine, the other resources will remain. If no other virtual machines are using the same resource group, we recommend deleting not only the virtual machine but the entire resource group.

It may take a few minutes for a deleted virtual machine or resource group to disappear from the Azure interface.

For more information, read Microsoft’s Azure Resource Manager resource group and resource deletion documentation.

Delete a virtual machine

To delete only a virtual machine, perform the following steps:

  1. Access your virtual machine from your Azure portal.

  2. Click Delete on the menu bar below your virtual machine’s name.

  3. A message will warn you that your virtual machine will be permanently deleted. It will also tell you that the associated resources will not be deleted.

  4. Click Yes.

  5. A progress message will appear. It will inform you when your virtual machine is deleted.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *