Untested first attempt at generateVMWrapper().