Article sections

    Source : https://www.nakivo.com/blog/most-useful-esxcli-esxi-shell-commands-vmware-environment/

    By default, ESXi shell is disabled for local and remote access; hence, you are not able to run ESXi shell commands until you enable the ESXi shell. VMware has made this restriction for security reasons. There are three main methods for enabling the command line interface in ESXi.

    Using the ESXi default interface

    In the ESXi Direct Console User Interface (DCUI), go to Troubleshooting Options, navigate to Enable ESXi Shell and Enable SSH strings and press Enter to enable each option. After enabling the ESXi shell, press Alt+F1 to open the console on the machine running ESXi. You should enter your login and password after that (credentials of the root user can be used). If you need to go back to the ESXi DCUI, press Alt+F2. The Enable SSH option allows you to open the ESXi console remotely by using an SSH client.

    Configuring ESXi to be able to run ESXi shell commands

    Using VMware Host Client

    Open a web browser and enter the IP address of your ESXi host in the address bar, then log in. Go to Host > Actions > Services and click Enable Secure Shell (SSH). Now you can connect to the ESXi console by using your SSH client remotely. Similarly, you can enable the console shell on a local ESXi host in the Services menu.

    Using vCenter and VMware vSphere Client

    This method can be used if your ESXi host is managed by vCenter Server. In VMware HTML5 vSphere Client, go to Hosts and Clusters, select your ESXi host, select the Configure tab, open System > Services and click SSH in the list of services. After that, hit Start to launch the SSH server once, or hit Edit Startup Policy and select Start and Stop with host if you wish to enable the SSH server for an extended period of time. You can also enable the ESXi shell in the Services menu.

    Enabling remote access to the ESXi shell in VMware vSphere Client

    In order to connect to the ESXi console remotely via SSH, in the Linux console, type a command like ssh 192.168.101.221, where 192.168.101.221 is the IP address of the ESXi server used in this example. You need to enter the login and password of the ESXi user in this case (root can be used by default).

    Connecting to the ESXi console from Linux - read the warning before running ESXi shell commands

    In Windows, you can use PuTTY as an SSH client for running ESXI shell commands remotely.

    Using PuTTY as an SSH client in Windows for running ESXi shell commands remotely
    in ESXI VM Ware

    Related Articles