Ubuntu is a popular Linux operating system. In today’s WFH environment, we need to regularly share screens of our system. There are many GUI software that allow you to share screens in Ubuntu. But sometimes you may need to share screen via command line. In this article, we will learn how to enable screen sharing in Ubuntu.
How to Enable Screen Sharing in Ubuntu
We will look at two ways to share screen in Ubuntu.
Method 1
You can easily share screen using vino and remmina both of which are installed by default in Ubuntu. If not, you can install it via the following command.
$ sudo apt-get install remmina
Then you can run the following command.
$ ssh -Y username@ip_address
Next enter the following command to open vino preferences.
$ vino-preferences
Next, click ‘configure network automatically to accept connection‘. But don’t enter any password. Click Close and then run the following command.
$ sudo -s $ export DISPLAY=:0.0 $ xhost + $ /usr/lib/vino/vino-server &
Next, logout from server with the help of following commands.
$ xhost - Press CTRL+C twice $ exit $ exit
Then open remmina and select vnc under protocol. Under basic tab, add server IP address. In SSH tab, click enable ssh tunnel. Under SSH authentication, you can enter password or public key.
Click Save to save settings. Double click connection name to start browsing remote desktop.
Method 2
You can use x11vnc is a simple VNC server. Once it is installed, you can run the following command. Replace user and host with the username and host IP address of your remote server.
$ ssh user@host -L 5900:localhost:5900 "x11vnc -display :0 -noxdamage"
Then you can use a VNC client on local system to connect to localhost:5900. The SSH command will start a VNC server on remote computer and then tunnels back to the port over SSH.
In this article, we have learnt a couple of ways to enable screen sharing in Ubuntu.
Also read:
Linux Show Active Connections on Port
How to Install CSF in CentOS & Ubuntu
How to Install Visual Studio Code in Ubuntu
How to Evaluate Expression in Shell Script
What Does ${} and $() Mean in Shell
Related posts:
Sreeram has more than 10 years of experience in web development, Python, Linux, SQL and database programming.