If the VMX code is highly generic (makes few assumptions about the execution environment) the translation can be relatively straightforward.
In some cases it is possible to port existing VMX code directly.