Shutdown your VM and do:
VirtualBox > Settings > Network > Add (you will get vboxnet0
)
On a terminal ifconfig
will show you new interface vboxnet0
VM's Settings > System > check "Enable I/O APIC." VM's Settings > Network > Adapter 2 > host-only vboxnet0
Install OpenSSH Server
Edit /etc/network/interfaces
file to append the following lines:
auto eth1
iface eth1 inet static
address 192.168.56.10
netmask 255.255.255.0
Run sudo ifup eth1
from the Ubuntu command line.
SSH server should be up and running. Switch to your host terminal and enter ssh 192.168.56.10
sources:
If anyone else has the error
cannot find device eth1
, check your ifconfig output and see what is the name of the interface.According to this answer, it may not always be
eth1
. And in my case (VirtualBox 5.1.14), the interface is namedenp0s8
.So just follow the steps in the gist but replace
eth1
withenp0s8
. And I can ssh to my VM now!