There are a couple ways to do this the first is what VMware provides in the Install Guide. The second is something I have been doing since the 5/6 days of ESXi. It requires a SSH session to be enabled which you can do within the web manager under Host->Actions->Services->Enable SSH.
First Method: Use vCenter
Assuming you have vCenter you can enable this within the host configuration, see below:
- From the vSphere Client, connect to the vCenter Server.
- Select the host in the inventory.
- Click the Configure tab.
- Under System, select Advanced System Settings.
- Make sure that the VMkernel.Boot.logPort and VMkernel.Boot.gdbPort fields are not set to use the com port that you want to redirect the direct console to.
- Set VMkernel.Boot.tty2Port to the serial port to redirect the direct console to: com1 or com2.
- Reboot the host.
Second Option: Edit boot.cfg
- ssh to ESXi server
- edit the boot.cfg file in the following directories: /bootbank & /altbootbank
- vi /bootbank/boot.cfg /altbootbank/boot.cfg (if using vi you can go to the next file being edited using “:wn” this will write the current file then move to next)
- You want to add “gdbPort=none logPort=none tty2Port=com1” in the kernelopt= line as below:
[root@dell-r440-vsphere:~] vi /bootbank/boot.cfg /altbootbank/boot.cfg # /bootbank/boot.cfg bootstate=0 title=Loading VMware ESXi timeout=5 prefix= kernel=b.b00 kernelopt=autoPartition=FALSE gdbPort=none logPort=none tty2Port=com1 modules=jumpstrt.gz --- useropts.gz --- features.gz --- k.b00 --- uc_intel.b00 --- uc_amd.b00 --- uc_hygon.b00 --- procfs.b00 --- vmx.v build=7.0.1-0.0.16850804 updated=1 # /altbootbank/boot.cfg bootstate=3 title=Loading VMware ESXi timeout=5 prefix= kernel=b.b00 kernelopt= weaselInstalled gdbPort=none logPort=none tty2Port=com1 modules=jumpstrt.gz --- useropts.gz --- features.gz --- k.b00 --- uc_intel.b00 --- uc_amd.b00 --- uc_hygon.b00 --- procfs.b00 --- vmx.v build=7.0.1-0.0.16850804 updated=2
Thats it now reboot and you will see the boot messages within your serial console and end up with the console screen shown below: