Virtual Machines

Published

2024-08-30

Caution

This section is being revised. Thank you for your patience.

Virtual machines (VMs) offer a flexible way to run Linux environments on top of your existing operating system, regardless of whether it’s Windows, macOS, or another Linux distribution. This chapter explores the setup process for virtual machines, highlighting popular VM software like VirtualBox and VMware.

Virtualization Software

Setting up Linux on virtual machines (VMs) is a valuable technique for running different operating systems on a single physical machine, which is helpful for development, testing, server deployment, and more. Several virtualization tools are available, but the most popular ones include:


VirtualBox

VirtualBox is an open-source option that provides a good balance of features and simplicity. It runs on Windows, Linux, and macOS and supports numerous Linux distributions and Linux variants.

VMware Workstation

VMware Workstation is a commercial product that supports a wide range of guest operating systems, from the latest Windows and Linux distributions to older versions, ensuring compatibility across various applications and testing scenarios.

VMware Fusion

VMware Fusion is tailored for macOS, allowing Mac users to run Windows, Linux, and other operating systems as virtual machines without rebooting. It integrates well with macOS, including support for Touch Bar and Retina display optimizations.

Parallels Desktop

Parallels Desktop is a commercial product predominantly used on macOS. Parallels is known for its high performance and seamless integration with the host OS, making it easy to run Linux alongside macOS.

Linux Distributions

Download the ISO file for the Linux or Linux distribution you want to install. Popular Linux distributions include Ubuntu, Fedora, and CentOS. For a more Linux-like experience, consider FreeBSD or OpenBSD. Each distribution has its unique characteristics, making them suitable for different types of users and use cases:


Ubuntu

User-Friendliness: Ubuntu is widely recognized for its user-friendliness and ease of use, making it a popular choice for those new to Linux. The default desktop environment, GNOME (formerly Unity), provides a clean and functional interface.

Software Availability: Ubuntu has vast software repositories that ensure easy software installation through the Ubuntu Software Center and advanced package management with APT and snap packages. This extensive support makes it ideal for users who need access to a wide variety of applications.

Regular Releases: Ubuntu follows a predictable release cycle, with new versions released every six months and Long-Term Support (LTS) releases every two years. LTS versions are supported for five years, providing stability and security, which is crucial for enterprise environments.

Community and Support: Ubuntu benefits from a strong community and professional support from Canonical, offering extensive documentation, active forums, and commercial support options.

Fedora

Cutting-Edge Technology: Fedora is known for its commitment to innovation and features cutting-edge technology, making it an excellent choice for software developers and community members who want to work with the latest advancements in free and open source software.

RPM Package Management: It uses the RPM package manager, with a front-end tool called DNF, which provides powerful package management capabilities. Fedora is also known for its robust updates and upgrade process.

Security Features: Fedora includes strong security features by default, like SELinux, which provides robust access control mechanisms. Fedora’s emphasis on security makes it a favorable option for security-conscious users.

Fedora Spins: The availability of different “spins” provides versions of Fedora with various desktop environments, such as KDE, XFCE, LXQT, Mate, Cinnamon, and more, catering to personal preferences for different desktop experiences.

CentOS

Enterprise-Level Stability: CentOS is a community-supported distribution derived from the sources of Red Hat Enterprise Linux (RHEL). This origin ensures that CentOS is not only stable and reliable but also benefits from enterprise-level testing and patches, making it ideal for servers and enterprise environments.

Long-Term Support: CentOS releases are supported for up to 10 years, making it a stable platform for long-term projects in corporate settings where long support cycles are crucial.

No-Cost: While providing an enterprise-grade operating system, CentOS is completely free, which reduces the total cost of ownership for businesses and developers who need a reliable, stable environment without the expense of a commercial license.

Binary Compatibility with RHEL: Being binary compatible with RHEL means that software applications developed for RHEL can run seamlessly on CentOS, which is particularly important for ensuring the broad compatibility of software and services in professional environments.

VirtualBox & Ubuntu

In this section we’ll cover how to setup VirtualBox and Ubuntu. We’ll download VirtualBox, select a Linux distribution, configuring the hardware and storage, and launch the virtual machine.

Download

Download and install VirtualBox from their website. I’m using macOS, so it’s a VirtualBox-7.0.20-163906-OSX.dmg file:

Figure 2.1: Double-click the VirtualBox.pkg file to install

After installing VirtualBox, download a Linux distribution (I’m using Ubuntu). I saved this .iso file in the same folder as the VirtualBox file:

/Applications/VirtualBox/
├── VirtualBox-7.0.20-163906-OSX.dmg
└── ubuntu-24.04-desktop-amd64.iso

1 directory, 2 files

Click New in the VirtualBox manager and name the Virtual Machine and Operating System:

Figure 2.2: New Virtual Machine on VirtualBox

Create

Create the new ISO image be adding the path to the downloaded Ubuntu file (ubuntu-24.04-desktop-amd64.iso).

Figure 2.3: Creating new Ubuntu ISO image

Click the Skip Unattended Installation checkbox and Next.

Configure

In this window we’ll configure the Ubuntu image. I’ve chosen to allocate 1/4 of the memory and processors on my machine to the image, but you can experiment with both settings to find the best configuration that fits your needs.

Figure 2.4: Configure base memory and processors on Ubuntu ISO image

In the next window we’ll set the storage for this image (I’ve left the default).

Figure 2.5: Configure hard disk on Ubuntu ISO image

The final window is a summary of our new virtual machine.

Figure 2.6: Ubuntu ISO image Summary

Click Finish to create the image.

Launch

Back in the VirtualBox Manager, we can run this new virtual machine by clicking Start.

Figure 2.7: Start virtual machine

After clicking Start, a new window will open and attempt to start the virtual machine. Use the arrow keys to select Try or Install Ubuntu:

Figure 2.8: Try or Install Ubuntu

Finish the installation steps for Ubuntu for your liking.

Figure 2.9: Complete Ubuntu Installation

Creating virtual machines is an essential skill for those experimenting with Linux systems in an isolated environment.

Recap

This chapter covered virtual machines and Linux distributions. Specifically, we discussed:

  1. Setting up Linux on virtual machines, highlighting the process and popular virtualization software options.
    • Open-source option: VirtualBox
    • Commercial options: VMware Workstation, VMware Fusion, and Parallels Desktop
  2. The key features of three major Linux distributions:
    • Ubuntu: known for its user-friendliness
    • Fedora: recognized for its cutting-edge technology
    • CentOS: valued for its enterprise-level stability

Each of these distributions brings its strengths and is tailored to different segments of the Linux user base, from desktop users and hobbyists to developers and enterprise clients.

See a typo, error, or something missing?

Please open an issue on GitHub.