"Unable to connect to the MKS: The operation is not allowed in the current state" error when accessing the console
search cancel

"Unable to connect to the MKS: The operation is not allowed in the current state" error when accessing the console

book

Article ID: 315381

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

This article provides resolution and steps to work around the issue when accessing console fails with the Unable to connect to the MKS: The operation is not allowed in the current state error.

Symptoms:
  • After performing a virtual machine reload, you are unable to access the console.
  • After reloading a virtual machine, the console is black and you are unable to use it.
  • After reloading a running virtual machine, the console displays one of these errors:
     
    • Unable to connect to the MKS: The operation is not allowed in the current state.
    • Unable to connect to the MKS: Malformed response from server.
    • Unable to Connect to the MKS - Error connecting to /bin/vmx process
       
  • This issue occurs when you reload the virtual machine via SSH using this command:

    vim-cmd vmsvc/reload
     
  • In the /vmfs/volumes/ Datastore_of_affected_virtual_machine/Affected_virtual_machine_directory/vmware.log file (for the affected virtual machine), you see entries similar to:

    <YYYY-MM-DD>T<time>00:00:22.467Z| vmx| I120: VmdbPipeStreamsOvlError Couldn't read: OVL_STATUS_EOF, (11) Resource temporarily unavailable.
    <YYYY-MM-DD>T<time>00:00:22.467Z| vmx| I120: VmdbCnxDisconnect: Disconnect: closed pipe for pub cnx '/db/connection/#1/' (-32)
    <YYYY-MM-DD>T<time>00:00:22.467Z| vmx| I120: VmdbDbRemoveCnx: Removing Cnx from Db for '/db/connection/#1/'
    <YYYY-MM-DD>T<time>00:00:22.468Z| vmx| I120: Redirecting stdin/stdout/stderr to /dev/null.
    <YYYY-MM-DD>T<time>:00:22.537Z| vmx| I120: SOCKET 1 (119) recv detected client closed connection
    <YYYY-MM-DD>T<time>00:00:22.537Z| vmx| I120: Vix: [267272 mainDispatch.c:2886]: VMAutomation: Connection Error (4) on connection 0.
    <YYYY-MM-DD>T<time>00:00:22.572Z| vmx| I120: VmdbAddConnection: cnxPath=/db/connection/#c/, cnxIx=2
    ... <--- switch to other VM or close VI client
    <YYYY-MM-DD>T<time>00:05:59.773Z| mks| I120: SSL: syscall error 104: Connection reset by peer
    <YYYY-MM-DD>T<time>00:05:59.773Z| mks| I120: SOCKET 2 (120) recv error 104: Connection reset by peer
    <YYYY-MM-DD>T<time>00:05:59.773Z| mks| I120: SOCKET 2 (120) VNC Remote Disconnect.
    ...
    <YYYY-MM-DD>T<time>00:06 :23.428Z| vmx| I120: Vix: [942082 mainDispatch.c:2886]: VMAutomation: Connection Error (4) on connection 2.</time></time></time></time></time></time></time></time></time></time></time>

     
  • Note: The preceding log excerpts are only examples. Date, time, and environmental variables may vary depending on your environment.  



Environment

VMware vCenter Server 6.0.x
VMware ESXi 6.5.x
VMware ESXi 6.0.x
VMware vCenter Server 6.5.x

Cause

This issue occurs when your backup software reloads the virtual machine before or after a backup operation.

Resolution

Perform one or more of these options in the order specified to restart the Virtual Network Computing (VNC) console service of the virtual machine:
  1. Perform a vMotion of the affected virtual machine to another ESXi host.
  2. Restart the virtual machine from vCenter Server or the ESXi host.
  3. Restart the ESXi host.


Additional Information

For more information on similar error to this article, see: For translated version of this article, see: