kernel development using virtualization installing vmware and using a virtual machine to build and...

Post on 11-Jan-2016

223 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Kernel Development using Virtualization

Installing VMWare and using a virtual machine to build and test a

Linux Kernel

Get VMWare

• Download VMWare (http://vmware.com/download/server/)

• Apply for license keys (http://register.vmware.com/content/registration.html)

Begin the installation

Accept the license terms

Customize

Choose desired features and installation path

Disable AutoRun

Note: Windows XP requires extra steps here

Disable each auto-run type in XP

Ready to install!

This may take a while

Note: You may need to temporarily disable your Virus Shield (mcsheild.exe hogs processor ticks while VMWare installs)

Enter one of the serial number you applied for in the step above.

Note: Linux and Windows serial numbers are different

Finished!

Connect to the new VMWare instance

Check settings

Select a directory on a drive with plenty of free space

Download pre-built Ubuntu 8.04 LTS VMWare guest

• http://speedy.hestonsystems.com/csueb/Ubuntu-GOS.zip

Save it to the “Virtual Machines” directory you specified during the VMWare setup and unzip the file.

Open the existing virtual machine

Open the Guest

Start the guest and create a new identifier

Now you can log in!

Username: studentPassword: csueb123

Start the toolbox with command: “vmware-toolbox &”

Note: Minimize, but do not close this dialog.

Now for Kernel development:

• Overview– Install C compiler– Download kernel– Change make file– Compile!

Open a terminal window and type commands to retrieve and set up the kernel compile environment

Kernel-compile commands

• Adapted from: http://www.howtoforge.com/kernel_compilation_ubuntu• sudo apt-get install kernel-package libncurses5-dev fakeroot wget bzip2• sudo passwd root• su <password you set above>• cd /usr/src/• # Get the kernel source• wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.24.7.tar.bz2• wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.24.7.tar.bz2.sign• gpg --keyserver wwwkeys.pgp.net --recv-keys 0x517D0F0E• gpg --verify linux-2.6.24.7.tar.bz2.sign linux-2.6.24.7.tar.bz2• tar -xjf linux-2.6.24.7.tar.bz2• ln -s linux-2.6.24.7 linux• cd /usr/src/linux• make clean && make mrproper• cp /boot/config-`uname -r` ./.config• make menuconfig # (see URL above for options to set)• vi Makefile # (add suffix to version number ie "EXTRAVERSION = .9-kurt")

• # Build Kernel• make-kpkg clean• fakeroot make-kpkg --initrd --append-to-version=-kurt2009 kernel_image kernel_headers

Install New Kernel• # Install Kernel• dpkg -i linux-image-2.6.18.1-custom_2.6.24.7-kurt2009-10.00.Custom_i386.deb• dpkg -i linux-headers-2.6.18.1-custom_2.6.24.7-kurt2009-10.00.Custom_i386.deb• reboot

Helpful Hints

• Google is your friend• treat this as you would any free-standing

computer. it is just as susceptible to viruses as one would be and does not enjoy the benenfit of any virus checkers/firewalls installed on the host machine (that is, windows XP will not protect the Linux OS installed under VMWare)

top related