Custom Imported Arch-based Linux Image VHD not starting as VM in Azure

James Vega 41 Reputation points
2024-08-12T12:56:44.1433333+00:00

On my Windows 11 host I generated a VHD file (fixed-size) by Hyper-V where I installed an Arch-based system. After the installation of the OS, I enabled RDP service on it by Xrdp and it works locally.

On Azure, I uploaded the VHD file in a Storage Account, then I created an Image with the following parameters:

{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "images_AthenaArchGen1_name": {
            "defaultValue": "AthenaArchGen1",
            "type": "String"
        }
    },
    "variables": {},
    "resources": [
        {
            "type": "Microsoft.Compute/images",
            "apiVersion": "2024-03-01",
            "name": "[parameters('images_AthenaArchGen1_name')]",
            "location": "switzerlandnorth",
            "properties": {
                "storageProfile": {
                    "osDisk": {
                        "osType": "Linux",
                        "osState": "Generalized",
                        "diskSizeGB": 127,
                        "blobUri": "https://athenaosimages.blob.core.windows.net/athenaarch/athenaarch.vhd",
                        "caching": "ReadWrite",
                        "storageAccountType": "StandardSSD_LRS"
                    },
                    "dataDisks": [],
                    "zoneResilient": false
                },
                "hyperVGeneration": "V1"
            }
        }
    ]
}

(I created a Gen1 Image because when I tried to upload a VHDX file that supports Gen2, it didn't work)

After the creation of this Image, I created an Azure Virtual Machine by using this image with the following parameters:

{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "virtualMachines_AthenaArchGen1_name": {
            "defaultValue": "AthenaArchGen1",
            "type": "String"
        },
        "images_AthenaArchGen1_externalid": {
            "defaultValue": "/subscriptions/4e3e39ed-fbd8-4867-9bba-4e8e3258ac69/resourceGroups/AthenaComputeGallery/providers/Microsoft.Compute/images/AthenaArchGen1",
            "type": "String"
        },
        "disks_AthenaArchGen1_disk1_9198ed9bfbae4290b17c2db0e4cec81d_externalid": {
            "defaultValue": "/subscriptions/4e3e39ed-fbd8-4867-9bba-4e8e3258ac69/resourceGroups/ATHENACOMPUTEGALLERY/providers/Microsoft.Compute/disks/AthenaArchGen1_disk1_9198ed9bfbae4290b17c2db0e4cec81d",
            "type": "String"
        },
        "networkInterfaces_athenaarchgen1548_z1_externalid": {
            "defaultValue": "/subscriptions/4e3e39ed-fbd8-4867-9bba-4e8e3258ac69/resourceGroups/AthenaComputeGallery/providers/Microsoft.Network/networkInterfaces/athenaarchgen1548_z1",
            "type": "String"
        }
    },
    "variables": {},
    "resources": [
        {
            "type": "Microsoft.Compute/virtualMachines",
            "apiVersion": "2024-03-01",
            "name": "[parameters('virtualMachines_AthenaArchGen1_name')]",
            "location": "switzerlandnorth",
            "zones": [
                "1"
            ],
            "properties": {
                "hardwareProfile": {
                    "vmSize": "Standard_D2s_v3"
                },
                "additionalCapabilities": {
                    "hibernationEnabled": false
                },
                "storageProfile": {
                    "imageReference": {
                        "id": "[parameters('images_AthenaArchGen1_externalid')]"
                    },
                    "osDisk": {
                        "osType": "Linux",
                        "name": "[concat(parameters('virtualMachines_AthenaArchGen1_name'), '_disk1_9198ed9bfbae4290b17c2db0e4cec81d')]",
                        "createOption": "FromImage",
                        "caching": "ReadWrite",
                        "managedDisk": {
                            "id": "[parameters('disks_AthenaArchGen1_disk1_9198ed9bfbae4290b17c2db0e4cec81d_externalid')]"
                        },
                        "deleteOption": "Delete",
                        "diskSizeGB": 127
                    },
                    "dataDisks": []
                },
                "osProfile": {
                    "computerName": "[parameters('virtualMachines_AthenaArchGen1_name')]",
                    "adminUsername": "
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,789 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.