How to Connect to a Virtualbox VM Via SSH (Part 1)

In some previous posts, you learned how to setup a Virtualbox virtual machine (VM) for the purpose of creating a test server environment. Once you have a functioning test server, you are free to always work on it within the virtual machine, but if you ever want to connect to it remotely, you probably soon realized there was a problem. By default, your VM will be unreachable on the network. Fortunately, fixing this issue only takes a few steps.

First you need to make sure SSH is in fact installed and running on the VM’s operating system. If you are using CentOS, for example, type:

# service sshd status

It should say something like:

openssh-daemon (pid 2009) is running…

If it is says it cannot find that service, you need to install it with:

# yum install openssh

Then, to start it, type:

# service sshd start

In the next part, you will learn how to configure Virtualbox to connect to SSH or any service you want.