2

I'm trying to lean into 22.04 for my main system. Most I have worked through, but one persists.

I am using Ubuntu on Windows 11 as development system via HyperV, but to enable a seamless user experience of copy/paste, etc. I use XRDP which solves several issues via normal console: copy/paste, map local laptop drive paths, but the main issue I have to fix is to create a custom resolution, or other admin level settings where you need to "unlock" Ubuntu.

XRDP the option to manage the network does not even display unlock.

Run shell local console << DRAFT/ Broken…. issues with getting xrdp to change to what I can set via local console without Admin.. button in GNOME / Wayland>>>

xrdp session, note the screen:

penguinpages@lt-ubuntu22:~/Documents/git/github/cluster_devops$ xrandr
Screen 0: minimum 256 x 256, current 1920 x 1080, maximum 16384 x 16384
rdp0 connected primary 1920x1080+0+0 0mm x 0mm
   1920x1080     50.00* 
  1920x1440_60.00 (0x535) 233.500MHz -HSync +VSync
        h: width  1920 start 2064 end 2264 total 2608 skew    0 clock  89.53KHz
        v: height 1440 start 1443 end 1447 total 1493           clock  59.97Hz

vs local console

core@lt-ubuntu22:~$ xrandr Screen 0: minimum 16 x 16, current 1024 x 768, maximum 32767 x 32767 XWAYLAND0 connected primary 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm 1024x768 59.92*+ 800x600 59.86
640x480 59.38
320x240 59.52
720x480 59.71
640x400 59.95
320x200 58.96
1024x576 59.90
864x486 59.92
720x400 59.55
640x350 59.77
core@lt-ubuntu22:~$ cvt 1920 1080

1920x1080 59.96 Hz (CVT 2.07M9) hsync: 67.16 kHz; pclk: 173.00 MHz

Modeline "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync core@lt-ubuntu22:~$ xrandr --newmode "1920x1440_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync core@lt-ubuntu22:~$ xrandr --addmode XWAYLAND0 "1920x1440_60.00" core@lt-ubuntu22:~$ xrandr --addmode rdp0 "1920x1440_60.00" xrandr: cannot find output "rdp0"

root@lt-ubuntu22:~# cvt 1920 1440

1920x1440 59.97 Hz (CVT 2.76M3) hsync: 89.53 kHz; pclk: 233.50 MHz

Modeline "1920x1440_60.00" 233.50 1920 2064 2264 2608 1440 1443 1447 1493 -hsync +vsync root@lt-ubuntu22:~# xrandr --newmode "1920x1440_60.00" 233.50 1920 2064 2264 2608 1440 1443 1447 1493 -hsync +vsync

core@lt-ubuntu22:/etc/netplan$ sudo gnome-control-center Authorization required, but no authorization protocol specified

(gnome-control-center:3312): Gtk-CRITICAL **: 16:34:07.317: gtk_style_context_add_provider_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed Authorization required, but no authorization protocol specified

(gnome-control-center:3312): Gtk-WARNING **: 16:34:07.320: cannot open display: :10.0

Above vs. local console:

penguinpages@lt-ubuntu22:~$ sudo xrandr
Screen 0: minimum 16 x 16, current 1024 x 768, maximum 32767 x 32767
XWAYLAND0 connected primary 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   1024x768      59.92*+
   800x600       59.86  
   640x480       59.38  
   320x240       59.52  
   720x480       59.71  
   640x400       59.95  
   320x200       58.96  
   1024x576      59.90  
   864x486       59.92  
   720x400       59.55  
   640x350       59.77  
penguinpages@lt-ubuntu22:~$ sudo cvt 1920 1440
# 1920x1440 59.97 Hz (CVT 2.76M3) hsync: 89.53 kHz; pclk: 233.50 MHz
Modeline "1920x1440_60.00"  233.50  1920 2064 2264 2608  1440 1443 1447 1493 -hsync +vsync
penguinpages@lt-ubuntu22:~$ sudo xrandr --newmode "920x1440_60.00"  233.50  1920 2064 2264 2608  1440 1443 1447 1493 -hsync +vsync
penguinpages@lt-ubuntu22:~$ sudo gnome-control-center

(gnome-control-center:2783): dconf-WARNING **: 02:32:58.402: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

<no option to unlock>

Goal: to unlock Ubuntu 22.04 in GUI such that I can affect admin tasks needed in GNOME, such as to create a custom resolution for X sessions.

guiverc
  • 30,396

1 Answers1

1

Based on your description, this behavior is by design on Ubuntu when remotely connected. This behavior is controlled by Polkit software. To fix your issue, you have indeed some options,

  1. You could disable the polkit protection completely ( not recommended as you reduce security level ofyour system)

  2. Create exceptions rules that Polkit will aknowledge and let you perform the requested operation via the GUI within the remote session

  3. use command lines and sudo...CLI is alwasy working locally or remotely

As an example of exception rules, you can try to use this process and see if this is working for you. In this example, we will make the unlock button available in remote session for the User Management applet

A. Create a file called 47-allow-usr-mgt.pkla which will be created under /etc/polkit-1/localauthority/50-local.d/.

B. Inside this file, you copy the following code

[user admin]
Identity=unix-user:*
Action=org.gnome.controlcenter.user-accounts.administration
ResultAny=auth_admin_keep
ResultInactive=no
ResultActive=no

Logoff/logon on your system and try again

You can create the same type of pkla exception file for networking

A. Create a file called 47-allow-Net-mgt.pkla which will be created under /etc/polkit-1/localauthority/50-local.d/.

B. Inside the file, copy the following code

[Modify system settings for network]
Identity=unix-user:*
Action=org.freedesktop.NetworkManager.settings.modify.system
ResultAny=no
ResultInactive=no
ResultActive=yes

Again, these are examples on how to configure your system. Please adapt them as required

Hope this help Till next time See ya

Griffon
  • 2,375
  • 1
    Sorry for late response. I did add both the /etc/polkit-1/localauthority/50-local.d/ 47-allow-usr-mgt.pkla and 47-allow-Net-mgt.pkla but after shutdown and power on still no change in permissions within GUI to maintain system / unlock. Maybe I have to check if my login ID is a member of a specific group? – penguinpages Jul 05 '22 at 16:42
  • No Problem. maybe you can post a screenshot of what you are experiencing. You can also have a look at my blog that seems to describe your situation for the user management issue (read the info at https://c-nergy.be/blog/?p=17256) and tell us if this can help you. waiting for your feedback ... till next time – Griffon Jul 10 '22 at 19:03