Here are two solutions:
When you create a virtual disk, you indicate the location of the virtual machine disk in the encrypted section.
Or you create ext4 under the foundation, encrypt it completely and put virtualbox there, if you script the software itself for you fundamentally.