# VM Boot Stuck With Booting From Hard Disk Console Message

## Problem

VM Boot Stuck with "Booting from Hard Disk" Console Message with VM status `ACTIVE` on the console.

## Cause

The VM Image is built to set boot in UEFI mode, not legacy BIOS which is default.

## Diagnostics

{% stepper %}
{% step %}

### Check VM status

Verify the VM is running and VM Status shows active on the PCD GUI.
{% endstep %}

{% step %}

### Connect QCOW2 image using qemu-nbd

Run:

```bash
sudo qemu-nbd --connect=/dev/nbd0 <IMAGE_NAME>.qcow2
```

If the above command fails with the error:

qemu-nbd: Failed to open /dev/nbd0: No such file or directory

then load the nbd kernel module:

```bash
sudo modprobe nbd max_part=8
```

Then retry:

```bash
sudo qemu-nbd --connect=/dev/nbd0 <IMAGE_NAME>.qcow2
```

{% endstep %}

{% step %}

### Inspect disk partition types

Check if any disk has type "EFI" (which indicates the qcow2 image is set to boot in UEFI mode):

```bash
sudo fdisk -l /dev/nbd0
```

{% endstep %}

{% step %}

### Disconnect the NBD

When finished, disconnect:

```bash
sudo qemu-nbd --disconnect /dev/nbd0
```

{% endstep %}
{% endstepper %}

## Resolution

{% hint style="info" %}
These steps are applicable only when the Diagnostics step that inspects partitions shows any disk with type "EFI".
{% endhint %}

{% stepper %}
{% step %}

### Update image properties in PCD GUI

Using the PCD GUI edit the image properties (VM → Images → Select Image → Edit properties) and add the following values:

```bash
hw_firmware_type=uefi
hw_machine_type=q35
```

{% endstep %}

{% step %}

### Rebuild the VM

Rebuild the VM using the updated image properties.
{% endstep %}
{% endstepper %}

## Validation

1. Check if the VM boots successfully.
2. If these steps prove insufficient to resolve the issue, reach out to the [Platform9 Support Team](https://support.platform9.com/hc/en-us) for additional assistance.
