# Setting up a virtual machine with VirtualBox for local testing

> Install VirtualBox and create an AlmaLinux virtual machine on your computer to test website setups safely.

Source: https://helpcenter.ruachost.com/developers/web-development/setting-up-a-virtual-machine-with-virtualbox-for-local-testing/

Virtual machines allow you to safely test website configurations in a controlled environment on your local computer. VirtualBox is a popular virtualization application that runs on Windows, macOS, and Linux and provides a user-friendly interface for creating and managing virtual machines.

### About Virtual Machines

Virtual machines emulate a computer, letting you install an entire operating system within your existing OS. They run in an isolated environment, enabling you to test new features, applications, and configurations without affecting your main system.

By creating a virtual machine that mirrors ruachost.com servers, you can safely develop and test websites locally before deploying them live.

### Installing VirtualBox

#### Windows

1. Go to [VirtualBox Downloads](https://www.virtualbox.org/wiki/Downloads).
2. Click **Windows hosts** and download the `.exe` file.
3. Run the file and follow the installation prompts.

#### macOS

1. Go to [VirtualBox Downloads](https://www.virtualbox.org/wiki/Downloads).
2. Click **OS X hosts** and download the `.dmg` file.
3. Double-click the `.dmg` file and follow the installation prompts.

#### Linux

1. Go to [VirtualBox Downloads](https://www.virtualbox.org/wiki/Downloads).
2. Click **Linux distributions** and download the package for your distribution.
3. Use your package manager to install the downloaded package.

### Creating a Virtual Machine and Installing an Operating System

#### Creating a New Virtual Machine

1. Start VirtualBox and click **New** in the Machine menu.
2. Enter **AlmaLinux** as the name. VirtualBox should automatically select **Linux** for Type and **AlmaLinux** for Version.
3. Click **Next**.
4. Allocate RAM to the virtual machine and click **Next**.\
   *Tip: Allocate at least 512 MB of RAM.*
5. In the Hard disk dialog, select **Create a virtual hard disk now**, then click **Create**.
6. Select **VDI (VirtualBox Disk Image)**, click **Next**.
7. Choose **Dynamically allocated**, click **Next**.
8. Specify the file location and size for the virtual hard disk, then click **Create**.\
   *Tip: Allocate at least 5 GB of disk space.*

#### Installing AlmaLinux

1. Download the AlmaLinux Minimal ISO from [AlmaLinux Downloads](https://almalinux.org/get-almalinux/).
2. In VirtualBox, select your virtual machine and click **Start**.
3. In the **Select start-up disk** dialog, click the folder icon and select the `.iso` file you downloaded, then click **Start**.
4. On the AlmaLinux installation page, select **Install AlmaLinux**.
5. Choose your language and click **Continue**.
6. Complete any items marked with a yellow warning icon on the **Installation Summary** page, then click **Begin Installation**.\
   *Tip: Set the root password and create a regular user during installation.*
7. After installation, click **Reboot** to start your virtual machine. You now have a fully functional AlmaLinux environment on your local computer.

### More Information

For additional guidance on VirtualBox, visit [https://www.virtualbox.org](https://www.virtualbox.org/).
