Installing TigerVNC in Ubuntu 24.04
Ubuntu 24.04 supports RPD protocol but it behaves in a way that is not fit for my needs. The Desktop Sharing mode needs to have a user logged in or set to automatically login on reboot. Anyone will have access to your desktop if they are physically present. The Remote Login would have been the best option but when the connection is lost, all applications running on that session are gone. So you can't reconnect to that same session.So, we are back to the tried and tested VNC protocol. To get TigerVNC working on Ubuntu 24.04 is a little tricky due to Wayland becoming the default in 24.04. To workaround Wayland, we need to install XFCE, like so:
$ sudo apt install --no-install-recommends xubuntu-desktop
Install xfce4-terminal for convenience. GNOME-Terminal is pretty heavy and uxterm/xterm are not to my liking.
$ sudo apt install xfce4-terminal
$ sudo apt install tigervnc-standalone-server
$ vncpasswd
$ sudo vim /etc/tigervnc/vncserver.users
# TigerVNC User assignment # # This file assigns users to specific VNC display numbers. # The syntax is <display>=<username>. E.g.: # # :2=andrew # :3=lisa :2=u1
$ vncserver -geometry=1360x768 -xstartup /usr/bin/startxfce4 :2 -localhost no
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add-Type -AssemblyName System.Windows.Forms; | |
$wa = [System.Windows.Forms.Screen]::PrimaryScreen.WorkingArea | |
$titleBarHeight = [System.Windows.Forms.SystemInformation]::CaptionHeight | |
$offset = 16 | |
$w = $wa.Height - $titleBarHeight - $offset | |
$h = $wa.Width - $offset | |
Write-Host "$($h)x$($w)" |
$ vncserver -kill :2
There is a big caveat that I haven't figured out, yet. No user should be logged in to the console/physical session. Otherwise, everything goes crazy.
References:
https://medium.com/oracledevs/your-next-developer-desktop-with-ubuntu-24-04-and-tigervnc-on-oci-d0356ffa0cf9
No comments:
Post a Comment