Enabling serial-line logging for ESX and ESXi 4.1
search cancel

Enabling serial-line logging for ESX and ESXi 4.1

book

Article ID: 309161

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

This article provides steps for about enabling serial-line logging for an ESX or ESXi 4.1 host.

It is sometimes helpful to have logs captured independent of disk or network connectivity when troubleshooting issues. Enabling serial logging will send all VMKernel logs (and Service Console for ESX) to the serial port in addition to their normal destination. For more information on network-based logs, see Enabling syslog on ESXi (1016621). For more information on disk-based logs, see Location of ESX log files (1021800).

This article assumes that the serial port on an ESX or ESXi host is connected to a remote computer, and that remote computer is listening for logs on the serial port. For more general information, see the parent article in this series Enabling serial-line logging for an ESX or ESXi host (1003900).


Environment

VMware ESXi 4.1.x Installable
VMware ESX 4.1.x
VMware ESXi 4.1.x Embedded

Resolution

ESX and ESXi 4.1 can be configured to send logs to the serial port in three points in time. Collect logs leading up to the point in time that the problem is seen.

  • After installation and startup
  • During startup
  • During installation

After installation and startup

A running ESX or ESXi host can be configured to output log messages via the serial communications port. If the ESX host does not successfully boot, consider configuring it during startup instead.

When configuring an installed ESX host to output log messages via the serial communications port, there are two things which need to be configured:

  1. Configure the ESX or ESXi host VMKernel to send logs to the serial port.
  2. Configure the ESX host Service Console to send logs to the serial port.
Configure the ESX or ESXi host VMKernel to send logs to the serial port
  1. Using the VMware vSphere Client, select the ESX host in the inventory.
  2. Click the Configuration tab.
  3. Click Advanced Settings.
  4. Select the Misc heading.
  5. Set either the Misc.LogToSerial option to 1. This is the default. This enables logging to a serial port.
  6. Select the VMKernel heading.
  7. Set either the VMKernel.boot.com1_baud or VMKernel.boot.com2_baud options to 115200. This is the default. This controls the speed of data send out the serial port.
  8. Set the VMKernel.boot.logPort option to com1 or com2. The default of blank disables use of the serial port for logging.
Note: Changing VMKernel.boot.logPort requires a reboot to take effect.
Configure the ESX host Service Console to send logs to the serial port

This step is only applicable to ESX, not to ESXi. For more information, see VMware ESX and ESXi 3.5 Comparison (1006543).

  1. Login to the Service Console of the VMware ESX being configured, using the physical console or SSH.
  2. Make a copy of the grub.conf configuration file by running the command:

    cp /boot/grub/grub.conf /boot/grub/grub.conf-backup

  3. Edit the file /boot/grub/grub.conf using your preferred text editor. For more information, see Editing configuration files in VMware ESX (1017022).
  4. Locate the line starting with kernel.
  5. Remove the quiet option from the kernel line.
  6. Add the console option to the end of the kernel line:

    console=ttyS0,115200 console=tty0

    For example, this is a line that has been modified:

    kernel /vmlinuz ro root=UUID=51beafbf-b273-4195-9a2c-04dd3b7d7786 mem=272M console=ttyS0,115200 console=tty0

    Note: This example uses ttyS0 which is the first serial port (COM1). To use the second serial port (COM2), specify ttyS1.

  7. Save the grub.conf file.

Note: The Service Console logging configuration requires a reboot to take effect.

During startup

If an ESX or ESXi host does not successfully boot, serial line logging can be configured using advanced kernel boot-time parameters. This takes effect for the current boot, and does not persist across future reboots.
ESX 4.1 Startup
  1. At the Grub bootloader screen, use the arrow keys to highlight VMware ESX 4.1
  2. Press e to edit the commands before booting.
  3. Use the arrow keys to highlight the line starting with kernel.
  4. Press e to edit the line.
  5. Remove the quiet option from the kernel line.
  6. Add advanced vmkernel options to the line to specify a serial port:

    vmkopts=debugLogToSerial:1,logPort:com1

  7. Add advanced Service Console options to the line to specify a serial port:

    console=ttyS0,115200 console=tty0

  8. Press Enter to accept the change
  9. Press b to boot.
ESXi 4.1 Startup
  1. At the Loading Hypervisor screen, press Shift + O on your keyboard.
  2. At the Enter advanced options prompt, type the advanced option to specify a serial port:

    logPort=com1

  3. Press Enter to boot.

During install

If an ESX or ESXi host does not successfully install, serial line logging can be configured when booting the installer using advanced kernel boot-time parameters. This takes effect for the current boot, and does not persist across future reboots.
ESX 4.1 Installation
  1. At the VMware ESX 4.1 boot menu, use the arrow keys to highlight Install ESX in graphical mode.
  2. Press F2 for other options.
  3. Modify the boot command line by removing quiet
  4. Modify the boot command line by adding the SerialPort option to vmkopts to specify a serial port:

    vmkopts=debugLogToSerial:1,logPort:com1

    For example, this is a line that has been modified:

    initrd=initrd.img vmkopts=debugLogToSerial:1,logPort:com1 mem=512M

  5. Press Enter to boot.
ESXi 4.1 Installation
  1. At the VMware VMvisor Boot Menu, use the arrow keys to highlight ESXi Installer.
  2. Press Tab to edit options.
  3. Modify the boot command line by adding the options following vmkboot.gz to specify a serial port:

    LOGPORT=COM1

    For example, this is a line that has been modified:

    mboot.c32 vmkboot.gz LOGPORT=COM1 --- vmkernel.gz --- sys.vgz --- cim.vgz --- ienviron.vgz --- install.vgz

  4. Press Enter to boot.


Additional Information

To configure serial logging on a Cisco UCS blade, see the Cisco Managing Remote Presence documentation.
Note: The preceding link was correct as of January 17, 2012. If you find the link is broken, provide feedback and a VMware employee will update the link.
Enabling serial-line logging for an ESXi/ESXi host
VMware ESX and ESXi 3.5 Comparison
Enabling syslog on ESXi 3.5 and 4.x
Editing configuration files in VMware ESXi and ESX
Location of ESX 3.0-4.1 log files