Error > Could not connect to Cloud Shell on port 8080 > While connecting the Visual Code using code-server

12.2k views Asked by At

Trying to install Visual Code IDE in VM Instance. After running the code-server, while checking view on browser, it is giving an error. Error: Could not connect to Cloud Shell on port 8080. Ensure your server is listening on port 8080 and try again.

enter image description here

reference link to install VS Code in GCC: https://medium.com/google-cloud/how-to-run-visual-studio-code-in-google-cloud-shell-354d125d5748

2

There are 2 answers

2
Puteri On

You should set your host to 0.0.0.0. When you start the server, your command could be like this:

./code-server --no-auth --port 8080 --host 0.0.0.0

And everything should work fine. Try it :D

0
karlangadas On

Try openning on your browser: http://[your-external-ip]:8080/

Its important to change the default "https" to "http".

I also added the port 8080 on my firewall permisions on gcp.