Connecting to Your Virtual Machine
After installing Oracle VirtualBox on your host laptop (running macOS, Windows, or Linux) and creating a VM using a CentOS image, you have two primary options to start the VM:- Normal Mode – Displays the VM console as if it were a physical machine.
- Headless Mode – Runs the VM without opening a console window, enabling remote access via SSH or remote desktop tools.
Normal Mode Explained
When you start your VM in normal mode, you see the console on your screen. For instance, if the VM image includes a Linux graphical interface, you can interact with its GUI directly. The following log snippet illustrates a VM booting in normal mode:Headless Mode: A More Efficient Approach
Headless mode starts your VM without a console window. This allows you to access it remotely using SSH (for Linux VMs like CentOS) or remote desktop tools (for Windows VMs). The image below demonstrates the Oracle VM VirtualBox Manager displaying options to save, shut down, or power off a VM named “my-centos”:
Enabling and Verifying Remote Access
To treat your VM as a separate machine on a network, ensure the following:- Each VM has a configured IP address.
- Essential services (e.g., the SSH server for Linux or Remote Desktop Service for Windows) are installed and running.
Checking the VM’s IP Address
Before connecting via SSH, ensure that your VM is assigned a valid IP address. Use this command to list all network interfaces and their corresponding IP addresses:Note: Starting SSH Service If the SSH service is not already running, start it with:Once the VM has a valid IP address and the SSH daemon is running, you can easily connect from your host system by running:
Remote Access: Multiple Platforms
The following image demonstrates a laptop running macOS hosting both CentOS and Windows virtual machines. These VMs can be accessed via Terminal (for CentOS), PuTTY (for Windows on non-macOS systems), and Remote Desktop: