@@ -33099,18 +33099,31 @@ VNC Services
@lisp
(service xvnc-service-type
- (xvnc-configuration (display-number 10)))
+ (xvnc-configuration (display-number 5)))
@end lisp
As a demonstration, the @command{xclock} command could then be started
on the remote machine on display number 10, and it could be displayed
-locally via the @command{vncviewer} command:
+locally using the SSH tunneling mechanism, via the @command{vncviewer}
+command:
@example
-# Start xclock on the remote machine.
-ssh -L5910:localhost:5910 @var{your-host} -- guix shell xclock \
- -- env DISPLAY=:10 xclock
-# Access it via VNC.
-guix shell tigervnc-client -- vncviewer localhost:5910
+## Start xclock on the remote machine.
+default_vnc_port=5900
+display_port=@var{display-number}
+
+# SSH (t)unnel (i)nterface on the (r)emote machine.
+tri=localhost
+# SSH (t)unnel (r)emote (p)ort.
+trp=$[$default_vnc_port + $display_port]
+# SSH (t)unnel (l)ocal (p)ort.
+tlp=$[$trp + 1]
+
+ssh -L$tlp:$tri:$trp @var{your-host} -- \
+ guix shell xclock -- \
+ env DISPLAY=:$display_port xclock
+
+## Access xclock via VNC.
+guix shell tigervnc-client -- vncviewer localhost:$tlp
@end example
The following configuration combines XDMCP and Inetd to allow multiple
@@ -33138,6 +33151,7 @@ VNC Services
command or a compatible VNC client and start a desktop session of their
choosing:
@example
+# 5905 = default VNC port + @var{display-number} specified above
vncviewer remote-host:5905
@end example