Recently, I wanted to have connect to the Kali guest machine running inside VirtualBox from my Windows 10 host machine.
I had already set up the
Nat Network in the VirtualBox but also connected with a VirtualBox
Host-Only Adapter to connect to the guest machine via SSH.
However, after logging on the guest machine, I noticed Kali (and Debian in general) only configures one interface usually eth0 by default which was only in use by the Nat Network . So the last option was to enable my eth1 interface for the Host-Only Adapter.
I just had to add the following lines in Debian virtual machine's
allow-hotplug eth1iface eth1 inet dhcp
The second line instructs the interface to obtain an IP via DHCP. The first line loads the interface at boot time.
To apply the changes to a running system, invoke:
The name for the
eth1 interface may vary, use
ifconfig -a to list all available interfaces.
# This file describes the network interfaces available on your system# and how to activate them. For more information, see interfaces(5).# The loopback network interfaceauto loiface lo inet loopback# The primary network interfaceallow-hotplug eth0iface eth0 inet dhcpallow-hotplug eth1iface eth1 inet dhcp
Thanks to https://unix.stackexchange.com/a/37227 I could resolve the issue very easily.