How to test Linux distributions in VirtualBox on Mac or Linux

0

VirtualBox is a free program from Oracle that lets you set up virtual machines to run any operating system inside another host operating system. It is available for macOS, Linux and Windows host operating systems. This means that you can run Linux distributions (distros) on your Mac to get acquainted with them before ever installing them directly on real hardware, or if you already run a Linux distro, but are curious of other distros, you may check them out without having to fuzz with partitioning your drive to dual boot. To get a decent experience, you should probably not run virtual machines on a machine with less than 4 GB RAM and a few gigs of disc space.

Distros might behave differently in VirtualBox than on real hardware, especially when it comes to visual effects in the desktop environment. This depends on your settings for 3D acceleration as well as how the distro deals with being run inside a virtual machine. Usually, most distros run a bit faster when installed directly on hardware than in virtual machines. Some distros even scale back on some of their animations and visual niceties when run in virtual machines to run faster, and deliver more bling when run on real hardware. The more well known distros all work fairly well in VirtualBox.

Getting it up and running

Before you get started, you need to install VirtualBox. If you are using macOS, download the program from the website. If you are using an Ubuntu based distribution (Ubuntu, elementaryOS, Peppermint Linux Mint…) you can install VirtualBox by opening a terminal and typing “sudo apt install VirtualBox” and typing your password and return. The next step is to download the DVD/USB image installer .iso file of the distro you want to try. Visit the projects website and download the one you want. Both 64 bit and 32 bit installers for X86 computers (AMD64, i386, i586 or i686) will work in VirtualBox, but 64 bit or AMD64 is the more common choice.

These are the steps involved in making a new virtual machine for the distro you want to test:

  1. Open the VirtualBox program and click “New” in the upper left corner.
  2. Make a name for your virtual machine. I usually just use the name of the distro I am testing. If the two pull down menus underneath the field for the name does not automatically change after you have written the name of the distro, you have to choose “Linux” in the “Type” menu. In the Version, choose “Ubuntu (64 bit)” if you are testing an Ubuntu-based distro, “Debian (64 bit)” if it is Debian based, “Arch (64 bit)” if it is Arch-based and so forth. You can use Distrowatch
    Name and operating system dialogue box
    Name and operating system dialogue box

    to look up what the distro is based on if you do not know. It is also possible to choose “Other”. Of course, if you have downloaded a 32 bit installer, you have to choose just the name of the distro, with “(64 bit)” at the end. Click “Next”

  3. The next step is to decide how much RAM your virtual machine will get. The slider goes from 0 to the amount of RAM you have installed, but the red part is reserved for the rest of the machine, so you can only allocate as much RAM as the green part of the line amounts to. Most distros will be happy with 2048 MB, but if you have more available, you might want to let your machine get 4096 MB to make it easier to run more programs at once. For light-weight distros like Lubuntu, LXLE or Peppermint, 1024 MB is more than enough, and for feather-weight distros like AntiX, Puppy Linux, Damns Small Linux and the like, 512 MB is plenty. It is possible to change this setting later if you regret, so do not worry. Click “Next”.
  4. The next dialogue asks if you want to “Create a virtual hard disk now”, “Do not add a virtual hard disk” or “Use an existing virtual hard disk file”. The default is “Create a virtual hard disk now”. This is what you want, so just click “Next”.
  5. Then you are asked what hard disk file type you want. The default “VDI” works fine. Click “Next”.
  6. You are now asked if you want a fixed size disk or a dynamically allocated one. The default is “Dynamically allocated”. This means that the disk image will not take any more room on your real disk than necessary, so it is a good choice. Click “Next”.
  7. The next window lets your change file location, name of the disk and size. There is really no need to change anything here except the size of the disk. If you think you are going to install a lot of software and work with large files, you might want to increase the size of the virtual drive, but for a period of normal testing without large amounts of files, I generally leave it as it is. Click “Next” when you have decided on the size of the drive.
  8. At this time, the window closes and you get back to the main window where your virtual machine is listed in the pane on the left and with settings displayed on the right. There are still some settings you have to change to get started. To do so, click “Settings” next to the “New” button on the top with your virtual machine selected.

    Choose the install media in this dialogue box
    Choose the install media in this dialogue box
  9. Click the “Storage” tab on the left. You are now presented with the virtual storage controllers and media. On top, you have an IDE controller with a CD symbol underneath. Click the CD symbol. The right side of the window now changes. Click the button with the CD symbol to the right of where it says “IDE secondary master” and choose the .iso installer file you downloaded for the distro you want to try. You will get to a standard open dialogue and can choose your file and click “Open”.
  10. Depending on which distro you have chosen, you might want to give the virtual machine 3D acceleration through a virtual GPU card. This is only really useful when running graphics intensive desktop environments like Gnome, Unity, Pantheon or KDE. If you do not want to do this, simply click “OK”. If you want to turn on 3D acceleration, click the “Display” tab on the left side of the settings window. Click “Enable 3D acceleration” and use the slider on the top of the window to allocate the amount of virtual video RAM your machine will get. I usually go with the full 128 MB if I am using 3D acceleration. Then click “OK”.

    The Antix installer running in VirtualBox
    The Antix installer running in VirtualBox
  11. You are now ready to start your virtual machine and the installation process of your distro. Click the “Start” button on top of the window with your virtual machine selected and it will boot with the installer disc. Hopefully, the installer will be self-explanatory, but if you are in doubt, have a look at the installation instructions on the website of the distro. If you find that your keyboard is not responsive when you are outside the virtual machine, you have to click the “capture key”. This is the right ctrl by default on Linux hosts and the right command key on Mac hosts. You can see which key it is on the bottom right of the window with the virtual machine inside.

Leave a Reply

Your email address will not be published. Required fields are marked *