A habit worth building in a lab long before you ever need it: collect the most volatile evidence first, because it disappears first.
Rough order of volatility:
- CPU registers and caches (in practice you cannot get these),
- memory contents,
- network state: connections, routes, ARP cache,
- running processes,
- disk contents,
- remote logs and backups.
For a Linux VM that you set up and "compromised" yourself (plant a harmless cron entry or a stray listening process), practise this:
date -u; uname -a
ps auxww
ss -tupan
ip addr; ip route
Write the output to external storage, not the disk you are examining, and hash everything you collect. Note the time, who ran what, and why, in a plain text log. That log is your chain of custody, and it matters even in a lab because it builds the habit.
What not to do: reboot "to see if it helps". You just destroyed memory, the process list and half the story.