Yes you are right we need to disable the SIP before the installation and then enable it back:
here you can find the steps:
Disable System Integrity Protection (SIP)
Yes, yes, I also hate this, but has to be done until Apple refreshes the list of allowed Kernel Extensions to allow
VBoxDrv.kext to load properly in Mojave.
- Reboot your Mac and hold Command + R (⌘ + R) before it boots.
- Keep holding it until you see the progress bar
- Wait for it to finish
- At the top menu, select Utilities -> Terminal
- Press Enter
After this is solved, do the same steps to re-enable SIP, but type
csrutil enable at Step 5.
For more info check this https://silvae86.github.io/sysadmin/mojave/beta/vagrant/virtualbox/osx/macos/2018/07/10/running-vagrant-and-virtualbox-in-mojave-public-beta