It really depends on how and what you’re virtualizing.
At least on my test rigs, docker’s bind-mount filesystems incur a 5-25% performance hit, CPU and I/O wise, compared to the host OS. Virtualbox will incur similar (or even worse) performance hits, depending on your CPU and BIOS config.
If you run Ubuntu Server in a VM, make sure you set up automatic security updates (this post might be helpful).
If you run Ubuntu Desktop in a VM, there will be a metric crapton of additional services that spin up. Those should be idle most of the time, but do chew up RAM, and some CPU. You should also be sure to set up automatic updates, as well.