It is, of course, only possible to access the desktop environment if the desktop itself has been installed. If, for example, the system was initially configured as a server it is unlikely that the desktop packages were installed. The easiest way to install the packages necessary to run the GNOME desktop is via the apt command as follows:.
To prevent the desktop from attempting to launch automatically each time the system reboots, change the default systemd target back to multi-user:. If the system has a graphical display attached, the desktop can be launched using the following command:. If, on the other hand, the system is a server with no directly connected display, the only way to run and access the desktop will be to configure VNC support on the system. Preview Buy eBook Buy Print. Access to a remote desktop requires a VNC server installed on the remote system, a VNC viewer on the system from which access is being established and, optionally, a secure SSH connection.
While a number of VNC server and viewer implementations are available, this chapter will make use of TigerVNC which provides both server and viewer components for Linux-based operating systems. Once the server has been installed the system will need to be configured to run one or more VNC services and to open the appropriate ports on the firewall.
With the VNC server packages installed, the next step is to configure the server. The first step is to specify a password for the user that will be accessing the remote desktop environment. While logged in as root or with superuser privileges , execute the vncpasswd command where the user name is assumed to be demo :. The above command will create a file named passwd in the. Next, change directory to the. This will start the first desktop session running on the system. That ensures that the VNC server only accepts connections incoming from the server where it is installed.
To get around this and connect to the VNC server from our local machine, we will establish an SSH tunnel from our local machine to the server. That is also an additional layer of security as only users with SSH access to the server can connect to the VNC server. You can choose whichever one you prefer. On Windows you can use PowerShell or a terminal emulator such as Cmder. In my case, I will execute the command below:. Alternatively; you can add a -f argument which runs SSH tunneling in the background.
Now to connect securely to your VNC server, launch the VNC client application and connect with the address localhost :. If you are connecting to your server using Putty, create an SSH tunnel using the procedure below. On the left side of the Putty window, scroll down and get to the SSH option.
Extend it and select the Tunnels option. Enter the details as shown in the image below—Port as the source port and localhost as the destination address. We will also use systemd to launch our VNC server on boot. With that done, we can now start, stop and restart our VNC server as a system service.
You have successfully installed and configured the VNC server on Ubuntu Please keep in mind that if you install multiple desktop environments on the same machine, then you may encounter bugs or conflicts, depending on which you have installed. We covered this initially in the tutorial, but will add it here too, so the article is more easily skimmable. Now restart the VNC server and next time you connect you should be using Budgie.
Now restart the VNC server and next time you connect you should be using Cinnamon. I believe this guide has given you a step-by-step guide on installing and configuring a VNC server on Ubuntu Feel free to share any additional VNC configuration tips with our readers or ask any questions in the comments below or by contacting us. U Ubuntu. Not using Ubuntu?
Choose a different version or distro. For a somewhat different take on remote desktops you can also check our tutorial on Xpra. A Display Manager is a program that enables your Linux distribution to possess graphical login capabilities. It is also responsible for starting the Display Server and the Desktop Environment once you log in with your username and password. Note: The password must be between 6 — 8 characters long.
The system will automatically truncate any password longer than eight characters. For example, if you enter a password like startup , it will be truncated to startup2. Tip: If you ever want to change the VNC password or the view-only password, execute the command below: vncpasswd. Note: After executing this command, the SSH connection will hang after you enter the password.
The value can be between 8 and For more details on how to install other desktop environments, please check our related tutorial on how to install a desktop environment GUI on an Ubuntu You can also install just minimal versions of desktop environments, with minimal necessary software packages, or full versions with all the bells and whistles. Share Tweet 0.
Pin it 0. Share 0. Notify of. I allow to use my email address and send notification about new comments and replies you can unsubscribe at any time. Receive notifications when your comment receives a reply. Your username will link to your website. Oldest Newest Most Voted. Inline Feedbacks. I followed the steps exactly, It shows only a black screen hen I access from localhost.
But i works in localhost when I run vncserver as sudo. Nick Floersch. Reply to Nick Floersch. Apologies for that. Thanks so much for pointing that out. Reply to Thatoo. Have you had any success with this?
We'll also show you how to securely connect to the VNC server through Gnome, which is the default desktop environment in Ubuntu Use Gnome as Desktop Environment · marn.copljo.infol ubuntu deskop if you are using ubuntu server which doesn't get gnome installed. sudo apt. Tigervnc-server is a high-speed, multi-platform VNC program which runs an Xvnc server and starts parallel sessions of Gnome or other Desktop.