VMware ESXi is enterprise-class hypervisor. There is a free version which has limited functionality, and there are paid bundles starting with prices about $300 allows you centrally manage 3 ESXi hosts via vCenter server. One of the questions which come regularly is What is VMware ESXi Shell. So in this post, we’ll try to reply.
ESXi Shell What is it?
It’s a special mode previously called Tech Support Mode, where admin can enter ESXi shell commands to monitor, configure or troubleshoot the system locally (at the console window) or remotely, via SSH client such as Putty. Those are text commands (like in Windows through a command window, or through Linux shell), but those commands are specific to ESXi, which is not a Linux system.
Those commands are text commands (like in Windows through a command window, or through Linux shell), but those commands are specific to ESXi, which is not a Linux system. Some of the commands remind Linux administration, but the ESXi isn’t running Linux kernel, but proprietary VMware kernel.
ESXi Shell – How to Enable?
Use the vSphere HTML 5 Client to enable local and remote access to the ESXi Shell. ESXi has a built-in HTML5 web client. All you need to do is to login as root through the ESXi HTML5 client
https://ip_of_esxi/ui
Then select click on Manage > Click the Services tab > In the Services section, select TSM from the list > Click Actions and select Start to enable the ESXi shell.
When you select Start and stop manually, the service does not start when you reboot the host. If you want the service to start when you reboot the host, select Start and stop with host.
You may wonder, what is TSM? Well, this is Tech Support Mode (TSM). When ESXi was in its beginnings (release 3.5 ) then there was this special, TSM mode, which could be activated via ALT + F1 and then you would have to type in ” unsupported ” and hit Enter. But that was a very, very, very long time ago…
The best way to connect to VMware ESXi Shell remotely is to use SSH client. One of those clients is Putty. You can find Putty at this website.
The connection screen looks like this:
And then you can use root as a user with the password you have entered during the installation process of your ESXi.
You can also download Google Chrome extension to connect to ESXi shell directly via Chrome.
Let’s try some ESXi shell commands
How to put a host into a maintenance mode via command line, for example:
esxcli system maintenanceMode set –enable true
Then you’ll see this:
No reply is a good reply. Your host shall be now in maintenance mode. But this was just a small example. You can learn more by typing “help”.
And also you can show the whole esxcli system tree via the esxcli system and hit ENTER. You’ll see the whole “tree” which is valid for the system.
Another use case might be more interesting. It is in case your VM does not reply and you cannot power off that particular VM through the vSphere Client or vSphere HTML5 client. In this case you can “kill” the VM through the CLI.
Get a list of running virtual machines, identified by World ID, UUID, Display Name, and path to the .vmx configuration file by running this command:
esxcli vm process list
You’ll see this:
Power off the virtual machine from the list by running this command:
esxcli vm process kill –type= [soft,hard,force] –world-id= WorldNumber
Note: Three power-off methods are available. Soft is the most graceful, hard performs an immediate shutdown, and force should be used as a last resort.
There is also an alternate power off command syntax is:
esxcli vm process kill -t [ soft,hard,force] -w WorldNumber
After, you can repeat the command
esxcli vm process list
once again to validate that the virtual machine is no longer running.
Another cool feature of VMware ESXi is VMware vMotion, which is accessible through other licensing packages. In fact, you’ll need at least vSphere Essentials Plus KIT. But vMotion allows you to move running VM from one server to another without downtime. Your employees do not have to stop working while you need to do a maintenance work on your server.
Live migration (vMotion) in ESX allows a virtual machine to move between two different hosts. During vMotion Live Migration of a running virtual machine (VM) the content of the (RAM) memory of the VM is sent from the running VM to the new VM. The content of
The content of the memory is changing all the time. ESXi uses a system where the content is sent to the other VM and then it will check what data is changed and send that, each time smaller blocks. At the last moment, it will very briefly ‘freeze’ the existing VM, transfer the last changes in the RAM content and then start the new VM.
The intended effect of this process is to minimize the time during which the VM is suspended. In a best case, this will be the time of the final transfer plus the time required to start the new VM.