This is Tharun here. Most of us would have struggled to SSH into a VirtualBox Machine. In this article, I introduce to you what Virtual Box is and how you can SSH into it from your local machine.
The VirtualBox is a software that can be used to run multiple operating systems on your own operating system and effortlessly switch between them, create snapshots, delete them, restore them on the fly.
We all have wondered if we had an easier way to access our VirtualBox Machines. In this tutorial, we will look at how you can SSH into your VirtualBox machine. This will prevent you to have to open your VirtualBox GUI to do everything. (duh!)
You can either click on the Settings icon, or you can right-click on a Virtual Machine and select the Settings option
Based on which Adapter is free on your virtual machine. Enable the Network Adapter. Select the NAT network.
Open the Advanced options and click on Port Forwarding. Leave other settings as default.
Click on the + icon on the top-right corner to add a new rule.
Host Port: 3022
Guest Port: 22
Leave others empty
What we're telling here is, basically forward all connections to the port 3022 on host machine to the port 22 on the guest machine. If you didn't know, SSH uses port 2
Open your terminal and type
~$ ssh -p 3022 <username>@127.0.0.1
~$ ssh -p 3022 email@example.com
Enter the Password of your that you are logging into and we're done
Hope this article helped. Give this article a like, unicorn, and save it for later. Share it with your friends and let them know this useful trick.
Next article on how you can run a VirtualBox without running it's GUI. So combining SSH access and no-GUI, VirtualBox made convenient.
My Blog: https://www.tharunshiv.com