In order to fully accomplish making a VM inside Ubuntu, I reccomend using something called "QEMU", which is the VM hypervisor itself. QEMU essentially does all the hard work, for a VM manager (something to look at your VMs with) I recommend Virtual Machine Manager (VMN)

If you want a in-depth guide on how to create a single-GPU accelerated setup, I reccomend this guide (for Ubuntu):

https://github.com/Andrew-Willms/GPU-Passthrough-On-Ubuntu-22.04.2-for-Beginners