Skip to content

Instantly share code, notes, and snippets.

@nhandler
Created May 20, 2014 21:41
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 nhandler/20953a17b4b10a7917d0 to your computer and use it in GitHub Desktop.
Save nhandler/20953a17b4b10a7917d0 to your computer and use it in GitHub Desktop.
Configure SSH Access to VirtualBox Linux Guest Virtual Machine
To give your user sudo access:
usermod -a -G sudo YOURUSER (as root)
You will need to logout and then log back in for this change to start working
You can install the SSH server with:
sudo apt-get install openssh-server
In your Linux Guest VM:
Edit /etc/network/interfaces (as root)
Append these lines to the end of the file:
auto eth1
iface eth1 inet static
address 192.168.56.10
network 255.255.255.0
Shutdown the Virtual Machine
VirtualBox->Preferences->Network->Host-Only Networks
Click the Plus icon to add a vboxnet0 network and then hit OK
Open your Virtual Machine’s ‘Settings’ and click ‘Network’
Click on ‘Adapter 2’ and check ‘Enable Network Adapter’
Set ‘Attached to’ to ‘Host-only Adapter’ and the name should be set to ‘vboxnet0’
Click ‘OK’
If you start up the Virtual Machine, the SSH server should automatically start running.
From a terminal on your Mac, you can now type
ssh YOURUSER@192.168.56.10
You should get prompted for your password and then have a functional SSH connection to your Virtual Machine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment