Skip to content

Instantly share code, notes, and snippets.

@firstrow
Forked from wacko/gist:5577187
Last active June 10, 2017 08:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save firstrow/392bce9ea8c00d3634479f5798ed958b to your computer and use it in GitHub Desktop.
Save firstrow/392bce9ea8c00d3634479f5798ed958b to your computer and use it in GitHub Desktop.
SSH between Mac OS X host and Virtual Box guest

On Mac OS (host):

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 1 > Bridged Adapter VM's Settings > Network > Adapter 2 > host-only vboxnet0

On Ubuntu (guest):

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

Note that eth0 might have other name like enp0s8. Run ifconfig -a to get available names.

sources:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment