Enable eth1 interface in Kali Linux

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 VirtualBoxHost-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.

Solution:

I just had to add the following lines in Debian virtual machine's /etc/network/interfaces file:

allow-hotplug eth1
iface 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:

ifup eth1

The name for the eth1 interface may vary, use ifconfig -a to list all available interfaces.

EDIT: full /etc/network/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 interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp
allow-hotplug eth1
iface eth1 inet dhcp

Thanks to https://unix.stackexchange.com/a/37227 I could resolve the issue very easily.