Step-by-step guide
- Download CentOS.
- When selecting a version, select the "DVD ISO" don't select "Everything ISO", it is more than 4 GB for CentOS version 7.
- Download & install VirtualBox, or you may use any existing version you already have like what is installed with Genymotion.
- Open Virtualbox, and click "New" button.
- In
the name "CentOS7" you will find the type is automatically changed to
"Linux" & version to "Red Hat", change the version to be "Red Hat
(64 bit)", click "Next". Note: If you are running VirtualBox in Windows
8/8.1, you may not find the option of 64 bit. If this is the case, and
to get it enabled, first make sure that you enabled "Intel
Virtualization" option in your BIOS. Second, disable Hyper-v platform in
Windows through ControlPanel->Programs->Turn Windows Features On
or Off.
- For the memory, select at least 1024 MB, click "Next".
- For the Hard drive, click "Create a virtual hard drive now", click "Create".
- Keep "VDI (VirtualBox Disk Image)", click "Next".
- Keep storage as "Dynamically allocated", click "Next".
- Type a location for this file without spaces.
- The
maximum size limit 40 GB will be more than enough (Dynamic allocated as
required this is just maximum limit), click "Create".
- Select your virtual machine, click "Settings":
- Click "System", Boot order, uncheck "Floppy".
- Click
"Storage", click "Controller: IDE" and select the CD ROM, and click the
button "Set up virtual CD DVD drive" and select the iso image file
downloaded in step #2, click "OK".
- Click "Network", Adapter 1, attached to "Bridged Adapter" instead of NAT & then:
- Select
your WiFi controller in name in-case you are using your laptop and will
use the wireless network on your Internet connectivity.
- Select
your Ethernet in name in-case you are using a PC and you will be using
the Ethernet network on your Internet connectivity.
- Select your virtual machine, click "Start".
- Select "Install CentOS 7".
- You can abort checking the media by clicking "Esc".
- In the graphical installer starts, select "English", "United States", click "Continue".
- Change the timezone.
- In software selection "Basic Web Server" & select the following Add-Ons (Based on your needs):
- Backup client.
- Directory client.
- Guest agents.
- Hardware Monitoring utilities.
- Large Systems performance.
- Performance tools.
- Remote Management for Linux
- For Installation Destination, Keep "Automatic partitioning selected".
- For Network & hostname:
- You
will find a Network Ethernet (Either you are using Wireless or Ethernet
connection on your host; VirtualBox will mimic any network connection
to Ethernet), click the button to make it "On" as you will need for
Internet connectivity & your work later. It will say connected.
- Scroll down and change the hostname to "centos7.localdomain"
- Click button "Begin Installation".
- For root password: root_password_must_memorize
- For
user creation: Type your name it will suggest login name, make sure to
"Make this user as administrator" and provide your password.
- When installation, click "Reboot".
- From the virtualbox settings, storage, "Remove disk from virtual drive" to avoid re-installing CentOS again.
- Make sure your system is up & running before performing post installation steps.
You can scroll up & down in the CentOS guest using shift + pageup & shift + pagedown |
Post installation
Installing DKMS & Guest Additions
- In-case you have VirtualBox older than v4.3.14RC1, download newer version of Guest Additions, tried for version 4.3.20, & copy it to virtual box folder having the original one. If you have already higher version, please skip this step.
- While your CentOS vm is already started, and you have logged using root.
- Run the following command to install EPEL (Extra Packages for Enterprise Linux):
yum install epel-release
Is this ok? y
- Run the following command to install kernel-devel package that provides the headers needed to compile modules for the kernel:
yum install kernel-devel
Is this ok? y
- Run the following command to install dkms (Dynamic Kernel Module Support):
yum install dkms
Is this ok? y
- While
your CentOS vm is already started, and you have logged using root.
Select "Device" menu, and select "CD/DVD", and mount VirtualBox Guest
Additions 4.3.20
- In the VM status bar just move to the CD icon,
you will find that the CD has mounted "Virtual Guest Additions iso" that
is normally located in %VIRTUALBOX_FOLDER%\VBoxGuestAdditions.iso
- Auto
installation doesn't work with CentOS it just mounted the CD, it
usually works for Windows, we will perform the next steps to manually
install Guest Additions.
- Mount the CD ROM using the command (Note:
Without installing the kernel-devel specific version although done
before, the building of GuestAdditions was always failing, now it will
take time and build successfully):
yum install kernel-devel-3.10.0-123.el7.x86_64
Is this ok? y
mount /dev/cdrom /mnt
cd /mnt
sh ./VBoxLinuxAdditions.run
- Shutdown your VM using command:
shutdown -h now "configure shared folder"
- Go to your VM settings, click "Shared Folder", Add new folder "c:\shared-with-vbox" with below settings:
- Go to your VM settings, click "General", tab "Advanced", for Shared Clipboard select "Bidirectional".
- Go to your VM settings, click "Storage", Remove disk from virtual drive.
- Start
your VM, login with root, you need to make a folder in your centos and
then mount the shared folder to this newly created folder using below
command:
cd /tmp
mkdir sharedhost
mount -t vboxsf sharedwithvbox /tmp/sharedhost
Installing SELinux (Security-Enhanced Linux) Policy Management tool
This is required later for securing your server when changing the port of SSH
- Just run the command:
yum install policycoreutils-python
Installing Network Time Protocol
This is required later for synchronizing your server with NTP
- Just run the command:
yum install ntp
Thanks. It works but windows can not be scaled or entering full screen mode. Your pictures can not be displayed due to their links to your account in the cloud which requiring log in.
ReplyDeleteGreat Post. Thanks. I can't see any posted .png but that's ok. In Post installation 11, I had a hard time figuring out the file name "shared-with-vbox" has to be exactly "sharedwithvbox" in 14. But eventually I did.
ReplyDeleteName of the folder can be anything you specify
Delete