Skip to content

Conversation

@mgajda
Copy link
Contributor

@mgajda mgajda commented Dec 14, 2025

Implements upctl server console to connect to server VNC console.

Features:

  • Auto-detects TigerVNC, RealVNC, or macOS Screen Sharing
  • Secure password handling via temporary files (never in CLI args)
  • Supports --fullscreen, --view-only, and --viewer flags
  • Cleanup on interrupt (Ctrl+C)

Example:

upctl server console myserver
upctl server console 00038afc-e100-4e91-9d28-b9c463e7e9b4 --fullscreen

Implements `upctl server console` command to connect to server VNC console.

Features:
- Auto-detects TigerVNC, RealVNC, or macOS Screen Sharing
- Secure password handling via temporary files (never exposed in CLI args)
- Supports --fullscreen and --view-only flags
- --viewer flag to specify preferred VNC client
- Cleanup on interrupt (Ctrl+C)

Example usage:
  upctl server console myserver
  upctl server console 00038afc-e100-4e91-9d28-b9c463e7e9b4 --fullscreen
Adds support for:
- Remmina (Linux/GNOME) - prompts for password interactively
- macOS Screen Sharing (built-in) - prompts for password interactively

TigerVNC and RealVNC support secure password files.
Remmina and macOS Screen Sharing will prompt users to enter the password
displayed by upctl.

Note: Windows VNC clients (UltraVNC, TightVNC) do not support secure
password files and would expose passwords in command line arguments,
so they are not included. Windows users should use TigerVNC.
Password is now only displayed when explicitly requested with --show-password.
When using Remmina or macOS Screen Sharing (which require manual password
entry), the tool will prompt the user to use --show-password flag.

This prevents accidental password exposure while still supporting clients
that need manual password entry.
Client detection now prefers platform-native clients:
- macOS: Built-in Screen Sharing → TigerVNC → RealVNC
- Linux: Remmina → TigerVNC → RealVNC
- Windows: TigerVNC → RealVNC

This provides better UX by defaulting to clients users are more likely
to have installed on each platform.
When no VNC client is found, provide actionable installation commands:
- Ubuntu/Debian: apt-get install remmina-plugin-vnc tigervnc-viewer
- Fedora/RHEL/CentOS: dnf install remmina tigervnc
- Arch: pacman -S remmina tigervnc
- macOS: Note about built-in Screen Sharing, or brew install
- Windows: Download links for TigerVNC and RealVNC

Includes Linux distro detection via /etc/os-release and comprehensive
fallback for generic Linux with commands for all major distributions.
- Remmina now supports --enable-fullscreen flag for fullscreen mode
- Remmina now supports --set-option ViewOnly=1 for view-only mode
- macOS Screen Sharing does not support these flags (noted in comments)
- TigerVNC and RealVNC already had proper support
Testing revealed:
- Remmina supports --enable-fullscreen
- Remmina does NOT support view-only flag (no CLI option)
- macOS Screen Sharing does not support fullscreen/viewonly
- TigerVNC and RealVNC support both flags

Updated flag descriptions and removed invalid --set-option usage
@mgajda mgajda requested a review from a team as a code owner December 14, 2025 20:23
@mgajda mgajda changed the title feat: Add VNC console access command DRAFT: feat: Add VNC console access command Dec 14, 2025
@mgajda mgajda changed the title DRAFT: feat: Add VNC console access command feat: Add VNC console access command Dec 14, 2025
@mgajda mgajda marked this pull request as draft December 14, 2025 20:54
…nd RealVNC

VNC clients expect host::port format for explicit port numbers, not host:port.
The single colon format is for display numbers (e.g., :0, :1).

This fixes connection issues when VNC runs on non-standard ports like 27132.
Use github.com/KarpelesLab/vncpasswd library for correct VNC password file
encryption using DES with bit-reversed keys as per VNC specification.

VNC authentication now works successfully - tested with TigerVNC connecting
to UpCloud VNC console and verified with pixel format negotiation.

Changes:
- Added vncpasswd library dependency (github.com/KarpelesLab/vncpasswd)
- Use vncpasswd.Crypt() for proper DES encryption
- VNC clients (TigerVNC, RealVNC) now authenticate automatically
- Tested successful connection with pixel format negotiation
- Removed previous interactive password entry fallback

Sources:
- https://github.com/KarpelesLab/vncpasswd
- https://www.vidarholen.net/contents/junk/vnc.html
Add explicit documentation that VNC console works on:
- macOS (built-in Screen Sharing, TigerVNC, RealVNC)
- Linux (Remmina, TigerVNC, RealVNC)
- WSL (Linux VNC clients work via WSLg)
- Windows native (TigerVNC, RealVNC)

Changes:
- Updated command description to list all supported platforms
- Added WSL-specific installation comments
- Clarified Windows native client download links
- Made platform support more visible to users
Remove tmp/ directory and markdown summary files that were accidentally
committed in previous commit.
@mgajda
Copy link
Contributor Author

mgajda commented Dec 15, 2025

To securely pass the password to VNC client I added a library import.
It is up to maintainer to decide whether the feature is worth it.

@mgajda mgajda marked this pull request as ready for review December 15, 2025 07:38
Prevent temporary files from being accidentally committed.
The .gitignore file was accidentally modified, changing .release_notes to
.release_notestmp/ which was incorrect. Reverting to upstream version.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant