VirtualBox Basics

Synopsis

VirtualBox is an open-source virtualization software that allows users to run multiple operating systems simultaneously on a single physical machine. It’s an essential tool for developers, IT professionals, and enthusiasts who need to test software across different environments without additional hardware. This blog post will provide an overview of VirtualBox, instructions for installation and setup, a practical use case, and guidance on the next steps.

What is VirtualBox

VirtualBox is a cross-platform virtualization application developed by Oracle. It enables users to create and manage virtual machines (VMs) on their host systems, allowing multiple operating systems to run concurrently on the same hardware. VirtualBox supports various guest operating systems, including various versions of Windows, Linux, and macOS. Some of its features include snapshots, shared folders, and remote displays, making it a versatile and valuable tool for both professional and personal use.

Instructions: Installing and Setting Up VirtualBox

Step 1: Depending on which operating system you want to use, you’ll need to visit Microsoft for Windows 10/11 or Ubuntu for Linux and download the image.

Ubuntu

Microsoft

Step 2: Install VirtualBox. Visit the official website of VirtualBox

Select your host operating system: Choose the appropriate installer for Windows, Linux, or macOS.

Follow the website instructions and complete the installation. I would provide detailed notes, but due to potential changes based on updates things change all the time and I don’t want to misdirect you.

2.1 Create a network that will allow multiple VMs to talk with each other.

VirtualBox: File > Tools > Network Manager > NAT Network > Create > Name the network “VM2VM”

Make sure “Enable DHCP” is checked > Click Apply

This will allow VMs to be on the same network, where they will be assigned different IP addresses.

Step 3: Setting Up a Virtual Machine

3.1 Open VirtualBox and click “New” to create a new VM.

Name: Enter a name for your VM.

Folder: Select the folder where you would like to store your virtual machines.

ISO Image: Select the image that you downloaded. In this case we’re using Ubuntu.

Note: Check that the Type and Version match the operating system you’re installing.

Click “Next”

3.2 Add a username and password

Click “Next”

3.3 Adjust the amount of memory and processors for your VM

Base Memory: 8GB or lower/higher, depending on what your system can handle.

Processors: 2 or higher depending on what your system can handle.

Click “Next”

3.4 Create a Virtual Hard Disk:

Disk Size: 50GB “The size will depend on what you’re trying to accomplish. For this case, choose 50GB”

Click “Next”

Click “Finish”

This will start and create the VM.

Follow the prompts for the operating system you’re installing.

3.5 After the VM is done with the installation, update the operating system.

3.6 Configure the VM Network

Machine > Settings > Network > Adapter 1 > Attached to: NAT Network > Name: VM2VM

3.7 Install Guest Additions

Note: Prior to installing the guest additions, you need to adjust the display settings to prevent glitching.

VirtualBox > Settings > General > Display > Enable 3D Acceleration (Check the box)

VirtualBox > Device > Insert Guest Additions CD Image…

cd /media/ubuntu-a/VBox_GAs_7.0.14/

sudo ./VBoxLinuxAdditions.run


3.8 Enable Shared Clipboard

VirtualBox > Settings > General > Advanced > Shared Clipboard > Host To Guest

Now, your VM is set up and ready to go.

Use Case: Testing Software Across Different Operating Systems

VirtualBox is ideal for developers who need to test their applications across multiple operating systems. For example, a web developer can use VirtualBox to run Windows, Linux, and macOS VMs to ensure their website or application works consistently across all platforms.

Options:

Create multiple VMs: Set up separate VMs for each operating system.

Install the software: Deploy the software to be tested on each VM.

Conduct testing: Perform tests to check compatibility, functionality, and performance.

Use Snapshots: Take snapshots of each VM state to quickly revert to a previous configuration.

Conclusion

VirtualBox is an indispensable tool for anyone needing to run multiple operating systems on a single machine. Its versatility and powerful features make it suitable for a wide range of use cases, from software testing to running legacy applications. Following the installation and setup instructions, users can quickly get started with VirtualBox and explore its full potential.

References

VirtualBox