Thursday, March 13, 2014

Setting up CentOS6 environment in VMPlayer


First download CentOS 6 from one of official CentOS sites and save it anywhere locally on your machine.

Start VMPlayer and click on "Create a New Virtual Machine"


Select "I will install the operating system later"




Select Linux as Guest operating system and CentOS 64-bit as Version



Name your virtual machine and specify where you want it stored on your local drive.



Specify preferred disk size and whether you want to split your virtual disk. I picked default values



Select Next and Click on Customize Hardware




We are going to need more than 1 GB of memory. Depending of what you have available to you bump it up at least to 2 GB. I used half of my memory in this case.



Under New CD/DVD. Pick Use ISO image file for your connection and point to the ISO file that you previously downloaded.



Under Network Adapter, Select "NAT: Used to share the host's IP address" if you don't care if your VM were to share your host's IP address. If you rather have your virtual machine behave more like a real computer on your network, change it to the"Bridged: Connect directly to the physical network". For this tutorial, I went with NAT.



Keep rest of the settings default and click the Close and then Finish button. 


You should now see your newly created VM. Select it from the list of available VMs and click on Play virtual machine. VM will now install CentOS



At this point, we are going to proceed to install the OS to Hard Drive. Why? Well, it will enable us to have CDROM available to our CentOS system if we need it. For example, in our next steps we are going to install VMware Tools that require us to have CDROM available to it. VMware Tools will give us many more features, and will improve mouse movements, video and performance. One of the biggest improvements for me is ability to expand the display into full screen more when you hit "Enter full screen mode". Otherwise, the VMware Player window itself will expand and you still end up with small VM display. Go ahead, try it and see what I mean.

Double click "Install to Hard Drive" icon on your CentOS desktop. This should take you through set up wizard where you sit your keyboard, storage, name of hostname (pick something that would sense to you when you later see it on the network), time zone, etc. Follow it and pick what you fancy... I pretty much picked the default values. Few tips:
- Go ahead and pick "Yes, discard any data" when you see Storage Device Warning message. No worries, it won't do anything to your actual harddrive, only to VM.
- Make sure you create root password AND remember it!!! We will need root access to install/configure in the future.
test
test
- When asked which type on installation would you like. Select Use All Space. Once again, this is happening inside of the VM, so use all 20GB space that you allocated to it. When warming message of Writing storage configuration to disk pops up, go ahead and select Write changes to disk. This will format CentOS harddrive and will install all necessary files.

This step will take a while... and finally you will see:

Go ahead and restart...

When screen comes up, go through License Information, Create non-admin user, Pick date and time, Enable/or disable Kdump. The system will ask you if you wish to reboot, go ahead and do that.

Now let's change our start up configuration and now that CentOS is installed on actual harddrive, we no longer need to boot up from the image. Go ahead and alter that by first shutting down your VM, selecting Edit virtual machine settings,  navigating to CD/DVD and picking use physical drive.

Now go ahead and start your new VM and log in as root.


Initiate VM tools install by clicking on Install Tools on the bottom right corner of the VMware Player or by selecting Player > Manage > Install VM Tools...

Fire up, terminal and execute following commands to install VM Tools

mkdir /mnt/cdrom
mount /dev/cdrom /mnt/cdrom
cp /mnt/cdrom/VMwareTools-*.tar.gz /tmp
umount /mnt/cdrom
tar -zxf /tmp/VMwareTools-*.tar.gz -C /tmp
cd /
./tmp/vmware-tools-distrib/vmware-install.pl --default
Restart your VM again for changes to take effect.

Congrats! You have successfully installed CentOS in your VM! At this point, back it up so that if you were to decide to start fresh you don't have to redo the entire thing again.



No comments:

Post a Comment