Skip to main content

Section 3.4 Virtualization

In this section, we introduce several types of virtualization. You may run across these technologies while you are setting up a development environment to contribute to an open source project. The goal of this section is just one of familiarization with the terminology because a strong open source community that is welcoming to new contributors will have a README file that you can follow that will help you to get set up.

Subsection 3.4.1 The What and Why of Virtualization

Virtualization is a technique that allows for one or more virtual (or simulated) environments to run on a given physical hardware system. Virtualization refers to the creation of virtual versions of system resources, such as operating systems, CPU cores, memory, storage devices, etc. In a virtualized system, each virtualized environment shares the actual system resources while operating as if it has dedicated resources such as memory, processing power, and storage. In part, because we can create just the right environment for a given application without running into conflicts when different applications have conflicting requirements, virtualization can provide cost-savings, flexibility, and increased efficiency.
You may encounter an open source community that uses some of these virtualization techniques because doing so provides benefits to them, perhaps the most important of which is portability. VM images and container images, for example, can typically be easily moved between different environments, making it easier to develop and test software in a consistent environment.

Subsection 3.4.2 Virtual Machines

A virtual machine (VM) is a simulation of a physical computer that runs its own operating system and applications as if it were a completely separate physical computer. VMs rely on a hypervisor (aka a virtualizer) which is a type of computer software, firmware or hardware that creates and runs virtual machines. When using a VM, the physical computer is called the host machine and the virtual machine is called the guest machine. Virtual machines are managed by a software component called a hypervisor which makes sure that each virtual machine gets the needed resources without interfering with any real or other virtual systems.
If you are running an older version of Windows that does not support WSL2, and you are planning to set-up a development environment, then you are advised to use a VM running Ubuntu Linux. In the absence of other recommendations, VirtualBox 1  is a very well-respected and popular open source multi-platform VM environment, so if you are running an older version of Windows, VirtualBox is a recommended VM.

Subsection 3.4.3 Containerization

A container leverages virtualization at the level of the operating system where every application is provided with its own view of the operating system. Containerization packages an application and its dependencies into a single self-contained unit called a container image, which can be run on almost any host machine with the appropriate software.
Containers are lightweight and fast because they share the host machine’s operating system and do not require their own operating system to be installed like VMs do. This makes containers highly portable, as well as easier to manage and deploy.
Some key concepts behind of containerization are:
  • Standardization: Containers provide a standard way to package and distribute applications, making it easier for open source projects to share and reuse code.
  • Isolation: Containers provide a way to isolate applications and their dependencies from the host operating system, which reduces the risk of software conflicts.
  • Portability: Containers are designed to be portable, which means they can be moved between different environments and different systems without modification.
  • Reproducibility: Containers make it easier to consistently recreate an environment and ensure that an application behaves the same way in development, testing, and production environments.
If you are following a README and you are asked to do any of the following installations, then you will be installing a containerized environment: Docker 2 , Containerd 3 , CRI-O 4 >, LXC (Linux Container) 5 >, Podman 6 , rkt (Rocket) 7 . Don’t panic! The containerization should ultimately make it easier to set up the environment.

Checkpoint 3.4.1.

    Which of the following statements is true regarding the benefits of containerization in open-source projects?
  • Containers offer a shared virtual environment for all applications, promoting better collaboration and resource utilization by eliminating the need for individual dedicated environments.
  • Containers provide isolated environments for applications, not a shared virtual environment. Each container has its own isolated space, which prevents interference between applications.
  • The consistent operating system requirement for container images ensures a more stable and secure runtime environment, reducing the risk of unexpected behavior.
  • Containers do not require a consistent operating system; they share the host machine’s OS. However, containerization can still lead to a more stable and secure runtime environment due to isolation and standardization.
  • Containerization simplifies the development and testing of software by offering a consistent environment across different systems.
  • One of the benefits of containerization is that containers provide a consistent environment, which simplifies software development and testing across different systems.
  • Containers are especially suitable for running large-scale applications due to their lightweight nature, making them a cost-effective choice for complex projects.
  • While containers are indeed known for their lightweight nature and portability, their suitability for running large-scale applications is not their primary advantage.
You have attempted of activities on this page.