CS183 Lab 1: VMware and CentOS Linux Installation
Goal:
In this lab, you will learn: 1) how to create a virtual machine using
VMware Server; 2) how to install CentOS Linux; 3) how to recover the
root passwd.
VM Creation
NOTE: During VM Creation and Linux installation, take screenshots as
many as needed for your report. Use VM/Capture Screen from the VMware
menu.
You will need to create a new Linux VM with 5G of disk space and 256M
of memory.
- Start a terminal on the host OS and type:
$ /usr/bin/vmware &
- Select Custom VM configuration.
- Guest OS: Linux
- Version: Red Hat Linux Enterprise 4
- Virtual machine name: your_name
- Location: /extra/your_name
- Number of processor: 2
- Memory: 256M
- Network connection: host-only
- SCSI adapter: LSI logic
- Disk: Create a new virtual disk
- Virtual disk type: SCSI
- Disk size: 5G
- Uncheck Split disk into 2GB files
- Go ahead and create a VM.
CentOS Installation
- Check if CentOS 5 CD1 (CentOS-5.1-i386-bin-1of6.iso) is already
in /extra. If not, download one by doing:
$ cd /extra
$ wget http://mirrors.usc.edu/pub/linux/distributions/centos/5.1/isos/i386/CentOS-5.1-i386-bin-1of6.iso
- Go back to VMware, double-click on CD-ROM, use ISO image:
/extra/CentOS-5.1-i386-bin-1of6.iso
- Power on the virtual machine.
- Type in "linux text" to get text installation setup .
- Hit Skip CD test.
- Follow the instructions.
- Say "yes" if warned to erase ALL DATA.
- Partitioning Type: Create custom layout.
- Press F2 to create the following partitions 1-by-1.
Mount Point Type Size
----------- ---- ----
/ ext3 3000M
swap 256M
/tmp ext3 512M
/var ext3 128M
/import ext3 1000M
/home ext3 Fill all available space
- Ignore partition warning.
- Boot loader configuration.
- Use Grub
- No passwd
- Boot CentOS on /dev/sda1
- MBR
- Configure Network Interface.
- Yes to eth0
- Activate on boot
- Enable IPv4 support
- IPv4 Configuration for eth0
- Enable Manual address configuration
- IP Address: 192.168.0.2
- Netmask: 255.255.255.0
- Gateway: 192.168.0.1
- Primary DNS: 138.23.169.10
- Hostname Configuration.
- Time Zone Selection.
- Uncheck System Clock uses UTC
- America/Los_Angeles
- Pick a good root passwd.
- Package selection. We want MINIMAL installation, so
- Check Customize software selection
- Go thru each package, deselect all the packages by holding down "-"
- If it says you need more than 1 CD, then you probably left
something selected, go "Back" and fix it
- Reboot.
- Login as root.
- Turn off SELinux by editing /etc/selinux/config
$ vi /etc/selinux/config
Change
SELINUX=enforcing
into
SELINUX=disabled
- Reboot again to make sure SELinux is disabled.
- Update current installed package.
$ yum update
- Create an user account for yourself.
$ useradd <username>
$ passwd <username>
- Login yourself to make sure it works.
Root Passwd Recovery
Before doing so, you need to "forget" your root passwd by asking the
person next to you or your TA (in case the person next to you is busy
in recoverying his/her root passwd :) to change your root passwd to
something else. DO NOT PEEK when he/she is changing it. After that,
try to login as root several times and make sure your old one does not
work anymore. Now, try to recover your root passwd by doing the
following:
- Reboot your VM.
- On the splash screen, press any key to get to GRUB manual.
- Press 'a'.
- Type " single" (make sure there is a space before "single") and Enter.
- You should get a shell, change your root passwd there.
- Type "exit" to continue booting.
- Login as root to make sure your root passwd works.
Questions
- The device name for SCSI drives are named like /dev/sda, /dev/sdb,
and so. What's the device name for IDE drives?
- What is an extended partition?
Scoring
- Attendance - 10%
- Question 1 - 10%
- Question 2 - 20%
- The rest of the report - 60%
Notes & Tips:
- Use Ctrl-Alt to switch from guest to host machine.
- When rebooting your VM, you may ask VMware to send Ctl-Alt-Del for
you or login as root and type "reboot". Don't simply reset the VM.
- A sample lab report can be downloaded from here.