01- Installing CentOS 6.2 on VMWare Player 5.0.2
To give us a practice environment where we can start to learn Linux, we will use VMWare Player. This is a free tool that will let us run one computer inside another, as a "virtuam machine". Installing the program is as simple as downloading it and running the installer. In these notes, I will be using the current version of VMWare Player- 5.0.2. However, the product has been stable for some time, so I expect that these instructions will continue to work for subsequent versions.
You can also use the paid-for VMWare Workstation product. That tool has some additional features that will come in handy as we progress, like the ability to develop more complex networks, and the ability to take snapshots of running systems. However, as we are just beginning, we will use the (free, simpler) VMWare Player application.
We want to start to learn Linux, but there are literally dozens of variants. If you want to get a feel for the size and variation in this ecosystem, visit DistroWatch, and browse around a bit. There you will find information on a range of Linux and Unix operating systems. For definiteness, we will be installing CentOS 6.2.
Why CentOS? Well, CentOS is a community supported version of the very popular Red Hat Enterprise Linux operating system. Red Hat is a well respected name in the Linux world, and their products are quite solid. The Red Hat systems are not available for free, however because Red Hat uses only open source software, it is a simple matter for someone else to put together a compatible version directly from the sources, and that is what the CentOS folks have done. Essentially, CentOS is the same as a Red Hat system of the same version, save that all trademarks and other Red Hat corporate dress has been removed.
Why version 6.2? Why not some other version? Well, CentOS 6.2 was released at the end of 2011, so when I started developing the notes for my Case Study course in 2012, I used CentOS 6.2. This same version was used when I updated the course for 2013, so if you look around the site for the course notes for 2012 or 2013, you will be able to jump directly from these install notes to those more advanced notes.
There is a key caveat though- CentOS 6.2 as installed from the installation media is not a secure system. Indeed, the kernel is vulnerable to a privilege escalation exploit CVE 2013-2094, announced in May 2013, and the provided version of MySQL is vulnerable to a different privilege escalation attack, CVE 2012-2122, announced in June 2012. Since our goal is to learn about security, it is convenient to use a system with these known vulnerabilities, as it gives us a chance to look at systems as an attacker as well as a defender. Of course, if you want to set up a secure server, then this version of CentOS is not for you. Either patch your 6.2 install up to the current release (CentOS 6 is scheduled to be supported through 2017), or use a later version.
Getting back to the installation, we cannot simply tell VMWare we want to install CentOS 6.2 though- we need to provide the installation disks. Because this is an older version of CentOS, we can get the disks from the CentOS Vault. You will need both DVDs of the regular install (not the LiveCD or LiveDVD). In this example I will be using the 64 bit (x86_64) version of CentOS; if you wish you could use the 32 bit (i386) version as well. Download both disks, and save them to a convenient place.
Be sure that you get the complete and correct images. This brings us to an important first question about security. How do we know that the file we downloaded has not been modified or tampered with? First, we need a trusted tool that can be used to calculate the hash of a file. Microsoft provides such a tool, called FCIV, though it is a separate download. Go ahead and grab that program, and install it, following the (unnecessarily complex) instructions on the web page.
I installed that program in the directory
D:\Programs\FCIV, and the stored my downloaded files in the directory
D:\Downloads. I then run the program as follows:
D:\Programs\FCIV>fciv -both d:\Downloads\ // // File Checksum Integrity Verifier version 2.05. // MD5 SHA-1 ------------------------------------------------------------------------- 26fdf8c5a787a674f3219a3554b131ca d97377c83fab7493dbd1c2e04dab29c8ba6cd351 d:\downloads\CentOS-6.2-x86_64-bin-DVD1.iso b0b03502875490417c9f8cb9fe8ce6d6 7eac42c403725891b53cd899f0ef7560dc3a9d72 d:\downloads\CentOS-6.2-x86_64-bin-DVD2.iso
From the download site, I can then compare these hashes with either the MD5 hashes or the SHA-1 hashes that they also have stored there. If these are different, then we have a problem. If they match, well it may be the case that an attacker changed both the file and the hashes. However, since in this case the files are stored on one server and the hashes on a different server, I am willing to accept the risk and conclude that I have downloaded the correct files.
You should be in the habit of checking the hashes on any file you download an install. The hashes are usually provided, and it takes just a moment to do so. Attacks on file download sites are (thankfully) rare, so it is unlikely that you will see bad software. On the other hand, the consequences to downloading compromised software are especially large. Think of checking the hashes like wearing your seatbelt- you probably won’t need it, but if you do, then you will be quite glad that you did.
You will then be asked to "Personalize Linux". Here you want to select a "Full name" for a user of your system; in my example I will select the name "Arthur Dent". The "User name" is the account name used by the system for this user, so I will select "adent" formed from the first letter of the first name followed by the last name. Select a password, and continue the wizard. Notice that the password selected here will also be used as the password for the root account- more about that as we move forward.
Next, we will be asked to select the name of our Virtual Machine, and to provide a location for it on the hard drive of the system. The name is used only in VMWare, not in the Linux system, and it is used solely as a label. I develop lots of virtual machines, so I use a naming scheme for all my virtual machines (VMs). The name is the Operating system, including the version, the purpose of the system, and the host name for the system. Keeping with the theme, I will use the host name "TheGuide", so the Virtual Machine name will be "CentOS 6.2 x64- Testing (TheGuide)".
Next, you will be asked to provide the size of the hard disk for our virtual machine. By default, it sets aside 20 GB, which is plenty for our purposes. You will also be asked if your want to store the virtual disk as a single file or split the virtual disk into multiple files. Why the choice? Fundamentally, the issue is one of thumb drives. Suppose that you want to move this virtual machine from one computer to another. It is far too large to fit on a CD or a DVD, and besides, who uses such archaic storage methods anymore? No, you would put it on a portable drive or thumb drive, right? The catch is that many older thumb drives and portable had drives use a file system called FAT32, usually to provide compatibility between systems. The thing about FAT32 is that no file on a FAT32 system could be larger than 4GB. Thus, if you built your VM with a single 20 GB disk image, you would be unable to copy it to a portable drive running FAT32, even if the drive itself had enough free space. Go ahead and split the virtual disk into multiple files. It won’t have a significant impact on what we are going to be doing, and it may save us later if we decide to copy the system.
Next you will be given the option to customize the hardware used by the virtual machine, but the defaults are fine, so just hit finish; be sure to leave the "Power on this virtual machine after creation& checkbox checked!
Simply log in to the system with the password you selected earlier to be placed on the Desktop. Feel free to explore- note that even Firefox has been installed and is available for you.
You can move files and documents to and from your virtual machine by simply dragging them from one and dropping them on the other.
At this point, you are ready for the next step- learning how to use the command shell in Linux.