If you don't yet have a client, there are a few options, which vary depending on your OS. With your SSH tunnel open, you should be able to connect to the VNC server with the VNC client on your local PC. Connect to your VNC server with a VNC client If you only want to open the tunnel, you can tick "Don't start a Shell or Command at all" under SSH settings. When you connect to your server with PuTTy it will automatically open the tunnel. You can find the Tunnels options under the SSH section and add your details like so: If you use PuTTy, you can also add the relevant port to your settings. Let's create the SSH connection by opening CMD on our local Windows PC and entering the following command: ssh -L 59000:localhost:5901 -C -N -l nonrootuser your_server_ip You'll want to use your local PC for this part. Creating an SSH tunnelĪt this point you may be wondering how you're supposed to connect to your VNC server if all connects outside of your remote host are disabled. Let's restart our VNC server with the localhost option to ensure only connections that start on our server are allowed. You'll also need to make it executable with chmod +x ~/.vnc/xstartup. If there's nothing in your xstartup file already, make sure you add #!/bin/bash at the top. Now we can edit the /.vnc/startup file and point it to xfce4: sudo nano ~/.vnc/xstartupĪdd the following to the bottom of the config and press Ctrl + O and Ctrl + X to save the changes: xrdb $HOME/.Xresources You can quickly kill it with vncserver -kill :1. Unfortunately, we can't edit those config files until VNC is stopped. This will require a bit of fiddling with config files. We need to tell it which desktop environment we want to use, in this case Xfce. So, with that VNC is running, but it's not much use to us at this point. This password will let users log in to view a VNC instance, but will disable any of their inputs. You'll also be asked to if you want to create a view-only password. This is what you'll use later to connect to the VNC instance, so note it down. TightVNCServer will ask you to enter a username and password. You can start a VNC server instance at any point with the following command: vncserver Now it's time to install TightVNC server: sudo apt install tightvncserver How to start and configure VNC server As we're running on a lower-spec VPS, we're going to choose gdm3 by pressing Enter with it selected. gdm3 tends to be more lightweight, but you may also find it uglier. You'll be given the option to choose between gdm3 and lightdm as your display manager. Install Xfce and its goodies enhancements package: sudo apt install xfce4 xfce4-goodies These are what we're going to use today.įirst, make sure your list of packages are up to date: sudo apt update There are a few options when it comes to VNC servers and desktops environments, but the main lightweight ones are Xfce and TightVNC. Naturally, we're going to need to change that if we want to use it with a UI via VNC. When you boot your Ubuntu server for the first time, you'll notice there's no GUI.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |