Skip to content

Instantly share code, notes, and snippets.

@sambatyon
Forked from wacko/gist:5577187
Last active March 19, 2018 01:44
Show Gist options
  • Save sambatyon/3bbd8d5f81b65398c0d0 to your computer and use it in GitHub Desktop.
Save sambatyon/3bbd8d5f81b65398c0d0 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 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

sources:

On CentOS (guest):

  • Install OpenSSH server ``
  • Update file /etc/sysconfig/network-scripts/ifcfg-eth1 to:
DEVICE=eth1 
BOOTPROTO=none 
ONBOOT=yes 
NETWORK=10.141.141.0 
NETMASK=255.255.255.0 
IPADDR=10.141.141.27 
USERCTL=no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment