Skip to content

Instantly share code, notes, and snippets.

@coisme
Last active December 14, 2018 02:30
Show Gist options
  • Save coisme/72556f8f24a46fee846e4a2f97e60a85 to your computer and use it in GitHub Desktop.
Save coisme/72556f8f24a46fee846e4a2f97e60a85 to your computer and use it in GitHub Desktop.
Setting up Ubuntu 18.04 LTS on VirtualBox and connect it from the host OS

Setting up Ubuntu 18.04 LTS on VirtualBox and connect it from the host OS.

Install Ubuntu into VirtualBox

Download .iso from https://www.ubuntu.com/#download and install it.

Install SSH server

On Ubuntu terminal, run this command and install SSH serer.

$ sudo apt-get install openssh-server

Set port forwarding

On VirtualBox, Setting > Network > Adapter1 > Advanced > Port Forwarding

Name Protocol Host IP Host Port Guest IP Guest Port
SSH TCP 3022 22

Turn off GUI (optional)

You can turn off GUI.

$ systemctl set-default multi-user.target

Connect

After launch Ubuntu, run the command on your host OS:

ssh -p 3022 username@127.0.0.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment