Please note: to perform these instructions, you need to be the root user.
Step 1: Insert the "CD"
Step 2: Mount the CD Drive
First, you should create a directory where the CD-drive should be "mounted", that is, a folder somewhere on your server where you can browse the files of your virtual CD-drive. It's customary to use folders under "/mnt" for removable media, so create the folder /mnt/cdrom
[root@centos66 ~]# mkdir /mnt/cdrom
Next, you need to "mount", that is map your virtual CD-rom device to this folder. For this, you also need to specify what sort of file-system that the CD-rom use, which is the ancient and justified standard called "iso-9660".
[root@centos66 ~]# mount -t iso9660 /dev/cdrom /mnt/cdrom
The contents of the virtual CD is now available in the directory "/mnt/cdrom".
Step 3: Install Pre-requisites
[root@centos66 ~]# yum install kernel-devel kernel-headers
You also need a C++ compiler and the make system:
[root@centos66 ~]# yum install gcc-c++ make
Furthermore, you need the (somewhat obscure) Perl script-language:
[root@centos66 ~]# yum install perl
Step 4: Install the Additions
Execute the installer script VBoxLinuxAddistions.sh" by:
[root@centos66 ~]# /mnt/cdrom/VBoxLinuxAddistions.run
You should get an output showing six green [ OK ] messages. However, if you get some sort of error, check the contents of the file "/var/log/vboxadd-install.log",. It contains information on missing packages or other misconfiguration.
Step 5: Create an auto-mount
Go to the Oracle VirtualBox manager, and select "Settings" for your virtual server. Select the section "Shared folders". Click the folder icon with a green plus-signed,, labeled "add a new shared folder destination".
In the pop-up which appears, use the drop-down alternative for the label "Folder path" to select "Other..." and select he folder on your local PC, which you want to share to your virtual instance. After selecting the folder, fill in a suitable name like "automount", click and mark the options "Auto-mount" and "Make permanent" to make this mapping appear automatically in the future. If you want to be able to write data from the virtual instance to your host PC, make sure that you don't tick in the option "Read-only"!
[root@centos66 ~]# reboot
After rebooting the server, you should be able to access a directory called /media/sf_automount (given that you called your share "automount"). Now you can easily copy files back and forward between your host-PC and your virtual instance!
In the Part 5 of the article, we will start installing the server applications, starting with the Apache Web Server.