vm: assign Environment to created context

fixes #7511