How to Install a virtual machine

To run Linux under Windows you have to create a virtual machine (VM) using a virtualization tool as VMware, QEMU, or VirtualBox. This page explains how to create a VM using VirtualBox. This operation can be simplified using Vagrant, an application that automatically creates a virtual machine from a small configuration file, called Vagrantfile.

The steps to follow are listed below:


  1. Install Vagrant from: https://www.vagrantup.com/
  2. Install VirtualBox from: https://www.virtualbox.org/
  3. Dowload the Vagrantfile from this link
  4. In Windows, open the Download folder aand create a folder named Allegro
  5. Copy the Vagrantfile into the Allegro folder. The file name must be Vagrantfile (no extension), so you have to remove the extension (.txt) from the file name.
  6. From the Start menu of Windows, type CMD and open the Command Prompt as administrator (click on "Run as administrator" on the right panel).
  7. From the Command Promt window, type the following commands and wait for the installation:
    > cd %HOMEPATH%
    > cd Downloads
    > cd Allegro
    > vagrant up --provider=virtualbox
  8. The VM is ready and you can launch it from Virtualbox application.

If you experience a problem running the VM in VirtualBox, disable windows Hyper-V system, following this guide:
https://docs.microsoft.com/it-it/troubleshoot/windows-client/application-management/virtualization-apps-not-work-with-hyper-v

If you are using Virtualbox on Windows 11 and experience problems like kernel panic at boot, increase the CPU core value to 2 in VM settings.

When the configuration is terminated, you will find Ubuntu with the ggc compiler, a development environment (Visual Studio Editor) and the Allegro 4.4 library.

To enter the virtual machine use:
username: vagrant
password: vagrant


Download a preinstalled virtual machine

If the installation using Vagrant does not work properly, you can install a pre-configured VM, called AllegroVM2021.ova, as follows:

  • Download the AllegroVM2021.ova file from this link.
  • Once the download is complete, move the .ova file in the "VirtualBox VMs" folder (C:\Users\USERNAME\VirtualBox VMs).
  • Open VirtualBox and select File->Import Appliance
  • Select the file AllegroVM2021.ova in C:\Users\USERNAME\VirtualBox VMs

    Now VirtualBox can see AllegroVM2021, so you can activate it by clicking on the Start button (green arrow) on the top menu.

    To enter the virtual machine use:
    username: vagrant
    password: vagrant

    The same password must be used to enter the superuser mode to run programs using real-time schedulers (typing the command: sudo su).

    If you are using Virtualbox on Windows 11 and experience problems like kernel panic at boot, increase the CPU core value to 2 in VM settings.


    How to Share Folders

    To share files between Windows and the Linux Virtual Machine (VM):
  • Open the VM
  • From the top menu, select: Device -> Drag and Drop -> Bidirectional

    In this way, you can transfer files from any Windows folder into the VM Desktop and viceversa by drag and drop operations with the mouse. Then, you can move the files from the VM Desktop into any other Linux folder.

    IMPORTANT NOTE: Executable files imported from a different VM may not work, so they need to be recompiled to be executed. Hence, make sure to remove all executable and object files (e.g., using make clean) before recompiling them.



    If you have any problem, please write to Igor Barsanti (Email: igor.barsanti@gmail.com)