Deploying VM from Content Library fails with error: "PARSE_ERROR: Unexpected character '' (code 65533 / 0xfffd) in prolog"
search cancel

Deploying VM from Content Library fails with error: "PARSE_ERROR: Unexpected character '' (code 65533 / 0xfffd) in prolog"

book

Article ID: 446664

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

When attempting to deploy a virtual machine from an OVF/OVA template stored in the Content Library, the task fails with the following error message: Issues detected with selected template. Details: - 1:1:PARSE_ERROR: Parse error: Unexpected character '' (code 65533 / 0xfffd) in prolog; expected '<' at [row,col,system-id]: [1,1,"descriptor.ovf"]

Running the # file command shows (with BOM):

#  file template.ovf
template.ovf: XML 1.0 document, UTF-8 Unicode (with BOM) text, with very long lines, with CRLF line terminators

 

Environment

VMware vCenter Server 7.x, 8.x, 9.x

 

Cause

This issue is caused by an invalid character at the very beginning of the OVF descriptor file, typically a Byte Order Mark (BOM).

The vCenter Server XML parser requires the OVF file to start exactly with the < character of the XML declaration. If the .ovf file is opened and saved using standard Windows text editors (such as Notepad or WordPad) or modified via certain scripts, a hidden BOM is often injected. vCenter interprets this hidden mark as the Unicode replacement character 0xfffd, which invalidates the XML prolog.

Resolution

To resolve this issue, you must strip the Byte Order Mark from the OVF descriptor and address the resulting manifest mismatch.

Step 1: Fix the OVF Encoding

  1. Locate the original source .ovf file.
  2. Open the file using a code editor that supports encoding management (e.g., Notepad++ or Visual Studio Code).
  3. In the editor's Encoding menu, select UTF-8 (specifically ensure it is not "UTF-8 with BOM").
  4. Save the file. This removes the hidden characters from the start of the document.

Step 2: Handle the Manifest (.mf) File

Modifying the .ovf file changes its cryptographic hash, which will cause a manifest mismatch error during the next import attempt. Choose one of the following options:

  • Option A (Recommended for speed): Delete the .mf file from the OVF bundle. vCenter will skip the checksum validation during import and deploy the template successfully.
  • Option B (Recommended for security): Recalculate the SHA-256 hash of the newly saved .ovf file (using Get-FileHash in PowerShell) and update the corresponding hash string inside the .mf file.

Step 3: Re-import to Content Library

  1. Delete the existing failed template from the Content Library.
  2. Upload the corrected .ovf (and updated .mf, if applicable) along with the VMDK files to the Content Library.
  3. Deploy the VM from the newly imported template.

Additional Information

Steps to edit an OVF file after exporting a Virtual Machine to a OVF template