From 0cc4d58dc030d57021a3782bef83d86463d1ab9a Mon Sep 17 00:00:00 2001
From: emanuele <emanuele.petagna@garr.it>
Date: Fri, 24 Feb 2023 17:23:26 +0100
Subject: [PATCH] Updated VNC guide

---
 web/support/FAQ.rst | 31 ++++++++++++++++++++++++++++---
 1 file changed, 28 insertions(+), 3 deletions(-)

diff --git a/web/support/FAQ.rst b/web/support/FAQ.rst
index 1f2a7c8d..2657b45d 100644
--- a/web/support/FAQ.rst
+++ b/web/support/FAQ.rst
@@ -651,7 +651,7 @@ I have registered through the Form-based registration and now I am trying to log
 -------------------------------------------------------------------------------------------------------------------------------------------------
 Please enter `cloudusers` in the domain field.
 
-How to get a Graphical GUI for your OpenStack VM (tested on Ubuntu 20.04 server)
+How to get a Graphical GUI for your OpenStack VM (tested on Ubuntu 20.04 server and Ubuntu 22.04 Server)
 ----------------------------------------------------------------------------
 This FAQ explains how to install a grphical Environment and VNC on an OpenStack instance and how to access 
 it without exposing VNC service to the Internet.
@@ -664,7 +664,7 @@ Requirements for local machine:
 The following instructions work straightforward on Linux and MacOS; on Windows some adjustments are required, 
 it depends on your SSH Client.
 
-**XFCE4 Desktop Environment**
+**XFCE4 Desktop Environment (Ubuntu 20.04 Server) **
 
 1. SSH login to your OpenStack VM
 2. install XFCE4: `sudo apt-get install xfce4 xfce4-goodies gnome-icon-theme tigervnc-standalone-server` 
@@ -683,8 +683,33 @@ it depends on your SSH Client.
      **LOCAL_PORT** with a valid port; replace **PORT** with the same port used in previous step.
 8. on your local machine run a VNC Client and connect to **127.0.0.1:LOCAL_PORT**, when required insert VNC password (from step 5)
 
+**XFCE4 Desktop Environment (Ubuntu 22.04 Server) **
 
-**GNOME Desktop Environment**
+1. SSH login to your OpenStack VM
+2. install XFCE4: `sudo apt-get install xfce4 xfce4-goodies gnome-icon-theme tigervnc-standalone-server tigervnc-common tigervnc-tools` 
+     (if you need a more complete desktop environment then install also **xubuntu-desktop**)
+3. create a .vnc folder in your user home: `mkdir .vnc`
+4. create xstartup file in `~/.vnc/` and paste the following content::
+ 
+
+     #!/bin/sh
+     # Start up the standard system desktop
+     unset SESSION_MANAGER
+     unset DBUS_SESSION_BUS_ADDRESS
+     /usr/bin/startxfce4
+     [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
+     [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
+     x-window-manager &
+
+5. run `vncpasswd` and set VNC password (you can skip the viewer password)
+6. run `vncserver -geometry WIDTHxHEIGHT -localhost yes -rfbport PORT`, replace **WIDTH** and **HEIGHT** with 
+     desired values (ex: 1024x768) and PORT (ex: 5901, default port)
+7. on your local machine run: `ssh -L LOCAL_PORT:127.0.0.1:PORT USER@VM_IP`; choose a port and replace 
+     **LOCAL_PORT** with a valid port; replace **PORT** with the same port used in previous step.
+8. on your local machine run a VNC Client and connect to **127.0.0.1:LOCAL_PORT**, when required insert VNC password (from step 5)
+
+
+**GNOME Desktop Environment (Ubuntu 20.04 Server)**
 
 1. SSH login to your OpenStack VM
 2. install XFCE4: `sudo apt-get install ubuntu-gnome-desktop gnome-icon-theme tigervnc-standalone-server`
-- 
GitLab