How to connect to the Google Compute Engine virtual server with a graphical interface?

I am testing Google Compute Engine and I created a virtual machine with Ubuntu OS. When I connect to it by clicking this Connect SSH button, it will open a console window.

Is this the connection you get?

How to open a real screen with a graphical interface? I do not need a console.

+6
source share
4 answers

X11 . Unix Linux:

https://unix.stackexchange.com/questions/12755/how-to-forward-x-over-ssh-from-ubuntu-machine

, , X11-. , X11 .. , :

https://help.ubuntu.com/community/ServerGUI

, :

$ sudo vim /etc/ssh/sshd_config

, X11Forwarding yes. ssh-, :

$ sudo /etc/init.d/sshd restart

$ vim ~/.ssh/config

, ForwardX11 yes. :

Host example.com
    ForwardX11 yes

X11

$ ssh -X -C example.com
...
$ gedit example.txt

X11

http://dailypackage.fedorabook.com/index.php?/archives/48-Wednesday-Why-Trusted-and-Untrusted-X11-Forwarding-with-SSH.html

, , .

, ForwardX11Trusted yes ~/.ssh/config.

, -Y -X.

+5

Ubuntu 16.04 LTS LXDE ( SSH 5901 )

1. Ubuntu VM GCP.

2. Google

gcloud compute --project "project_name" ssh --zone "project_zone" "instance_name"

3.

sudo apt update && sudo apt upgrade
sudo apt-get install xorg lxde vnc4server

4. vncserver ( vncserver)

vncserver
sudo echo "lxpanel & /usr/bin/lxsession -s LXDE &" >>  ~/.vnc/xstartup

6. ( Google)

sudo reboot

7. Google, , $ HOME/.ssh/google_compute_engine, . *****

cloudshell download-files $HOME/.ssh/google_compute_engine

8. SSH ( 5901), ( 7)

ssh -L 5901:localhost:5901 -i "google_compute_engine" username@instance_external_ip -v -4

9. vncserver

vncserver -geometry 1280x800  

10. Remote Desktop Client (, Remmina) localhost:5901 - VNC


1: , vncserver, :

netstat -na | grep '[:.]5901'
tail -f /home/user_id/.vnc/instance-1:1.log

2: vncserver :

sudo vncserver -kill :1 && vncserver

***** Google $HOME/.ssh/

ls $HOME/.ssh/
google_compute_engine  google_compute_engine.pub  google_compute_known_hosts

home/*user_id*/.ssh/authorized_keys ( SHH Google, .. 2),

+4

Chrome Remote Desktop . , Google .

Check out this Google manual to use it with the Compute Engine: https://cloud.google.com/solutions/chrome-desktop-remote-on-compute-engine

+1
source

All Articles