-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvnc.html
More file actions
264 lines (180 loc) · 7.37 KB
/
vnc.html
File metadata and controls
264 lines (180 loc) · 7.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
<script src="md-page.js"></script><noscript>
# How to install a VNC server and client
# How to install a VNC server
Screen recordings https://www.youtube.com/@nmariusp/search?query=vnc
# Glossary
VNC is Virtual Network Computing. https://en.wikipedia.org/wiki/VNC
RFB is the remote framebuffer protocol. https://en.wikipedia.org/wiki/RFB_(protocol)
OS means operating system.
# VNC features
I use the TigerVNC VNC server and VNC client.
* Resizing the window of the TigerVNC VNC client changes the resolution of the VNC server.
* Copy/paste of text works OK.
* The speed is OK. Everything is snappy, even using an Integrated Development Environment (IDE).
# Linux, FreeBSD, OpenBSD, NetBSD VNC server tigervnc
If you cannot make your X server work correctly, e.g. small resolution. An alternative is to install a VNC server and to connect to this computer from another computer using a VNC client.
Note: on the VNC server, you should log out if you use X11 and you are connected via the computer's keyboard and mouse (aka Ctrl+Alt+F1, aka one of the 8 virtual consoles). Before connecting using a VNC client.
## Ubuntu >= 24.04
Screen recording https://www.youtube.com/watch?v=0ICSWkuKlG4
On the computer where we install the VNC server:
<pre>
sudo apt install openssh-server
</pre>
On the computer where we install the VNC client:
<pre>
sudo apt install tigervnc-viewer
ssh administrator@192.168.122.117
sudo apt install tigervnc-standalone-server
vncpasswd
# Enter a longer than 6 characters password.
# Do not provide a "view-only password".
sudo apt install gnome-session-flashback
cat << 'EOF' > ~/.vnc/xstartup
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
export XKL_XMODMAP_DISABLE=1
export XDG_CURRENT_DESKTOP="GNOME-Flashback:Unity"
export XDG_MENU_PREFIX="gnome-flashback-"
gnome-session --session=gnome-flashback-metacity --disable-acceleration-check
EOF
vncserver :1
</pre>
## Kubuntu >= 24.04
## EndeavourOS with KDE Plasma installed from the OS installer, Arch Linux installed using archinstall, from archinstall select the KDE Plasma 6 desktop
Screen recording https://www.youtube.com/watch?v=pJPOXamoumU
On the computer where we install the VNC server:
<pre>
sudo systemctl enable --now sshd
</pre>
On the computer where we install the VNC client:
<pre>
# Install the tigervnc VNC client package. E.g.
sudo pacman -Syu
sudo pacman -S tigervnc
ssh administrator@192.168.122.117
sudo pacman -Syu
sudo pacman -S tigervnc
vncpasswd
# Enter a longer than 6 characters password.
# Do not provide a "view-only password".
vncserver :1
</pre>
## Fedora >= 42
See https://www.youtube.com/watch?v=s7UItD0NlIw
On the computer where we install the VNC server:
<pre>
sudo systemctl enable --now sshd
# Make sure that no user is using the graphical user interface session (X server).
</pre>
On the computer where we install the VNC client:
<pre>
# Install the tigervnc VNC client package. E.g.
sudo dnf install tigervnc
ssh administrator@192.168.122.117
sudo dnf install tigervnc-server
vncpasswd
# Enter a longer than 6 characters password.
# Do not provide a "view-only password".
vncserver -fg :1
# If you press Ctrl+C, the VNC server will stop.
</pre>
In another terminal:
<pre>
vncviewer 192.168.122.117:1
</pre>
Alternatively, you can use a single command line on the VNC client computer.
This will use an SSH tunnel, only requires access to TCP port 22 on the VNC server and starts the VNC server.
<pre>
ssh administrator@192.168.122.117 -f -L 5901:localhost:5901 "vncserver :1 -fg ; sleep 20" && vncviewer 127.0.0.1:1
</pre>
## openSUSE Tumbleweed
In the installer: I have selected "Desktop with KDE Plasma". I have disabled the firewall and enabled the SSH server. I have created a user named administrator and selected the checkbox that makes the user administrator a sudoer.
Make sure that no user is using the graphical user interface session (X server).
On the computer where we install the VNC client:
<pre>
# Install the tigervnc VNC client package. E.g.
sudo zypper install tigervnc
ssh administrator@192.168.122.117
sudo zypper install xorg-x11-Xvnc
vncpasswd
# Enter a longer than 6 characters password.
# Do not provide a "view-only password".
/usr/libexec/vncserver :1
# If you press Ctrl+C, the VNC server will stop.
</pre>
In another terminal:
<pre>
vncviewer 192.168.122.117:1
</pre>
Alternatively, you can use a single command line on the VNC client computer.
This will use an SSH tunnel, only requires access to TCP port 22 on the VNC server and starts the VNC server.
<pre>
ssh administrator@192.168.122.117 -f -L 5901:localhost:5901 "/usr/libexec/vncserver :1 ; sleep 20" && vncviewer 127.0.0.1:1
</pre>
## Alpine Linux, FreeBSD >= 14.2
## OpenBSD >= 7.5 with KDE Plasma desktop
See https://www.youtube.com/watch?v=fSXWlE0w-ow , https://www.youtube.com/watch?v=D5ohFBMzz1M
## NetBSD >= 10.0
See https://www.youtube.com/watch?v=rp7XouTq1hQ
## Oracle Solaris
See https://www.youtube.com/watch?v=i2BVx3Q6cZY
In one Konsole tab:
<pre>
# openssh server is preinstalled and already running.
# tigervnc is preinstalled.
# I can only install Solaris on virtualbox.
# Not on virt-manager/QEMU.
# In virtualbox create port forwarding rule:
# VM Settings > "Network" tab > "Adapter 1" tab > expand "Advanced" > "Port Forwarding" button.
# Add line:
# Name: "SSH", Protocol: "TCP", Host IP: 127.0.0.1, Host Port: "2222", Guest IP: "10.0.2.15", Guest Port: "22".
ssh -p 2222 administrator@127.0.0.1
vncpasswd
# Enter a longer than 6 characters password.
# Do not provide a "view-only password".
exit
</pre>
Reconnect via SSH.
<pre>
ssh -p 2222 -L 5901:localhost:5901 administrator@127.0.0.1
vncserver :1 -fg
# Wait 15 seconds for the GNOME desktop to finish starting.
</pre>
In another Konsole tab:
<pre>
vncviewer 127.0.0.1:1
</pre>
Or you can do everything in just one line, in just one GUI terminal:
<pre>
ssh -p 2222 administrator@127.0.0.1 -f -L 5901:localhost:5901 "vncserver :1 -fg ; sleep 20" && vncviewer 127.0.0.1:1
# Wait 15 seconds for the GNOME desktop to finish starting.
# vncviewer will ask if you want to reconnect.
# Once the GNOME desktop finishes starting, press the button
# in the vncviewer dialog to reconnect.
</pre>
## OpenIndiana >= 2024.04, OmniOS
See https://www.youtube.com/watch?v=YSczO6lBiAk https://www.youtube.com/watch?v=iBck-Vb_hms
## Linux containers, Docker, Podman, lxc, lxd/incus, openvz
# Linux, *BSD etc. VNC client
Install from your OS the binary package for tigervnc client.
Run:
<pre>
vncviewer --help
</pre>
Note down any of the command line parameters that you might need.
Use a command line like:
<pre>
vncviewer -via administrator@192.168.122.117 localhost::5901
</pre>
You can resize the window and the resolution of the RDP server will change correctly.
# Windows VNC server
Windows >= 10, Windows Server >= 2022. I install the TigerVNC VNC server, the file named like "tigervnc64-winvnc-X.Y.Z.exe".
# Windows VNC client
I use the TigerVNC viewer.
# Other operating systems
## macOS
See https://www.youtube.com/watch?v=qrhzrqnODik
Has a builtin non standard VNC server. https://help.ubuntu.com/community/AppleRemoteDesktop TODO: I should test the TigerVNC macOS viewer binary e.g. https://sourceforge.net/projects/tigervnc/files/stable/1.15.0/TigerVNC-1.15.0.dmg/download , "Pre-release builds of the experimental next-generation code" http://tigervnc.bphinz.com/nightly .