In my case both system run Linux, although different distributions. The solution is pretty simple:
- create a “host-only” network interface in VirtualBox
- assign it to the virtual machine
More detailed instructions can be found on superuser.com by user rofrol. I had to do one more step and add a matching network configuration on the host system:

Happy developing! 😊