Once you are able to start the IB tws, you will need to configure it to accept connections from the shim, by enabling api clients, and defining the shim's IP address to be trustworthy. From the configure api menu option, check Enable SocketX and API Clients; and via the configure api Trusted IP Addresses dialogue, enter the shim's host IP number to be a trusted address. E.g., for the shim connecting as localhost, the IP number 127.0.0.1 must have been entered as a trusted IP number.
This last step, of defining the shim's host IP address to be trusted, is critical. Otherwise, the accept incoming connection dialogue will pop up, the shim's connection attempt will timeout, and the shim will giveup and quit.