What to do after this error message shows up?
Enter: adb devices and you should see something like this below:
List of devices attachedEnter: adb kill-server to disconnect localhost:5555. Now you can run adb commands to your Android device without "adb connect localhost" command line.
How to overcome it?
It might not be the best answer. ADB tool behaves weirdly on my computer as it connects to my Android VM automatically and sometimes it don't. So it is advisable to execute this command: adb devices first to see the list of devices attached with adb.
If there is nothing under "List of devices attached", run adb connect localhost to connect.
If there is device like "emulator-5554 device" under "List of devices attached", adb is already connected the particular device. Without the need to enter "adb connect localhost", you can straightly operate commands to your Android device such as adb push, adb pull, adb install, and etc.
That's how I solve this adb connection error between computer and Android-x86 Virtual Machine.