I have created a VirtualBox VM, which is running Debian 9 as the guest OS, and it can connect to the internet successfully using the default NAT network interface.

We also need the web server and ssh server in the VM to be accessible from the host computer OS (Windows 10, if relevant), but not from the internet at large. When another colleague asked me to set up a similar VM some time ago (but with Debian 8 and Windows 7, respectively), after much experimentation, it seemed that creating an additional Host-only Adapter in the guest OS, and updating the hosts file on the host OS to map the hostname set up in the VM guest OS to its (private) IP address "just worked".

However, I don't seem to be having similar success with Debian 9, perhaps because the way that networking is now set up seems to have changed?

The NAT interface appears as enp0s3 with private IP, and it can connect to the internet, but a web browser or ssh on the host OS cannot see this address.

If I shutdown the VM and add an additional Host-only network adapter, when I reboot the VM, I now have an additional interface called enp0s8, but it is "down" and does not have an IP address associated with it.

Do I need to do something else to set up this interface, or is VirtualBox supposed to take care of it?


A Host only network in VirtualBox parlance, is a interface for talking the VM to talk with the host machine. (e.g. an internal/isolated network).

As such, it won't get an IP address alone. One of the possibilities is defining a network manually with static IP addresses, that is not used in your internal network, such as 192.168.x.1/30 for the host side, and 192.168.x.2/30 for the VM side.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.