[3.9] Improve VM build