Download the PSUtils for Windows if you are using:
This is changind nic1 of the vm as hostonly interface
.\PsExec64.exe -s "c:\program files\oracle\virtualbox\vboxmanage" modifyvm master --nic1 hostonly --hostonlyadapter1 "VirtualBox Host-Only Ethernet Adapter"