I really like Alpine for making vm images. It is extremely easy to make the VM only run in memory or in data disk mode where the code is in ram but the files are persisted to disk with snapshots
https://wiki.alpinelinux.org/wiki/Installation#Diskless_Mode