Skip to content

Instantly share code, notes, and snippets.

@FrancoB411
Created May 21, 2018 01:26
Show Gist options
  • Select an option

  • Save FrancoB411/01f9b96e1e63b1e0cf00fc2a5cc529d9 to your computer and use it in GitHub Desktop.

Select an option

Save FrancoB411/01f9b96e1e63b1e0cf00fc2a5cc529d9 to your computer and use it in GitHub Desktop.
VNC_ubuntu_18.04_Google_cloud.md
# Get VNC Server running on Google Cloud with Ubuntu 18.04
[Create a new Google Clound Instance](https://console.cloud.google.com/compute/instances?project=tenso-flow&folder&organizationId&duration=PT1H)
## Install a Desktop
In this case ubuntu-desktop
### Install Tasksel
`
sudo apt-get install aptitude tasksel
`
### install ubuntu-desktop via tasksel
`
sudo tasksel install ubuntu-desktop --new-install
`
## Install VNC server
`
sudo apt-get update
sudo apt-get install tightvncserver
`
### Run vncserver and set a password
`
vncserver
`
### Verify VNC server is running
`
nc localhost 5901
`
> Should return RFB 003.008
## Open a port
* Go to network config interface
* Click Edit
* Create New Firewall Rule
* Call it vnc-server
* set cource IP ranges to 0.0.0.0/0
* Set allowed protocol or ports to tcp:5901
* Got to instance details edit page and add the `vnc-server` tag
## Connect
Launch VNC viewer and Connect with the ip and port
You should connect but get a grey screen
Hit the X to disconnect
## Get Desktop Working
### Open the xstartup config file
`
vim ~/.vnc/xstartup
`
Add these lines at the bottom:
```
gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
gnome-terminal &
```
### Save the file
`
:wq
`
### Restart VNCserver
```
vncserver -kill :1
vncserver -geometry 800x600 -name ubuntu-desktop
```
### Reconnect via VNC client
You should see your new desktop.
[Reference Article](https://medium.com/google-cloud/linux-gui-on-the-google-cloud-platform-800719ab27c5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment