How to build redhat kernel for VMware for time issue

Anyways, here’s how you do it:
1) download kernel source. I got mine from:
ftp://ftp.redhat.com/pub/redhat/linux/u … EL.src.rpm 2) install source:
rpm -i kernel-2.6.9-34.0.2.EL.src.rpm
(You may need to run “mkdir -p /usr/src/redhat/SOURCES”. If that’s the case, then I’d run “mkdir -p /usr/src/redhat/SOURCES /usr/src/redhat/SPEC /usr/src/redhat/RPMS /usr/src/redhat/SRPMS /usr/src/redhat/BUILD” just in case. ) 3) edit files to include BusLogic driver:
cd /usr/src/redhat/SOURCES edit the following files:
kernel-2.6.9-i686.config
kernel-2.6.9-i686-hugemem.config
kernel-2.6.9-i686-smp.config replace all instances of:
# CONFIG_SCSI_BUSLOGIC is not set
with:
CONFIG_SCSI_BUSLOGIC=m 4) make a patch change the Internal kernel timer frequency.
cd /usr/src/redhat/SOURCES
tar jxvf linux-2.6.9.tar.bz2
mkdir -p linux-2.6.9-vmware/include/asm-i386
cp -pr linux-2.6.9/include/asm-i386/param.h linux-2.6.9-vmware/include/asm-i386/param.h
open linux-2.6.9-vmware/include/asm-i386/param.h
change
# define HZ 1000 /* Internal kernel timer frequency */
to
# define HZ 100 /* Internal kernel timer frequency */ diff -urN linux-2.6.9/include/asm-i386/param.h linux-2.6.9-vmware/include/asm-i386/param.h > vmware.patch add the patch to the spec file list
open /usr/src/redhat/SPECS/kernel-2.6.spec
added to where it lists the patches (your numbers may vary):
I just made it Patch 5 since it doesn’t exist:
so after the line: Patch4: linux-2.6.9-selected-ac-bits.patch
Patch5: vmware.patch and where it does the prep after the line: %patch4 -p1
%patch5 -p1 5) change the release of your kernel to differentiate:
cd /usr/src/redhat/SPECS
open the file: kernel-2.6.spec and change:
%define release 34.0.2.EL
to
%define release 34.0.2.EL.vmware 6) build the rpm.
rpmbuild -ba –target=i686 /usr/src/redhat/SPECS/kernel-2.6.spec You could use
rpmbuild -bb –target=i686 /usr/src/redhat/SPECS/kernel-2.6.spec
if you only need the binary rpms, but since we modified the source, I like to use ba, so I can reuse the source rpm should I need to compile again.]]>

Buslogic driver for RHEL4 update4 (2.6.9-39 kernel)

For the update4 (20060605) distro, the kernel version is 2.6.9-39, so the buslogic driver on VMware’s site doesn’t work anymore. You can use the one attached, but it’s not supported by VMware. Install Linux by following the instructions on their site.

This is obviously not supported by VMware, Inc. There’s also no guarantee that your VM will be stable, but I’d bet that it would be.

ESX 3.0 cdrom problem – won’t mount / won’t work for Guest

[root@wesx3 root]# mount /dev/cdrom /mnt/cdrom/
mount: /dev/cdrom: can’t read superblock from /var.log/messages
Apr 27 09:40:06 wesx3 modprobe: modprobe: Can’t locate module ide-cd Fix with the following:
1) remove the line from /etc/vmware/esx.conf by running:
nano /boot/kernelAppend = “hda=ide-scsi”
2) remove hda=ide-scsi from /etc/grub.conf using nano again:
nano /etc/grub.conf
3) reboot the machine. That’s it!]]>

ESX VMkernel doesn’t load 0xbad0013

After install process completes, on first boot of ESX system the following error messages appear:

VGA: 297: VGA start b8000 end c0000 mapped start c00b8000 char height 16

VGA: 397:

VGA: 425: 0

Console: switching to colour VMNIX-VGA 80×25

VGA: 465: 0

Console: switching to colour VGA+ 80×25

WARNING: Mod: 2434: Initialization of vmkernel failed, status 0xbad0013

Mod: 4406: Waiting for vmklogger to dump log buffer…

Warning: Mod: 4429: Dumping vmkernel log buffer (5162 bytes):

