Hide minor edits - Show changes to markup
note for Macintosh users - this has been tested with a trial copy of build 1884 of Parallels for Mac, and with the appropriate substitutions (CD/ROM has to be primary slave to boot, so pass a kernel command line option; use IDE drive instead of SCSI) it seems to work.
note - if you have SElinux enabled (e.g. if you're running CentOS 4.3) you won't be able to install VMWare. Remove the selinux policies first:
rpm -e selinux-policy-targeted
grub> setup (hd1)
grub> setup (hd0)
$ make all
$ make
cmpsci577a.iso
cmpsci577a.iso.bin (the .bin prefix is to make our webserver serve it as binary - you may need to rename it to cmpsci577a.iso)
guest operating system: other 2.6.x linux kernel
networking: host-only
disk: 2GB is more than enough, and will be easier to copy for saves and restores.
guest operating system: "other 2.6.x linux kernel"
networking: "host-only"
disk: 2GB is more than enough. I use 1.25G in the example below.
@] (note - this is a 1.25GB virtual disk) Be sure to (a) set the "Boot" flag on /dev/sda2 so you can boot from it, and (b) set the type of /dev/sda1 to "swap".
@] Be sure to (a) set the "Boot" flag on /dev/sda2 so you can boot from it, and (b) set the type of /dev/sda1 to "swap".
In our class we will be using the free version of VMWare Server as a development environment, running a modified version of the CRUX linux distribution. (http://www.crux.nu). The following directions will walk you through (a) installing VMWare, (b) installing the linux distribution, and (c) compiling and booting a new kernel.
Debugging kernel code requires a dedicated computer, as bugs may result in the system crashing or worse. (such as corrupted or overwritten file systems) Rather than dedicating a physical machine, we will be using the free version of VMWare Server as our test platform in this class.
We will run a stripped-down Linux distribution, CRUX Linux (http://www.crux.nu), on the virtual machine, for two reasons: (a) it takes less disk space, and (b) it boots quickly - this is something we are going to be doing a lot of, either after installing a new kernel, or after crashing.
The following directions walk you through (a) installing VMWare, (b) installing the linux distribution, and (c) compiling and booting a new kernel.
(:title Installing your system :)
In our class we will be using the free version of VMWare Server as a development environment, running a modified version of the CRUX linux distribution. (http://www.crux.nu). The following directions will walk you through (a) installing VMWare, (b) installing the linux distribution, and (c) compiling and booting a new kernel.
Configure the CD/ROM device to use cmpsci577a.iso, boot, and log in as root.
Configure the CD/ROM device to use cmpsci577a.iso, boot, and log in as root. (if you're installing off a physical CD, then configure it to use the real CD/ROM drive)
cfdisk 2.12r
Disk Drive: /dev/sda
Size: 1342177280 bytes, 1342 MB
Heads: 255 Sectors per Track: 63 Cylinders: 163
Name Flags Part Type FS Type [Label] Size (MB)
------------------------------------------------------------------------------
sda1 Primary Linux swap / Solaris 254.99
sda2 Boot Primary Linux 1085.74
cfdisk 2.12r
Disk Drive: /dev/sda
Size: 1342177280 bytes, 1342 MB
Heads: 255 Sectors per Track: 63 Cylinders: 163
Name Flags Part Type FS Type [Label] Size (MB)
sda1 Primary Linux swap 254.99 sda2 Boot Primary Linux 1085.74
[-- @@ [=
[@
=] @@ --] (note - this is a 1.25GB virtual disk) Be sure to (a) set the "Boot" flag on /dev/sda2 so you can boot from it, and (b) set the type of /dev/sda1 to "swap".
@] (note - this is a 1.25GB virtual disk) Be sure to (a) set the "Boot" flag on /dev/sda2 so you can boot from it, and (b) set the type of /dev/sda1 to "swap".
[-- [=
[-- @@ [=
=] --] (note - this is a 1.25GB virtual disk) Be sure to (a) set the "Boot" flag on /dev/sda2 so you can boot from it, and (b) set the type of /dev/sda1 to "swap".
=] @@ --] (note - this is a 1.25GB virtual disk) Be sure to (a) set the "Boot" flag on /dev/sda2 so you can boot from it, and (b) set the type of /dev/sda1 to "swap".
[-- @@
[-- [=
@@ --] (note - this is a 1.25GB virtual disk) Be sure to (a) set the "Boot" flag on /dev/sda2 so you can boot from it, and (b) set the type of /dev/sda1 to "swap".
=] --] (note - this is a 1.25GB virtual disk) Be sure to (a) set the "Boot" flag on /dev/sda2 so you can boot from it, and (b) set the type of /dev/sda1 to "swap".
[-[@
[-- @@
@]-] (note - this is a 1.25GB virtual disk) Be sure to (a) set the "Boot" flag on /dev/sda2 so you can boot from it, and (b) set the type of /dev/sda1 to "swap".
@@ --] (note - this is a 1.25GB virtual disk) Be sure to (a) set the "Boot" flag on /dev/sda2 so you can boot from it, and (b) set the type of /dev/sda1 to "swap".
cfdisk 2.12r
Disk Drive: /dev/sda
Size: 1342177280 bytes, 1342 MB
Heads: 255 Sectors per Track: 63 Cylinders: 163
Name Flags Part Type FS Type [Label] Size (MB)
------------------------------------------------------------------------------
sda1 Primary Linux swap / Solaris 254.99
sda2 Boot Primary Linux 1085.74
[Bootable] [ Delete ] [ Help ] [Maximize] [ Print ]
[ Quit ] [ Type ] [ Units ] [ Write ]
(note - this is a 1.25GB virtual disk) Be sure to (a) set the "Boot" flag on /dev/sda2 so you can boot from it, and (b) set the type of /dev/sda1 to "swap".
mkfs.ext3 /dev/sda2 mount /dev/sda2 /mnt mkswap /dev/sda1 swapon /dev/sda1
$ mount --bind /dev /mnt/dev $ mount --bind /tmp /mnt/tmp $ mount -t proc proc /mnt/proc $ mount -t sysfs none /mnt/sys $ chroot /mnt /bin/bash
/dev/sda2 / ext3 defaults 1 1 /dev/sda1 swap swap defaults 0 0
SERVICES=(net sshd)You can add other services, but you probably don't need them.
$ cd /usr/src/linux-2.6.15.6 $ cp linux-2.6.15.6-small.config .config $ make oldconfig $ make all $ make modules_install $ cp arch/i386/boot/bzImage /boot/vmlinuz $ cp System.map /boot/System.map
$ grub grub> root (hd0,1) grub> setup (hd1) grub> quitNOTE - the standard CRUX instructions describe using LILO, an older linux boot loader, instead of Grub. In my experience this results in a virtual machine that will not boot.
Now you are done - you should be able to disconnect the CD/ROM (menu VM->CD/ROM->disconnect) and reboot into your newly installed virtual machine.