What is the VM file format?
.vm files contain Apache Velocity templates - server-side text templates written in the Velocity Template Language (VTL). Velocity is a Java-based templating engine maintained by the Apache Software Foundation; .vm is its default template file extension.
A Velocity template mixes static output content (HTML, XML, SQL, or plain text) with VTL directives and variable references resolved at runtime against a Java context object. Core VTL constructs include:
$variableor${variable}- output a value from the context,#set( $x = 'value' )- assign a variable,#if/#else/#end- conditional output blocks,#foreach( $item in $list )- iteration,#macro- define reusable template fragments,#parse/#include- embed other.vmfiles.
Velocity is used in legacy Java web applications, code generators, email templating systems, and Apache Maven archetypes. The engine requires Java 8 or later (Velocity 2.x); the last 1.x release was Velocity 1.7 in 2010.
Note: the .vm extension is also used by VMware for virtual machine memory and configuration files - a completely unrelated and more commonly encountered use. When a .vm file is found on a system with VMware installed, it almost certainly belongs to VMware, not Velocity.
Modern alternatives to Velocity include FreeMarker (Apache), Thymeleaf, and Mustache.
Security & safety
RISK: LOWPlain text file; no executable on its own. In a Java application, Velocity templates can call arbitrary Java methods available in the context, so malicious .vm files in a server application could cause server-side injection if untrusted input reaches the engine. Not a risk for end users opening in a text editor.
Format details
in a nutshell- VMware Virtual Machine Configuration - VMware Workstation and VMware Player use .vm as one of several virtual machine component file extensions; unrelated to templating.
- ScummVM Save Game - ScummVM adventure game emulator uses .vm for save state files in some game engines.
Programs that open VM files
Technical details
deep spec| Developer | Apache Software Foundation |
| Runtime requirement | Java 8 or later (Velocity Engine 2.x); last 1.x release was Velocity 1.7 in 2010 |
| File type | Plain-text server-side Velocity Template Language (VTL) template |
| Encoding | UTF-8 by default; configurable via `input.encoding` in `velocity.properties` |
| Typical file size | 1 KB - 200 KB |
| Variable syntax | `$variable` or `${variable}` - values resolved from a Java Velocity context object at runtime |
| Directive prefix | `#` - built-in directives: `#set`, `#if`/`#else`/`#end`, `#foreach`, `#macro`, `#parse`, `#include` |
| Template inclusion | `#parse` embeds and evaluates another `.vm` file; `#include` inserts it as raw unprocessed text |
| Common use cases | Java web application views, code generators, email templates, Apache Maven project archetypes |
| Extension conflict | `.vm` is also used by VMware for virtual machine memory and configuration files - unrelated and more prevalent |
| Notable alternatives | Apache FreeMarker (.ftl), Thymeleaf (.html templates), Mustache (.mustache) |
| Output formats | Any text-based format: HTML, XML, SQL, plain text, or source code - Velocity is output-format-agnostic |
| Released | 1999 (Velocity originally from Apache Jakarta project) |
| Latest version | Apache Velocity Engine 2.4 (2023) |
| Open standard | Yes · royalty-free |
| Specification | velocity.apache.org |
VM conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about VM files.