Setup Vino server from a terminal
export DISPLAY=:0
gsettings set org.gnome.Vino enabled true
gsettings set org.gnome.Vino require-encryption false
If not the following error will pop up:
Unable to connect to VNC Server using your chosen security setting. Either upgrade VNC Server to a more recent version from
RealVNC
or select a weaker level of encryption.
gsettings set org.gnome.Vino prompt-enabled false
To only allow local connections, open a terminal and run the command:
gsettings set org.gnome.Vino network-interface lo
To allow connections from anywhere, open a terminal and run the command:
gsettings reset org.gnome.Vino network-interface
sudo reboot
VNC server's graphical configuration tool
Change Vino settings in the GUI.
Ubuntu uses Vino as screen sharing VNC Server, Here is how to set it up:
Open settings panel: Setting -> Sharing -> Screen Sharing
It set the quality of the graphical interface.
Connecting using VNC Viewer
- Mac install vnc-viewer:
brew cask install vnc-viewer
- Linux client: gvncviewer and remmina
- Windows client: vnc-viewer
if not start vino server you can execute the following steps:
- Method 1:
systemctl --user start vino-server
- Method 2:
/usr/lib/vino/vino-server
ifconfig
Put link information on the client:10.0.1.199:5900
If screen size is too small after connecting, you can set an appropriate width and height through this:
xrandr --fb 1280x1024
Use a reverse ssh tunnel port to connect vnc
ssh -i ~/.ssh/id_rsa -fCNR 5922:localhost:5900 username@host
This is meaning forward port 5900 to remote host 5922
- option
-f
to detach ssh process from the tty - option
-C
to allow compress data - option
-N
to not execute any command over ssh - option
-R
to reverse ssh tunnel
If set remote host sshd config /etc/ssh/sshd_config
with GatewayPorts clientspecified
, You can use follow command to expose remote port to 0.0.0.0
ssh -i ~/.ssh/id_rsa -fCNR :5922:localhost:5900 username@host
otherwise use socat to do port forward:
socat tcp-listen:5923,fork,reuseaddr tcp:127.0.0.1:5922
then you can connect host:5923 with vnc viewer
Other error
If can not start vino-server by this error:
No protocol specified
Unable to init server: Could not connect: Connection refused
Cannot open display:
Run 'vino-server --help' to see a full list of available command-line options
Just restart ubuntu display manager:
sudo systemctl restart display-manager