Once all of those blocks are in your service script, you can save and close that file. The final block is for the command keyword restart, which is simply the two previous commands ( stop and start) combined into one command. The first block of data will be where we declare some common settings that VNC will be referring to a lot, like our username and the display resolution. This will allow us to start, stop, and restart our VNC server as needed.įirst, open a new service file in /etc/init.d with nano: sudo nano /etc/init.d/vncserver To easily control our new VNC server, we should set it up as an Ubuntu service. To ensure that the VNC server will be able to use this new startup file properly, we’ll need to grant executable privileges to it: sudo chmod +x ~/.vnc/xstartup The second command simply tells the server to launch XFCE, which is where you will find all of the graphical software that you need to comfortably manage your server. Xresources file.Xresources is where a user can make changes to certain settings of the graphical desktop, like terminal colors, cursor themes, and font rendering. The first command in the file, xrdb $HOME/.Xresources, tells VNC’s GUI framework to read the server user’s. Insert these commands into the file so that they are performed automatically whenever you start or restart your VNC server: #!/bin/bash Now we can open a new xstartup file with nano: nano ~/.vnc/xstartup Since we are going to be changing how our VNC servers are configured, we’ll need to first stop the VNC server instance that is running on port 5901: vncserver -kill :1īefore we begin configuring our new xstartup file, let’s back up the original in case we need it later: mv ~/.vnc/xstartup ~/.vnc/xstartup.bak When working with VNC servers, remember that :X is a display port that refers to 5900+X. VNC can launch multiple instances on other display ports, like :2, :3, etc. This port is called a display port, and is referred to by VNC as :1. When VNC is first set up, it launches a default server instance on port 5901. Our VNC server has an xstartup file preloaded already, but we need to use some different commands for our XFCE desktop. These commands are located in a configuration file called xstartup. Step Two - Configure VNC Serverįirst, we need to tell our VNC server what commands to perform when it starts up. With these packages installed, you are ready to configure your VNC server and graphical desktop. Vncserver completes the installation of VNC by creating default configuration files and connection information for our server to use. This is a helpful option if you want to demonstrate something to other people using your VNC server.) Users who log in with the view-only password will not be able to control the VNC instance with their mouse or keyboard. (After you set up your access password, you will be asked if you would like to enter a view-only password. To complete the VNC server’s initial configuration, use the vncserver command to set up a secure password: vncserver Sudo apt-get install xfce4 xfce4-goodies tightvncserver We can get the XFCE packages, along with the package for TightVNC, directly from Ubuntu’s software repositories using apt: sudo apt-get update In this example, we will install XFCE4, which is very lightweight while still being familiar to most users. If this is the case, we’ll need to begin by installing one that we can work with. Step One - Install Desktop Environment and VNC Serverīy default, most Linux server installations will not come with a graphical desktop environment. Once you have your non-root user, you can use it to SSH into your Ubuntu server and continue with the installation of your VNC server. If you haven’t done this yet, you can run through steps 1-4 in the Ubuntu 14.04 initial server setup guide to create this account. You will need an Ubuntu 14.04 server installed and configured with a non-root user that has sudo privileges. Prerequisitesīefore you begin with this guide, there are a few steps that need to be completed first. This choice will ensure that our VNC connection will be smooth and stable even on slower Internet connections. The VNC server we will be using is TightVNC, a fast and lightweight remote control package. In this guide, we will be setting up VNC on an Ubuntu 14.04 server and connecting to it securely through an SSH tunnel. VNC makes managing files, software, and settings on a remote server easier for users who are not yet comfortable with working with the command line. VNC, or “Virtual Network Computing”, is a connection system that allows you to use your keyboard and mouse to interact with a graphical desktop environment on a remote server.
0 Comments
Leave a Reply. |