after the rest of the Service console loads it indicates that a critical error and that the vmkernel didn’t load

We’re running on an HP DL385 (dual opeteron at 2.6 GHz) running the VMware Starter edition off of an array.

Strange – the solution of the problem was just to put the DIMMs into the right place – the memory was placed incorrectly as we didn’t read the decals on the box. hehe…

Synchronizing with time server: [FAILED]

ntpd: Synchronizing with time server: [FAILED]
Starting ntpd: [ OK ]

When does it do the sync?

# Synchronize with servers if step-tickers exists

# or the -x option is used
echo -n $”$prog: Synchronizing with time server: ”
/usr/sbin/ntpdate $dropstr -s -b -p 8 $tickers 2>/dev/null >/dev/null
RETVAL=$?
[ $RETVAL -eq 0 ] && success || failure It does the sync when the /etc/ntp/step-tickers file is there. [root@localhost ~]#

cat /etc/ntp/step-tickers
time.vmware.com

Why would this happen? Strange stuff…

[root@localhost ~]# /etc/init.d/ntpd stop
Shutting down ntpd: [ OK ]
[root@localhost ~]# ntpdate time.vmware.com
28 Jun 10:49:44 ntpdate[25663]: step time server 10.16.12.148 offset 90.895171 sec

The ntpdate command doesn’t fail … wonder why… tail /var/log/messages shows:
Jun 28 10:52:31 localhost ntpd: ntpd shutdown failed
un 28 10:52:31 localhost ntpdate[26038]: can’t find host time.vmware.com
Jun 28 10:52:31 localhost ntpdate[26038]: no servers can be used, exiting
Jun 28 10:52:31 localhost ntpd: failed
Jun 28 10:52:31 localhost ntpd[26043]: ntpd [email protected] Wed Nov 17 15:43:55 EST 2004 (1)
Jun 28 10:52:32 localhost ntpd: ntpd startup succeeded

Can’t find host? Why’s that? Let’s try using the IP address instead of the name in the step-tickers file. Well, the IP address fixes it in Redhat Enterprise Linux 4, but I had this problem with ESX server (based on Redhat 7.2).

The problem was
[root@localhost ~]# file /etc/ntp/step-tickers
/etc/ntp/step-tickers: ASCII text, with CRLF line terminators The file was a DOS file. When the problem was in ESX, I was able to see the ^M character in /var/log/messages, so I was able to fix it after finding that. Fun stuff huh?

Interesting time issue …

Interesting Time issue in Linux.<-->

To complicate things a little, this was Redhat Enterprise Linux 4 update 2 in a VMware VM – reason why it makes it a little more complicated is because that there’s a time problem for Virtual Machines – in virtualization, you can’t afford to give the clock ticks that the older 2.6 kernels ask for (default 1000HZ). You can read more on it here: http://www.vmware.com/vmtn/resources/238.

So in this case, virtualization wasn’t the problem.

Here’s where I started:

ln -sf /usr/share/zoneinfo/America/Chicago /etc/localtime

date

Mon Feb 13 18:25:28 UTC 2006

ls -ld /etc/localtime

lrwxrwxrwx 1 root root 35 Feb 13 18:25 /etc/localtime -> /usr/share/zoneinfo/America/Chicago

cat /etc/sysconfig/clock

ZONE=”America/Chicago”

UTC=false

ARC=false

run hwclock – it just gives you the prompt back.

date -s “Feb 13 20:25:28 PST 2006”

run date and get

Mon Feb 13 04:25:28 UTC 2006

run setup – go through the options set it to America/Chicago and still … UTC … why!?

set:

export TZ=America/chicago

still … date shows UTC!

reboot the Vm, go into the bios … same thing …. why!!??

zdump -v America/Chicago … shows a bunch of bullshit – nothing that helps.

finally:

rpm -qf /usr/share/zoneinfo/America/Chicago

rpm –verify tzdata-2004e-2

S.5….T. /usr/share/zoneinfo/America/Chicago

S.5….T. /usr/share/zoneinfo/CST6CDT

S.5….T. /usr/share/zoneinfo/SystemV/CST6CDT

S.5….T. /usr/share/zoneinfo/US/Central

ahh … wonder how the files got changed. Anyways, it doesn’t matter.

reinstalled rpm

rpm –force -Uvh tzdata-2004e-2.noarch.rpm

