Supplementary Chapter - Introduction To Linux and Installation
Supplementary Chapter - Introduction To Linux and Installation
Supplementary Chapter - Introduction To Linux and Installation
Linux Distributions
Linux distribution is an OS made as a collection of software based around the Linux kernel with
a collection of software of various sorts.
For x86 systems, the Linux distributions usually provide a ISO image with an installer program
that helps to install the boot loader, Linux Kernel and the included software of your choice.
There are currently over hundreds of Linux distributions. Among them, there are some well-
known, e.g. Fedora (Red Hat), Ubuntu. Debian and CentOS (Red Hat).
For our course, we choose CentOS 64-bit.
It is a package based on Red Hat Enterprise Linux, free of charge and multi-functional OS.
In addition to providing service about file & print server, CentOS can also be used to create Web
Server, Mail Server, Proxy Server, etc. Together with high stability, it has been popular so far.
Why choose CentOS Linux over Red Hat Enterprise Linux?
1. CentOS Linux is free of charge for download and updates while Red Hat Enterprise Linux is
not free.
2. The source code of CentOS Linux is similar with Red Hat Enterprise Linux, completely
compatible with the commercial and open source software running on Red Hat Enterprise
Linux.
3. The same updated package of CentOS is usually introduced at the same day that the updated
package of Red Hat Enterprise Linux is available and the updated package has been tested
completely by the engineers at Red Hat Enterprise Linux.
4. CentOS has been adopted by some popular public cloud providers such as Amazon EC2,
Oracle Cloud, etc. as Linux virtual machine providing stable and high-performance services
to their customers.
5. According to IDC data, CentOS Linux is the top 3 under the Linux server market and has
been adopted by “Fortune 500” companies.
1
User Interface of Linux
Users can adopt Graphical User Interface (GUI) to operate Linux.
However, if the execution time of a command is too long or infinite, we cannot enter another
command on the same location.
Background execution
In the following example, if we would like to issue another command when xclock is displayed,
we can add “&” after the command to make xclock to be running in background.
2
If we want to stop the execution of program running in background, we can use “ps” command
to recognize the PID of xclock, then use kill -0 <PID> to stop xclock.
After clicking the link “CentOS Linux”, select 7-2009 and click x86_64 link.
3
You can see there are a number of mirror sites I different countries for download. Please select
the one which is close to the local area as the downloading speed will be higher.
You can see an image file called CentOS -7-x86_64-DVD-2009.iso. Save it to somewhere in
your computer so that we shall use it for installing our Linux in the next section.
Remarks: We will install the CentOS Server on a virtual machine which could mount the
downloaded ISO file directly as a DVD Rom inside the virtual machine, so you are
not required to burn the ISO file to DVD.
4
Hardware Environment
In order to perform the exercises in our lab, you should install CentOS on a PC with the
specifications below:
a CD or DVD drive.
a 1 GHz processor or faster.
At least 1 GB of memory (RAM)
5
Select Windows hosts, and the installation exe file will be downloaded.
Follow the instructions to install VirtualBox by clicking Next, Yes and install buttons.
After completion of Installation process, the Virtual Box window gets opened as follows:
2. A dialog box appears for the user to input the virtual machine name, e.g. CentOS. Please
DON’T load ISO image here because we are going to do manually configure installation.
6
3. Set up the memory size as 2048MB.
4. Then, create a virtual hard disk of 40 GB and select “Pre-allocate full size” to improve
performance and ensure physical hard drive doesn’t run out of disk space:
7
5. Finally, you can view the summary before finishing the configuration.
6. Now, you can see the configuration of your virtual machine as follows. Click on the Settings
button of the new virtual machine.
8
7. There are a number of settings. Go to System setting, select Motherboard, change the
Pointing Device to be USB Tablet.
8. Inside System setting, then select Processor. Modify the number of processors to be 2.
10. Go to Storage Setting. Select Empty from “Controller: IDE”. Click on the icon beside the
IDE Secondary Master. A pop-up menu appears. Select Host Drive E: and then select
“Choose a disk file…” and open the downloaded centOS image file.
10
11. Go to Network setting, we use the default network adapter settings “NAT”. IP address will
be assigned to the Linux VM automatically. Then, click OK button to finish Settings.
11
12. Yare are ready to power it on to install CentOS. On the main menu, select the new virtual
machine, click Start icon.
12
Installing CentOS
1. By default, since there is nothing in the VM’s hard disk yet, it will boot from DVD ROM
ISO and a welcome screen appears:
2. After a while, the following appears. Select “English (United States) and click “Continue”.
13
4. The 100MB VM hard disk is now selected by default. Just let CentOS installer program to
configure hard disk for you. Select Automatically configure partitioning and then click Done.
14
5. Click SOFTWARE SELECTION”, it is now set to “Minimal Install” which is not desired.
6. Select “Server with GUI” and click “Done” on the upper left corner. Then, click “Begin
Installation” near the bottom right corner.
15
7. Installation begins but you still need to configure additional settings before the installation
completes. Click ROOT PASSWORD.
8. Enter “sam12345” twice. Since the password configured is weak, it prompts you to confirm
using it again. Then, click Done. Click Finish Configuration. All settings required are now
configured and we shall wait for installation to complete.
9. After several minutes, the installation completes and the following screen is shown. Click
“Reboot” to reboot the virtual machine.
16
10. Wait until the following screen is shown. Then, click License link.
11. Check to select the license agreement. Then, click Done button.
17
12. Then, click “Finish configuration” box.
13. The installation from DVD ISO image is completed but you still need to configure some
post-installation setup. Select English and Click Next.
16. In “Time Zone” screen, type Macau and it will show you “Macau, Macau”. Click Next.
19
18. In the “Full Name” textbox, enter your full name, such as “Tony Sam” and the username will
be filled with “tonysam”. Click Next.
20
Your CentOS Server is now successfully installed and you can start using it. You are now logged
in as user “tonysam” mentioned above.
21
2. Click “Applications” on the menu bar at the top. There is not any “Activities Overview” to
show all common activities on the left pane.
3. Now, let’s show the terminal screen to write a command to display Activities Overview on the
screen. Click Applications, then select Terminal.
22
5. After reboot, login as root
6. Repeat Step 4 to reboot the system and login as root. Then, you can see the application
overview on the left pane. Click “Show Applications” icon at the bottom of the left pane.
Then, you can see applications at the center.
7. Click the “reverse triangle button” at the top right of the display. Then, click Settings button
from the following screen.
23
8. Click “Details” on the left pane.
24
10. Now, close the Details window. This time click the Power off button below.
25
11. Click Restart.
12. Enter password of the user and then click sign in. The last two steps are the normal procedure
to login through X-Windows everytime you restart the CentOS.
26
Since we configure the hostname to tonyhadoop, in previous step, it becomes tonyhadoop as
shown in the prompt below.
14. You can invoke the following command: hostnamectl to view the details of the host.
15. If you want to change the host name in terminal, you can invoke the following command:
hostnamectl set-hostname new-hostname
Then, press i key to go to Insert Mode and change ONBOOT value to yes, as shown below.
Then press Esc key, type :wq to save. Finally, reboot it.
27