Unable to SSH into vCenter.
search cancel

Unable to SSH into vCenter.

book

Article ID: 319426

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

Trying to access vCenter via SSH and are presented with the following error:

Type: vCenter Server with an embedded Platform Services Controller
/etc/profile.d/proxy.sh: line 11: Enable: command not found
Traceback (most recent call last):
File "/usr/lib/applmgmt/base/bin/vherdrunner", line 8, in <module>
vherdrunner.start(vherdrunner.directories)
File "/usr/lib/applmgmt/base/bin/vherdrunner.py", line 118, in start
exec(code, childGlobals)
File "/usr/lib/applmgmt/linux_cli/bin/main-shell", line 11, in <module>
sys.exit(cli.main(sys.argv, products=('vherd', 'appliance')))
File "/usr/lib/applmgmt/linux_cli/py/vmware/vherd/linux_cli/cli.py", line 1470, in main
cookieOnly=parsedArgs.get_cookie)
File "/usr/lib/applmgmt/linux_cli/py/vmware/vherd/linux_cli/cli.py", line 289, in connect
self.config['mode'])
File "/usr/lib/applmgmt/linux_cli/py/vmware/vherd/linux_cli/introspection_parser.py", line 153, in findMethod
methodList = self.server.system.listMethods()
File "/usr/lib/python3.7/xmlrpc/client.py", line 1112, in __call__
return self.__send(self.__name, args)

 

Environment

VMware vCenter Server 7.0.0

Cause

There are extra or wrong characters at the first line of the file vCenter - /etc/sysconfig/proxy

Resolution

The following steps are for editing the /etc/sysconfig/proxy file:

  1.  Boot into emergency mode of the vCenter:
    1. Identify the host where the vCenter VM resides.

    2. Reboot the vCenter VM and immediately after the OS starts, press e to open the GNU GRUB Edit Menu.

    3. Locate the line that begins with the word linux.

    4. Append this to the end of that line to boot the OS into emergency mode:

      systemd.unit=emergency.target

  2. Once the OS has booted enter the following command to mount the root directory:

    mount -o remount,rw /
  3. Now it is needed to modify the vCenter -/etc/sysconfig/proxy file.
    1. Change the directory to the proxy file

      cd /etc/sysconfig

    2. Backup the proxy file:

      cp proxy proxy.bak

    3. To remove the first line of the file:

      tail -n 27 proxy
  4. Unmount the root directory:

    umount /

  5. Reboot the appliance:

    reboot -f

  6.  Access the vCenter using SSH

Additional Information

If you need to restore to the original file:

cp proxy.bak proxy

To backup the contents of the first line on the removal:

tail -n 27 proxy > proxy.bak