> ## Documentation Index
> Fetch the complete documentation index at: https://kb.hosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Setting up a virtual machine with VirtualBox for local testing

> Discover how to test website configurations locally using VirtualBox to create virtual machines.

This article describes how to install and configure a virtual machine using [VirtualBox](https://www.virtualbox.org/), a popular virtualization application. VirtualBox runs on Windows, macOS, and Linux, and features an easy-to-use graphical user interface for creating and managing virtual machines.

## About virtual machines

Virtual machines emulate a computer—they enable you to install an entire operating system within an existing operating system. The virtual machine runs in its own "sandbox," safely isolated from the host operating system. Because of this isolation, virtual machines enable you to safely test new features, applications, and configurations without having to worry about harming your existing operating system.

By creating a virtual machine with a configuration that closely matches hosting.com servers, you can safely do testing and development work on your own computer before you roll out the changes to a live site.

## Installing VirtualBox

Before you can create a virtual machine, you must first install the VirtualBox application on your computer. To do this, follow the appropriate procedure for the operating system that is installed on your computer:

### VirtualBox on Windows

To install VirtualBox on a Windows-based computer, follow these steps:

1. On your local computer, use your web browser to go to [https://www.virtualbox.org/wiki/Downloads](https://www.virtualbox.org/wiki/Downloads).

2. Click **Windows hosts**, and then download the *.exe* file to your computer.

3. Run the *.exe* file to start the installation.

4. Click **Next**.

5. Follow the prompts to complete the installation.

### VirtualBox on macOS

To install VirtualBox on a macOS-based computer, follow these steps:

1. On your local computer, use your web browser to go to [https://www.virtualbox.org/wiki/Downloads](https://www.virtualbox.org/wiki/Downloads).

2. Click **OS X hosts**, and then download the *.dmg* file to your computer.

3. Double-click the *.dmg* file to start the installation.

4. Follow the prompts to complete the installation.

### Virtual Box on Linux

To install VirtualBox on a Linux-based computer, follow these steps:

1. On your local computer, use your web browser to go to [https://www.virtualbox.org/wiki/Downloads](https://www.virtualbox.org/wiki/Downloads).

2. Click **Linux distributions**.

3. Download the appropriate package file for the Linux distribution your computer uses.

4. Use your Linux distribution's package manager to install the package file.

## Creating a virtual machine and installing an operating system

At this point, you have installed the VirtualBox application on your computer, but you still need to create a virtual machine. To do this, you specify the virtual machine's settings, and then install an operating system on it.

The following procedures demonstrate how to create a new virtual machine and install AlmaLinux on it. Many hosting.com servers run AlmaLinux, so it is a good choice for your first virtual machine.

### Creating a new virtual machine

To create a new virtual machine, follow these steps:

1. Start VirtualBox.

2. On the **Machine** menu, click **New**.

3. In the **Name** text box, type `AlmaLinux`. VirtualBox should automatically detect AlmaLinux, and select **Linux** in the **Type** list box, and **AlmaLinux** in the **Version** list box.

4. Click **Next**.

5. In the **Memory Size** dialog box, select the amount of RAM you want to allocate to the virtual machine, and then click **Next**.
   > 📘 Note
   >
   > The more RAM your computer has, the more RAM you can safely allocate to the virtual machine. As a general rule, however, you should have at least 512 MB of free RAM to run a Linux virtual machine.

6. In the **Hard disk** dialog box, select **Create a virtual hard disk now**, and then click **Create**.

7. In the **Hard disk file type** dialog box, select **VDI (VirtualBox Disk Image)**, and then click **Next**.

8. In the **Storage on physical hard disk** dialog box, select **Dynamically allocated**, and then click **Next**.

9. In the **File location and size** dialog box, type a name for the virtual hard disk file, select the size of the hard disk, and then click **Create**.
   > 📘 Note
   >
   > The more disk space your computer has, the more space you can safely allocate to the virtual machine's hard disk. As a general rule, however, you should have at least 5 GB of free disk space for a Linux virtual machine.

### Installing an operating system

After you create the virtual machine, you are ready to install an operating system on it. To install AlmaLinux, follow these steps:

1. Use your web browser to go to [https://almalinux.org/get-almalinux/](https://almalinux.org/get-almalinux/).

2. Click **Minimal ISO**, and then save the *.iso* file to your local computer.

3. In VirtualBox, select the virtual machine you created in the previous procedure, and then click **Start**.

4. In the **Select start-up** disk dialog box, click the folder icon.

5. In the file selection dialog box, locate and select the *.iso* file you downloaded in step 2, and then click **Start**. VirtualBox boots the virtual machine using the *.iso* CD image file.

6. On the AlmaLinux installation page, select **Install AlmaLinux**.

7. On the **Welcome to AlmaLinux** page, select the language you want to use for the installation process, and then click **Continue**.

8. On the **Installation Summary** page, complete any items marked with the yellow triangular warning icon, and then click **Begin Installation**.
   > 👍 Tip
   >
   > During installation, you can (and should) set the root password and create a regular user.

9. Follow the remaining prompts to complete the installation.

10. After installation is complete, click **Reboot** to restart the virtual machine. You now have a fully-functioning AlmaLinux installation on your local computer.

## More information

For more information about VirtualBox, please visit [https://www.virtualbox.org](https://www.virtualbox.org).
