To perform a noninteractive installation of you can use the command line version of the installer application.
Mount the dmg disk image file, as described in the installation procedure, or use the following command line:
hdiutil attach /path/to/VirtualBox-xyz.dmg
Open a terminal session and run the following command:
sudo installer -pkg /Volumes/VirtualBox/VirtualBox.pkg -target /Volumes/Macintosh\ HD