Question: how to transfer files from mac to ubuntu virtualbox?
Answer: With the Virtual Machine powered off and selected in VirtualBox, go to: Machine > Settings ... > ... 
For “Folder Path”, click the icon to browse for the folder you want to share.
For “Folder Name”, enter a name to describe the share.
Click “OK” and start the virtual machine again.