10
votes

I have spent a couple days trying to install software on Google Compute Engine (GCE) and then remotely access it from either my windows pc or local linux machine.

I can install software, like Google Chrome, etc. but can't open the applications as I keep getting display issues (understandably because GCE is headless). So I'm trying to VNC into the GCE instance.

I have tried installing the following on the server: (Instance Name is "talend")

vnc4server: I get output saying the server is running and everything looks good. Only error I get is a Language error like the following:

steven@talend:~$ vnc4server -geometry 1440x900 :1 perl: warning: Setting locale failed. perl: warning: Please check that your locale settings:LANGUAGE = (unset),LC_ALL = (unset),LANG = "en_ZA.UTF-8"are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). A VNC server is already running as :1

and

steven@talend:~$ vnc4server -geometry 1440x900 :2 perl: warning: Setting locale failed. perl: warning: Please check that your locale settings:LANGUAGE = (unset),LC_ALL = (unset),LANG = "en_ZA.UTF-8"are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). New 'talend:2 (steven)' desktop is talend:2 Starting applications specified in /home/steven/.vnc/xstartup Log file is /home/steven/.vnc/talend:2.log

Remote Access: Using TightVNC client via Windows

I get the following message:

No connection could be made because the target machine actively refused it.

Remote Access: Using Vinagre via Linux

Connection to host 8.34.210.67::5902 was closed.

Via Google Compute Engine Web Console:

Tried changing to static ip > No Difference

Tried adding tcp:80 with Source: 0.0.0.0/0 > No Difference

I'm sure there is a simple solution to this but I can't seem to find it. Any help will be appreciated and then will post a link to the final solution.

Thanks.

3

3 Answers

9
votes

You will need to configure three settings to all agree on the same port:

  • The port vnc4server is listening on.
  • A Compute Engine firewall rule to allow traffic on that port.
  • The port TightVNC is attempting to connect to.

From the error message "Connection to host 8.34.210.67::5902 was closed.", it looks like TightVNC is trying to connect to 5902. Assuming that vnc4server is also listening on that port, you should add a Compute Engine firewall rule to allow that port.

Visit the Console at https://cloud.google.com/console, click on your project, then Compute Engine, then Networks. Click the "Create new" next to "Firewalls" and add a new rule with tcp:5902 set in the Ports/Protocols field.

If you're running on Centos, there is an additional step to disable the local firewall as well: CentOS Firewall Issues on GCE

0
votes

Another option is to use Guacamole and Tomcat to access your desktop via a browser or VNC client.

Use Aptitude or apt-get to install guacamole-tomcat. I have the VNC port in firewall settings (via tags) as well as http and https. I've set up a "guacamole" tag to use with the firewall as well. Your GCE instance will need these tags assigned. There are some configs to do via /etc/guacamole/ for user/login etc, but essentially it goes like this...

Once installed, the default ports are 8080. So browse to http://:8080/guacamole/ and you will get a Guacamole login screen. When you login, you will have links to click that start your desktop in a browser window.

You can also VNC directly (no browser) via :5901 - or whatever port you configured Guacamole with. It's best of course to have set up a st

0
votes

Try:

$ sudo iptables -L

Chain INPUT (policy ACCEPT) target prot opt source destination
Chain FORWARD (policy ACCEPT) target prot opt source destination
Chain OUTPUT (policy ACCEPT) target prot opt source destination

if it is not similar flush:

sudo iptables -F