ssh into my local ubuntu virtual machine I would like to ssh into an Ubuntu virtual machine running on Virtual Box on my machine; use Terminal to ssh into a virtual machine running in the same computer

To avoid "why are you doing that? do so and so" answers, here is why I need this: I need to write desktop automation testing that will run on Amazon EC2 but it is very hard to test due to the network delay caused by using VNC.
Make sure you are using Bridged Adaptor in the VirtualBox settings. User Pinhead reported that Promiscuous Mode should be set to Allow All.



In an Ubuntu Terminal window, enter the command below to see if the proper software is installed

sudo systemctl status ssh


If not, then use the commands below to install.

sudo apt update
sudo apt install openssh-server


If you do not know the ip address assigned to the Ubuntu virtual machine, then execute the following steps.


Open the Activities overview and start typing Network.
Click on Network to open the panel.
Click on the  symbol. You should see a image similar to the image shown below.


You can use either the IPv4 or IPv6 address.


In a macOS Terminal window, enter the command 

ssh &lt;username&gt;@&lt;ip address&gt;


For example, if using the username dma and either of the ip addresses from the above image, then both commands below would work.

ssh dma@192.168.0.115
ssh dma@2001:470:1f11:4a6:281d:ecf9:cd9e:76a8