VMware Cloud Community
M3VM
Enthusiast
Enthusiast

enable esxi shell through command line

Hi,

Is there any command to enable esxi shell? I found the commands that can be incorporated in the kickstart file while installing esxi to enable esxi shell. But want a command which will enable esxi shell after esxi installation...?

2 Replies
deepaknegiee
Contributor
Contributor

There are two ways to do it


1- Best way would be to use powershell


Get-VMHost | Foreach {

  Start-VMHostService -HostService ($_ | Get-VMHostService | Where { $_.Key -eq "TSM-SSH"} )

}

2- You will need to get to DCUI mode to enable it.

To access the local ESXi Shell

1

At the main direct console screen, press Alt-F1 to open a virtual console window to the host.

2

Provide credentials when prompted.

When you type the password, characters are not displayed on the console.

3

To log out, type exit in the shell.

4

To return to the direct console, press Alt-F2.

Regards,

DN

MarkHargreaves
Contributor
Contributor

I know this thread is a little old, but I figure I would answer this question in case someone else has the same question.

You want to add these lines after the initial config commands in your kickstart file to enable the esxi shell after installation:

vmaccepteula

rootpw 'ComplexP@ssword'

install --firstdisk --overwritevmfs

network --bootproto=static --hostname=testme.test.priv --device=vmnic0 --ip=xxx.xxx.xxx.xxx --netmask=xxx.xxx.xxx.xxx --gateway=xxx.xxx.xxx.xxx --nameserver="xxx.xxx.xxx.xxx,xxx.xxx.xxx.xxx" --vlanid=xxx

%firstboot --interpreter=busybox

vim-cmd hostsvc/enable_esx_shell

vim-cmd hostsvc/start_esx_shell

After those lines, you can have esxcli commands execute from your kickstart file.