VNC Basics
Learn how operate a VNC server.
Operating the VNC Server
Let's learn how to operate VNC servers including starting, stopping and debugging them.
root@localhost
mentioned on Termux.Starting a VNC server
Start VNC Server
Andronix has already copied the necessary command on your clipboard if you are on the VNC server page. Just paste it in Termux (in the Distro shell [root@localhost]) and execute it
vncserver-start
Select Resolution
If you're prompted to select a resolution, just press Enter to dynamically select the resolution.
Install a VNC Client
That's it. Now install the RealVNC app (opens in a new tab) from the Google Play Store (or any other VNC client).
Add VNC Server
Now press the Add(+) button to add a VNC connection. Enter localhost:1 as the address and give it a name. Save the record.
Select VNC Server
Click the newly created VNC address
Continue
You might be warned that the connection is untrusted. Click OK to continue.
Enter your VNC password
You will be prompted to enter a password. Enter the password you set while installing the distro step and click ** Continue**.
Almost done ☑️
You will now be able to see the GUI of your Linux distribution.
Let's Improve the Quality
You might notice the horrible picture quality. Don't worry, we'll fix that in the next step.
Click on 'i' Button
Press the i button on the top menu bar of the VNC app to open the settings.
Select High Picture Quality
You will see the settings of the VNC app. Scroll down to the Picture Quality section and select High.
Yay!
Now, you will be able to see the GUI of your Linux distribution in high quality.
All done!
You can now use your Linux distribution as you would on a PC ✅.
vncserver-stop
.Stopping a VNC server
It is necessary to stop the VNC server once you are done using your distro or exiting it. To stop the VNC server execute the following command in the distro shell-
vncserver-stop
Once you execute it, the terminal will ask you for a port number. Enter 1 as the port number and click enter.
VNC Settings
Setting a desired resolution
To apply your desired resolution, please execute the following command-
nano /usr/local/bin/vncserver-start
Now, you just need to change the last line of this file to-
vncserver -name remote-desktop -geometry 1920x1080 :1
Since you've made changes to the file, let's save it by pressing ctrl + x
, then hit y and finally hit Enter
.
How to change resolution permanently in Modded OS /Ubuntu 19
To change resolution permanently execute the following command in the distro's shell-
nano /usr/local/bin/vnc
Once you do this, replace the second line with-
LD_PRELOAD=/lib/aarch64-linux-gnu/libgcc_s.so.1 vncserver -localhost no -depth 24 -name remote-desktop -geometry 1920x1080 :$PORT
Once you are done, just press Ctrl+X
and then type Y
and then hit enter. Now when you'll do just choose the first
option i.e., Start vnc-server with autodetect/dynamic resolution.
How to change the picture quality in VNC
If you are using bVNC then you do not need to make any changes. It will make it's required changes itself.
If you are using RealVNC Viewer, then connect to the VNC Server and then click on (i) button at the top. Change Picture Quality to High, or to your desired quality.
VNC on other devices
Continuing with the instructions, please make sure that both of your devices are sharing the same network. If you don't have access to Wi-Fi, you can start the hotspot from the device having the Linux installed and connect the other device to the hotspot. Once both the devices are under the same network, execute the following command inside the distro's shell-
nano /usr/local/bin/vncserver-start
Now edit the last line and change it to-
vncserver -name remote-desktop -geometry 1920x1080 -localhost no :1
vncserver -name remote-desktop -geometry 1920x1080 -localhost :1
Once you are done with this open a new Termux session (drag from the left to open the sidebar for more options) and type:
ip a
Now copy then WLAN IP address (eg. 192.168.xx.xx). Now use this IP Address on the other device with the port number as 1 (eg. 192.168.xx.xx:1 ).