Winter 2013 - January to April 2013 - Updated 2013-04-13 20:54 EDT
You can use any virtualization software you like to create and run this CentOS virtual machine, e.g. VirtualBox, Parallels, etc., but faculty only fully support questions about VMware. It’s what we know.
You can start this download process and wait for it to finish while you move on to the next step to Create an Empty Virtual Machine.
In this section, you will download CentOS 5.8 to your machine. It must be CentOS 5.8 DVD 1, no other version is acceptable for this course. (If you want to play with a desktop version of Linux, don’t use this version. Get something graphical and desktop-friendly such as Ubuntu or Mint to play with. This course is configuring a non-GUI server version of Linux.)
You can get the CentOS 5.8 DVD 1 image from one of the following places. We recommend that you choose the first one; it’s the fastest one.
This is slower than the above Windows Share method. It only works on campus, but it works anywhere on campus, not just in T114:
CentOS-5.8-i386-bin-DVD-1of2.isoMake sure you use a wired connection to download any files.
This is slower than all the above methods. Use it only if you have to:
CentOS-5.8-i386-bin-DVD-1of2.isoYou will need some form of checksum program that runs on your
local computer. It has to be something that can calculate md5
or sha hashes. Unix/Linux/OSX machines already have the md5sum
command available. One suggestion (thanks Richard!) for Windows users is
HashTab:
md5sum.txt file).CentOS-5.8-i386-bin-DVD-1of2.isoYou can get a copy of the checksum files (e.g. md5sum.txt) from the
Linux CentOS 5.8 i386 folder on the http://cstech/ web site.
Verify that you have DVD disk 1 (of 2) named
CentOS-5.8-i386-bin-DVD-1of2.iso
Verify the checksum of the image you download against the checksum
recorded in any of the checksum files located in the same folder.
(For example, open md5sum.txt and locate the checksum for the DVD 1
disk and compare it with the checksum of the image you downloaded.)
On a machine that has the C:\CST folder, you can run an md5sum
program on Windows by opening C:\CST\cygwin\bash and typing
/usr/bin/md5sum.exe filename at the BASH shell prompt. (You can
install the free Cygwin package on your own
Windows laptop to get BASH and all the Unix tools for Windows, including
md5sum, find, etc.)
In this section, you will create an empty Linux 32bit CentOS-compatible Virtual Machine. You can do this while you are waiting for your CentOS DVD disk 1 to download.
To confirm your settings: Select menu VM | Settings to open Virtual Machine Settings and look under the Hardware tab to confirm:
Memory: 256MB
Processors: 1
Hard Disk: 1.8GB
Network Adapter: Bridged
Under the Options tab confirm:
General: CentOS
Start over if you don’t see the above settings.
After you have downloaded and verified the checksum of DVD disk 1
CentOS-5.8-i386-bin-DVD-1of2.iso, you can do a Minimal Installation
of CentOS 5.8 into your empty CentOS virtual machine.
Note that CentOS 5 is identical to Red Had Enterprise Linux 5 (RHEL5) except for colours and trademarks, and remember this as you’re doing the following steps.
CentOS-5.8-i386-bin-DVD-1of2.iso ISO to your VMware
virtual CD drive using the VM Settings Hardware
CD/DVD device page:
root password
firstboot setup agent. (If
you accidentally exit the agent, just type firsboot at a shell
prompt to start it again.) Use the firstboot agent to disable
SELinux (Security Enhacned Linux) as follows:
root with the password that you remember
fdisk -l
and verify that your Disk /dev/sda is 1932 MB.%packages
groups named @base and @core, as specified in the last
paragraph in the above Minimal Installation
instructionsrpm -q -a | wc
and verify that you have exactly 362 packages installed.df -h
and verify that your ROOT virtual disk has a size of 1.4G and
is using between 810M and 821M (65%).free
and verify that you have a total Memory of 254980.ifconfig eth0
and verify that your inet addr is set to be one on your local
network (as you would expect with Bridged networking with DHCP).At present all we need is an updated version of the VIM text editor:
Your CentOS Minimal Installation comes with a minimal (they call it
Tiny) version of the vim text editor named vi that is missing many
features and help files. As root, download and install the full
(they call it Huge) version of vim as follows:
root user.yum install vim-enhanced
yum may hang trying to find mirrors.
If yum hangs, do these steps until it works:
^C (Ctrl-C) will not interrupt the hung yum command, use
^Z to STOP the yum command and then kill %yum to kill it.
(If that doesn’t kill it, use kill -9 %yum)root type: service network restart and try yum again.
ping, but Algonquin College blocks most
ICMP traffic so it may not work as a diagnostic toolyum still hangs on the wired network:
yum and then try:service network restart and try yum again.vim (not vi)
vim type :version and verify that it says compiled Jan 8 2013 (or later).vi and vim are different in CentOS!
alias vi=vimTiny) vi program found?Huge) enhanced vim program found?You can either Suspend or Shut Down (power off) your VM as follows:
This is the fastest way to save your machine state. Most times you will want to suspend your Virtual Machine so that you can resume it quickly where you left off:
When you resume your Virtual Machine, you may need to refresh the
network settings for your new location by running (as root):
service network restart
If you need to reconfigure most parts of the Virtual Machine running Linux, you need to shut down Linux before you can do that. Here’s how:
root (or login in as a user and then become root, if
you have disabled root logins)root run: shutdown -h now or halt (if available)
Most Linux machines running in console mode (run level 3) allow you to
have multiple consoles active by typing ALT+F2 (hold down ALT and
simultaneously push Function Key 2) to switch to the second console,
ALT+F3 to the next one, etc. The default, first, console is of course
ALT+F1.
Multiple consoles allow you to multi-task even without all the overhead of a graphical user interface.
Another way to kill a hung yum session is to switch to a second console,
log in as root, find the process ID of the hung yum process, use
kill to send that process ID a SIGTERM termination signal, then
switch back to the first console again.
When you log out of a server console, make sure you check all the alternate consoles and log them out, too! Don’t leave an open
rootlogin session active when you walk away from the machine!
Know as a system technician what kinds of network problems cause what kinds of errors. Some basic points:
root):
service network restartroot: service network restartStart by making sure your Virtual Machine has been given an IP address
by running ifconfig and looking at the eth0 network device. You are
looking for a valid IP address beside inet addr:, e.g.
# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:04:75:8d:6e:52
inet addr:192.168.9.250 Bcast:192.168.9.255 Mask:255.255.255.0
...
Does the IP address given to your machine seem reasonable for the
network you are on? If not, try restarting the network by running
(as root): service network restart
If that doesn’t work, you might try switching your VMware machine from Bridged Networking to NAT (Network Address Translation) and then restarting your networking again.
You should be able to ping your own IP address successfully:
# ping -c 4 192.168.9.250
PING 192.168.9.250 (192.168.9.250) 56(84) bytes of data.
64 bytes from 192.168.9.250: icmp_req=1 ttl=64 time=0.036 ms
64 bytes from 192.168.9.250: icmp_req=2 ttl=64 time=0.067 ms
64 bytes from 192.168.9.250: icmp_req=3 ttl=64 time=0.057 ms
64 bytes from 192.168.9.250: icmp_req=4 ttl=64 time=0.053 ms
--- 192.168.9.250 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 2997ms
rtt min/avg/max/mdev = 0.036/0.053/0.067/0.012 ms
If you don’t have a working IP address, nothing else will work. You must have an IP address.
Once you have a valid IP address for the network you are on (please,
not wireless!), check your default gateway. Run the command ip route
and look at the gateway address in the default line, e.g.
# ip route
...
default via 192.168.9.254 dev eth0
Try pinging that gateway:
# ping -c4 192.168.9.254
PING 192.168.9.254 (192.168.9.254) 56(84) bytes of data.
64 bytes from 192.168.9.254: icmp_req=1 ttl=64 time=0.882 ms
64 bytes from 192.168.9.254: icmp_req=2 ttl=64 time=0.760 ms
64 bytes from 192.168.9.254: icmp_req=3 ttl=64 time=0.615 ms
64 bytes from 192.168.9.254: icmp_req=4 ttl=64 time=0.663 ms
--- 192.168.9.254 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3001ms
rtt min/avg/max/mdev = 0.615/0.730/0.882/0.102 ms
(Note that Algonquin College, ping may be blocked.)
If you don’t have a working default gateway, nothing else will work. You must have a working gateway.
If you have an IP address and a working gateway, but see failure in name resolution, then your system is not able to use a DNS to turn
host names into IP addresses.
Look for the IP addresses of the DNS servers in file
/etc/resolv.conf:
# cat /etc/resolv.conf
...
nameserver 10.254.21.22
nameserver 10.254.21.21Use ping on each of the addresses listed in that file.
(Note that Algonquin College, ping may be blocked.)
If you can’t ping the DNS servers, your DNS won’t work and you can’t use host names. Try restarting your networking or switching from Bridged to NAT networking. Don’t use wireless!
Plain Text - plain text version of this page in Pandoc Markdown format