Now run:

ln -sf /usr/share/zoneinfo/America/Chicago /etc/localtime

Now the date’s okay … cool deal!

Here are the steps to get ESX to act as an NIS client

Here are the steps to get ESX to act as an NIS client:

1) download & install ypbind / yptools packages from redhat 7.2

2) authconfig to modify server info

3) modified /etc/pam.d/sshd and vmware-authd file to use different modules – copying the system-auth to replace sshd/vmware-authd will work.

VMware – migrating virtual disk from GSX to ESX

Here are the steps for importing a GSX VM to ESX:

1) Here’s how to convert the vmdk file into 2gb chunks:

vmware-vdiskmanager -r sourceDisk.vmdk -t 0 targetDisk.vmdk

2) Share the folder of the new targetDisk with Windows.

3) Make temp directory and mount Windows shared folder on the ESX server:

a) mkdir /mnt/tempwindowsmountpoint

b) mount -t smbfs -o username //gsxserver/sharename /mnt/tempwindowsmountpoint

4) Import vmdk

vmkfstools -i /mnt/tempwindowsmountpoint/targetDisk.vmdk /vmfs/vmfs/newtargetDisk.vmdk

5) Create new VM in ESX and point to the newtargetDisk.vmdk

6) Start up new VM.

Regards,

Alton

How to get USB devices to work in Linux or the ESX console

Here is how I’ve gotten a couple of cdroms / usb memory sticks / hard drives to work.

1) modprobe usb-ohci
Or
modprobe usb-uhci
(one of them should work, one may fail)

2) modprobe usb-storage

3) tail /var/log/messages
Or
dmesg
and you should see something like this:
Feb 8 14:50:56 supp15 kernel: Initializing USB Mass Storage driver…
Feb 8 14:50:56 supp15 kernel: usb.c: registered new driver usb-storage
Feb 8 14:50:56 supp15 kernel: scsi1 : SCSI emulation for USB Mass Storage devices
Feb 8 14:50:56 supp15 kernel: Vendor: SanDisk Model: Cruzer Mini Rev: 0.4
Feb 8 14:50:56 supp15 kernel: Type: Direct-Access ANSI SCSI revision: 02
Feb 8 14:50:56 supp15 kernel: VMWARE SCSI Id: Supported VPD pages for sdb : 0x1f 0x0
Feb 8 14:50:56 supp15 kernel: VMWARE SCSI Id: Could not get disk id for sdb
Feb 8 14:50:56 supp15 kernel: :VMWARE: Unique Device attached as scsi disk sdb at scsi1, channel 0, id 0, lun 0
Feb 8 14:50:56 supp15 kernel: Attached scsi removable disk sdb at scsi1, channel 0, id 0, lun 0
Feb 8 14:50:56 supp15 kernel: scsi_register_host starting finish
Feb 8 14:50:56 supp15 kernel: SCSI device sdb: 2001888 512-byte hdwr sectors (976 MB)
Feb 8 14:50:56 supp15 kernel: sdb: Write Protect is off
Feb 8 14:50:56 supp15 kernel: sdb: sdb1 Feb 8 14:50:56 supp15 kernel: scsi_register_host done with finish
Feb 8 14:50:56 supp15 kernel: USB Mass Storage support registered.

4) Now that we know that it’s sdb1,
Create the mountpoint directory:
mkdir /mnt/usb
Mount the device:
mount /dev/sdb1 /mnt/usb

That’s it. Your files should be in /mnt/usb. To check, just run ls /mnt/usb

In a case that you don’t have /dev/sdb1 there, which is what happened to me once with a Dell CDrom, I had to mknod the device.
After plugging the usb cdrom into the machine, /var/log/messages showed:

date hostname kernel: sr0: scsi3-mmc drive: 10x/10x cd/rw …..

Unfortunately, if you type: “mount /dev/sr0 /mnt/mountpoint”, it will say:
“mount: special device /dev/sr0 does not exist” and that doesn’t do us any good. So what I did after that was:
cd /dev
mknod sr0 b 11 0

With that, /dev/sr0 existed and hence I was able to run:
mount /dev/sr0 /mnt/mountpoint

or, I could run:
ln -s /dev/sr0 /dev/cdrom
and run:
mount /dev/cdrom /mnt/mountpoint

That’s it!