Setting up GUI Desktop on a VM: Difference between revisions
No edit summary |
Improvements in clarity of order of steps |
||
Line 45: | Line 45: | ||
}} The first time you start a vnc server it will ask you to set a password. This password is used later when connecting to the vnc desktop. You don't need a view-only password. The <code>vncpasswd</code> command can later be used to change your password. | }} The first time you start a vnc server it will ask you to set a password. This password is used later when connecting to the vnc desktop. You don't need a view-only password. The <code>vncpasswd</code> command can later be used to change your password. | ||
</li> | </li> | ||
<li> | <li>Test your connection by opening port <code>5901</code> (see [[Managing_your_cloud_resources_with_OpenStack#Security_Groups | security groups]] for more information about opening ports to your VMs with OpenStack) and connecting using a VNC viewer, for example [https://tigervnc.org/ TigerVNC]. However, this is not a secure connection; data sent to and from your VM will not be encrypted. | ||
</li> | </li> | ||
<li>Connect using an SSH tunnel (see [[SSH_tunnelling]]). There is an example of creating an SSH tunnel to a VNC server running on a compute node of one of our clusters here: [[VNC#Compute_Nodes]]. | <li>Connect using an SSH tunnel (see [[SSH_tunnelling]]). There is an example of creating an SSH tunnel to a VNC server running on a compute node of one of our clusters here: [[VNC#Compute_Nodes]]. | ||
Below are instructions for connecting using an SSH tunnel for linux or mac: | |||
*Open your terminal | *Open your terminal | ||
*type the following: SSH -i filepathtoyoursshkey/sshprivatekeyfile.key -L5901:localhost:5901 ubuntu@ipaddressofyourVM | *type the following: SSH -i filepathtoyoursshkey/sshprivatekeyfile.key -L5901:localhost:5901 ubuntu@ipaddressofyourVM | ||
* | *Start your VNC viewer. | ||
* | *In the VNC server field enter: <code>localhost:5901</code>. | ||
*your GUI desktop for your remote session should now open | *your GUI desktop for your remote session should now open | ||
</li> | |||
<li>Close port <code>5901</code>. Once you are connected to your VNC server using an SSH tunnel, you no longer require port 5901 open so it is recommended that you remove this rule from your security groups. (see [[Managing_your_cloud_resources_with_OpenStack#Security_Groups security groups]] for more information). | <li>Close port <code>5901</code>. Once you are connected to your VNC server using an SSH tunnel, you no longer require port 5901 open so it is recommended that you remove this rule from your security groups. (see [[Managing_your_cloud_resources_with_OpenStack#Security_Groups security groups]] for more information). | ||
</li> | </li> | ||
<li> | <li>Once you are finished using the remote desktop you may stop the vncserver with: | ||
{{Command|vncserver -kill :1}} | {{Command|vncserver -kill :1}} | ||
</ol> | </ol> | ||
</translate> | </translate> | ||
[[Category:CC-Cloud]] | [[Category:CC-Cloud]] |
Revision as of 19:06, 25 November 2022
Some software that you can install on your virtual machine (VM, or instance) are only, or best accessed, through their graphical user interface (GUI). It is possible to use a GUI through SSH + X11 forwarding. However, you may observe better performance when using VNC to connect to a remote desktop running on your VM.
Below, we outline steps for setting a remote desktop with VNC. Please note that these instructions are for a VM running a Ubuntu operating system.
- Install a GUI Desktop on your VM.
There are lots of different Desktop packages available. For example some common Desktop packages available for the Ubuntu operating system are:- ubuntu-unity-desktop
- ubuntu-mate-desktop
- lubuntu-desktop
- xubuntu-desktop
- xfce4
- ubuntu-desktop
- kde-plasma-desktop
- ubuntu-desktop-minimal
- cinnamon
- icewm
[name@server ~]$ sudo apt update [name@server ~]$ sudo apt upgrade -y [name@server ~]$ sudo apt install ubuntu-mate-desktop
During the installation of the
ubuntu-mate-desktop
package it will ask you to choose the default display manager, a good option islightdm
. Installing theubuntu-mate-desktop
package can take a fair amount of time (something like 15-30 mins). - Install TigerVNC server.
This software runs on your VM and allows you to use the GUI desktop you installed in step 1. remotely using a client software.[name@server ~]$ sudo apt install -y tigervnc-common tigervnc-standalone-server
This command will install the TigerVNC server and some supporting software. For details about using VNC servers and clients see our docs on VNC.
- Start the vnc server
The first time you start a vnc server it will ask you to set a password. This password is used later when connecting to the vnc desktop. You don't need a view-only password. The
[name@server ~]$ vncserver -> enter a password -> enter "n" for view-only password
vncpasswd
command can later be used to change your password. - Test your connection by opening port
5901
(see security groups for more information about opening ports to your VMs with OpenStack) and connecting using a VNC viewer, for example TigerVNC. However, this is not a secure connection; data sent to and from your VM will not be encrypted. - Connect using an SSH tunnel (see SSH_tunnelling). There is an example of creating an SSH tunnel to a VNC server running on a compute node of one of our clusters here: VNC#Compute_Nodes.
Below are instructions for connecting using an SSH tunnel for linux or mac:
- Open your terminal
- type the following: SSH -i filepathtoyoursshkey/sshprivatekeyfile.key -L5901:localhost:5901 ubuntu@ipaddressofyourVM
- Start your VNC viewer.
- In the VNC server field enter:
localhost:5901
. - your GUI desktop for your remote session should now open
- Close port
5901
. Once you are connected to your VNC server using an SSH tunnel, you no longer require port 5901 open so it is recommended that you remove this rule from your security groups. (see Managing_your_cloud_resources_with_OpenStack#Security_Groups security groups for more information). - Once you are finished using the remote desktop you may stop the vncserver with:
[name@server ~]$ vncserver -kill :1