There are different manners to access your Mininet located in a VM such as VirtualBox. Maybe, the simplest method to access it trough SSH is configuring VM interfaces to bridge mode. However, there is other approach such as below (in our example, the VM name is Mininet and the VM image should not be running):
1. Open up your VirtualBox by clicking on Settings and check Enable Network Adapter. Attached to: NAT. Adapter type: PCnet-FAST III (Am79C973). Check Cable Connected.
2. Go to VirtualBox directory where your VM (Mininet directory) is located via bash terminal.
3. Enter the following commands:
$ VBoxManage setextradata "Mininet" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol" TCP $ VBoxManage setextradata "Mininet" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort" 22 $ VBoxManage setextradata "Mininet” "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort" 2222
To access, start your Mininet VM and open up your terminal and put:
$ ssh -Y -l -p 2222 localhost