This post is part of a series that will deal with setting up a MySQL shared storage cluster using VirtualBox & FreeNAS. In this post we deal with the installation of CentOS in VirtualBox.

This post deals with the creation of two Linux servers hosted within VirtualBox. We will download an installer for CentOS, install it in one VM, finally we will use VirtualBox to clone the VM so the second node will be identical.

To get started download the CentOS network installer.


Once this is complete fire up VirtualBox. First create a new VM in VirtualBox by cliicking the ‘New’ button…
Create VM in VirtualBox

Add at least 2048MB of RAM to the VM.

2 - Set Memory

Create a hard drive. Default options should be fine (options shown below).

5 - Drive type

6 - Dynamically allocated7 - File location and size

Set the file location and size. Again the defaults should be fine in most cases.

7 - File location and size

After your VM has been created cright lick “Node1”, choose “Settings” and select the “Storage” tab. Click the CD icon with the down arrow. Use the file chooser to navigate to the ISO file you downloaded earlier. The VM will boot off this image when it is started.

8 - Attach CentOS iso file

Start the VM and you’ll be presented with the following screen after a few moments. Choose “Install or upgrade an existing system”.

9 - Installing CentOS

Choose your installation language.

10 - Installation Language CentOS

You can skip past the media check screens. Select “URL” in the type of installation screen. Enter the following URL when requested; Check the CentOS website for newer URLs when appropriate. The installer image will be downloaded.

11 - Downloading CentOS Installer Image

The graphical installer will start. Click ‘Next’

12 - CentOS Begin Installation

Choose “Basic Storage Devices” (we’ll install and configure this later).

13 - CentOS Disk Choose

Click “yes, discard any data” as this is a fresh install we won’t lose any data.

14 - CentOS Storage Warning

Set the hostname and click ‘Next’.

15 - CentOS Set Hotname

Set the time zone then click ‘Next’.16 - CentOS Set Timezone

Set a root password then click ‘Next’.

17 - CentOS Set root password

Select the “Use All Space” option and click ‘Next’.

18 - CentOS Use all space

For the installation type select “Basic Server”. We will  install and configure additional software later on.

19 - CentOS Basic Server

The installation will now begin.

20 - CentOS Install Screen

After the installation has completed click ‘reboot’.

21 - CentOS Installation Finished

Don’t forget to remove the ISO image from the virtual CD/DVD drive. Hard boot the box and you’ll be able to login…

22 - CentOS Login Screen

Finally we need to clone this VM to create the second node for the cluster. Shut down the current VM and return to the main VirtualBox gui. With ‘Node1’ selected click Machine > Clone. Change the name of the VM to ‘Node2’ and tick “Reinitialize MAC address of all network cards”. Click ‘Next’

23 - Clone Node1

Ensure the “Full Clone” option is selected and then click “Clone”.

23 - Full Clone
The cloning process will take a minute or two to complete. Node2 will appear in the VirtualBox window when completed.

24 - Node2 Created

That completes the creation and installation of the two Linux cluster nodes. We will continue with the setup of the nodes in a future post.