I am assuming you know how to access a MariaDB/MySQL server running in you local machine.
Hence, I assume you question is “How to access the “MariaDB server” running in a ERPNext VM?”
The ERPNext VM runs a standard MariaDB server on the standard port
3306 with default setting with respect to access control settings
The question then becomes two parts: (assuming you want to access the db server from a machine other than your VM)
a) how to enable Remote Client Access for MariaDB
b) how to access the port 3306 of your VM
Answer to (a):
Please follow this link.
Answer to (b):
It depends on your network Adapter settings of you VM in you VirutualBox.
Case 1: NAT - you need to add the 3306 port in “Port Forwarding” option.
Case 2: Bridged Adapter - you can access the port directly at the IP addressed of your VM
Note: This is the path I went down when I was exploring ERPNext a few weeks ago. Hope this is you requirement. Else, I guess it will help others going down the same path.