How to recover ESXi password with Linux boot disk

In the rare unfortunate event that you lost your ESXi root password, you can reset it with a Linux Live ISO. The reference article uses Ubuntu Live DVD. I used RHEL 7 Boot ISO and went into rescue mode. In theory, any Linux ISO that can you get a shell and mount fat16 partition should work.

The disk where ESXi installed will differ depending on how it was installed. In my case, I knew it was SD card installed. I could easily tell the install disk by the size. Besides, it was very clear from the partition layout. Newer ESXi uses GTP and not MBR. fdisk does not support GPT. Since I just needed to view the partition table, fdisk -l did the job.

Advertisements

Upgrading ESXi 5.5. to ESXi 6 with the ISO

This is not a comprehensive guide on upgrading to vSphere 6. If that is your intention, this is what you should read

Derek Seaman’s guide to vSphere 6.0
http://vexpert.me/Derek60

This is just my notes on upgrading a few 5.5 hosts to 6. The rule of thumb is that your vCenter version should be equal or greater than ESXi. We already have a vCenter 6 running.

The preferred method of upgrading on a large scale is to use Update Manager. I used ISO for this upgrade. Since the HW is Cisco, I downloaded a Cisco custom ISO from VMware website. I verified the checksum to save time in case the downloaded ISO is corrupted. Continue reading

How to view shell history in ESXi

In ESXi 5.x and above, you can move the up/down arrow keys to view previously executed commands. But you can’t run history, it’s not there.
Shell commands are logged in /var/log/shell.log

~ # cat /var/log/shell.log
2016-02-29T22:06:05Z SSH: SSH login enabled
2016-02-29T22:06:05Z ESXShell: ESXi shell login enabled
2016-02-29T22:06:27Z ESXShell: ESXi Shell available
2016-02-29T22:10:15Z shell[36047]: Interactive shell session started
2016-02-29T22:10:23Z shell[36047]: [root]: ipconfig
2016-02-29T22:10:54Z shell[36047]: [root]: ifconfig
2016-03-01T01:32:37Z shell[69121]: Interactive shell session started
2016-03-01T02:19:18Z shell[69121]: [root]: exit
2016-03-10T19:26:32Z shell[2409109]: Interactive shell session started
2016-03-10T19:26:37Z shell[2409109]: [root]: ls
2016-03-10T19:26:55Z shell[2409109]: [root]: cd tmp
2016-03-10T19:26:57Z shell[2409109]: [root]: dir

ESXi 4.x

In ESXi 4.x, the shell commands are logged in the messages log file. To view the shell commands, run this command:
grep shell /var/log/messages

Via kb.vmware.com/kb/2014494