You are not logged in.

#1 2024-05-10 19:39:24

leonardog
Member
Registered: 2024-05-09
Posts: 5

[SOLVED] Xrdp: Can't set process group ID... [Operation not permitted]

I'm trying to setup xrdp so I can access my arch linux machine from my main windows 10 one, using the Remote Desktop client.
I have ssh acces to arch, which I'm using to set this up.
As a window manager I installed qtile, which works fine locally.

I've already installed:
xrdp 0.10.0_beta.3-1
xorgxrdp-glamor 0.10.1-1  -  I had to install this one, because xorgxrdp was giving me a key error. I understand it should work with the embedded graphics from the i5 CPU in the machine.

When connecting through rdp I get to login ok, and after about 15 seconds I get this error: https://ibb.co/D9RSZZq

This is from xrdp-sesman.log, which I think has the most relevant info for this problem.

[2024-05-10T16:41:49.386-0300] [INFO ] Socket 13: connection accepted from AF_UNIX
[2024-05-10T16:41:49.390-0300] [INFO ] Received system login request from xrdp for user: leo IP: ::ffff:192.168.0.100
[2024-05-10T16:41:49.397-0300] [INFO ] starting xrdp-sesexec with pid 135781
[2024-05-10T16:41:49.414-0300] [INFO ] TerminalServerUsers group tsusers doesn't exist. Access granted for leo
[2024-05-10T16:41:49.418-0300] [INFO ] Access permitted for user: leo
[2024-05-10T16:41:49.421-0300] [INFO ] Received sys login status for leo : logged in
[2024-05-10T16:41:49.426-0300] [INFO ] Received request from xrdp to create a session for user leo
[2024-05-10T16:41:49.504-0300] [INFO ] Starting X server on display 10: /usr/lib/Xorg :10 -auth .Xauthority -config xrdp/xorg.conf -noreset -nolisten tcp -logfile .xorgxrdp.%s.log
[2024-05-10T16:41:50.520-0300] [INFO ] X server :10 is working
[2024-05-10T16:41:50.523-0300] [INFO ] Starting window manager for display :10
[2024-05-10T16:41:50.528-0300] [INFO ] Starting the xrdp channel server for display :10
[2024-05-10T16:41:50.528-0300] [ERROR] Can't set process group ID of 135797 to 135782 [Operation not permitted]
[2024-05-10T16:41:50.532-0300] [INFO ] Session in progress on display :10. Waiting until the window manager (pid 135797) exits to end the session
[2024-05-10T16:41:50.532-0300] [ERROR] Can't set process group ID of 135798 to 135782 [Operation not permitted]
[2024-05-10T16:41:50.535-0300] [INFO ] Using the default window manager on display 10: /etc/xrdp/startwm.sh

this is my ~/.xinitrc:

#!/bin/sh

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

# merge in defaults and keymaps

if [ -f $sysresources ]; then
    xrdb -merge $sysresources
fi

if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
fi

if [ -f "$userresources" ]; then
    xrdb -merge "$userresources"
fi

if [ -f "$usermodmap" ]; then
    xmodmap "$usermodmap"
fi

# start some nice programs

if [ -d /etc/X11/xinit/xinitrc.d ] ; then
 for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
  [ -x "$f" ] && . "$f"
 done
 unset f
fi

#twm &
#xclock -geometry 50x50-1+1 &
#xterm -geometry 80x50+494+51 &
#xterm -geometry 80x20+494-0 &
#exec xterm -geometry 80x66+0+0 -name login

#startx

nitrogen --restore &
qtile start

Please let me know other relevant info I should add.

Thanks!

Last edited by leonardog (2024-05-14 22:49:18)

Offline

#2 2024-05-12 02:06:46

leonardog
Member
Registered: 2024-05-09
Posts: 5

Re: [SOLVED] Xrdp: Can't set process group ID... [Operation not permitted]

Bump: any pointers where should I look?

Please let me know if this is an epic endeavour I'm set to acomplish, since I don´t get any replies to my post.

Last edited by leonardog (2024-05-12 22:54:06)

Offline

#3 2024-05-14 19:05:21

leonardog
Member
Registered: 2024-05-09
Posts: 5

Re: [SOLVED] Xrdp: Can't set process group ID... [Operation not permitted]

Bump #2: Maybe this is too specific?

Offline

#4 2024-05-14 22:44:00

leonardog
Member
Registered: 2024-05-09
Posts: 5

Re: [SOLVED] Xrdp: Can't set process group ID... [Operation not permitted]

Finally got it working. I uninstalled xrdp and xorgxrdp and used a modified version of this script to install them again: https://gist.github.com/GregaVrbancic/7 … 82a88839ce

#
# This script is for Arch Linux to configure XRDP for enhanced session mode
#
# The configuration is adapted from the Ubuntu 16.04 script.
#
# Script adapted from https://github.com/microsoft/linux-vm-tools
#

if [ "$(id -u)" -ne 0 ]; then
    echo 'This script must be run with root privileges' >&2
    exit 1
fi

# Use Qi to check for exact package name
if ! pacman -Qi xrdp > /dev/null ; then
    echo 'xrdp not installed. Installing now...' >&2
#    sudo pacman -Syu --needed --noconfirm base base-devel git
#    yay -Syu xrdp-git --noconfirm
    sudo -u $(logname) yay -Sy --overwrite xrdp xrdp-git --noconfirm
fi

# Use Qs to allow xorgxrdp-devel-git
if ! pacman -Qs xorgxrdp > /dev/null ; then
    echo 'xorgxrdp not installed. Installing now...' >&2
#    sudo pacman -Syu --needed --noconfirm base base-devel git
#    yay -Syu xorgxrdp-git --noconfirm
    sudo -u $(logname) yay -Sy --overwrite xrdp xorgxrdp-git --noconfirm
fi

###############################################################################
# Configure XRDP
#
systemctl enable xrdp
systemctl enable xrdp-sesman

# Configure the installed XRDP ini files.
# use rdp security.
sed -i_orig -e 's/security_layer=negotiate/security_layer=rdp/g' /etc/xrdp/xrdp.ini
# remove encryption validation.
sed -i_orig -e 's/crypt_level=high/crypt_level=none/g' /etc/xrdp/xrdp.ini
# disable bitmap compression since its local its much faster
sed -i_orig -e 's/bitmap_compression=true/bitmap_compression=false/g' /etc/xrdp/xrdp.ini
#
# sed -n -e 's/max_bpp=32/max_bpp=24/g' /etc/xrdp/xrdp.ini

# use the default lightdm x display
# sed -i_orig -e 's/X11DisplayOffset=10/X11DisplayOffset=0/g' /etc/xrdp/sesman.ini
# rename the redirected drives to 'shared-drives'
sed -i_orig -e 's/FuseMountName=thinclient_drives/FuseMountName=shared-drives/g' /etc/xrdp/sesman.ini

# Change the allowed_users
echo "allowed_users=anybody" > /etc/X11/Xwrapper.config


#Ensure hv_sock gets loaded
if [ ! -e /etc/modules-load.d/hv_sock.conf ]; then
        echo "hv_sock" > /etc/modules-load.d/hv_sock.conf
fi

# Configure the policy xrdp session
cat > /etc/polkit-1/rules.d/02-allow-colord.rules <<EOF
polkit.addRule(function(action, subject) {
    if ((action.id == "org.freedesktop.color-manager.create-device" ||
         action.id == "org.freedesktop.color-manager.modify-profile" ||
         action.id == "org.freedesktop.color-manager.delete-device" ||
         action.id == "org.freedesktop.color-manager.create-profile" ||
         action.id == "org.freedesktop.color-manager.modify-profile" ||
         action.id == "org.freedesktop.color-manager.delete-profile") &&
        subject.isInGroup("users"))
    {
        return polkit.Result.YES;
    }
});
EOF

# Adapt the xrdp pam config
cat > /etc/pam.d/xrdp-sesman <<EOF
#%PAM-1.0
auth        include     system-remote-login
account     include     system-remote-login
password    include     system-remote-login
session     include     system-remote-login
EOF


###############################################################################
# .xinitrc has to be modified manually.
#
echo "You will have to configure .xinitrc to start your windows manager, see https://wiki.archlinux.org/index.php/Xinit"
echo "Basic configuration:"
echo "$ cp /etc/X11/xinit/xinitrc ~/.xinitrc"
echo "~/.xinitrc (comment or delete the default cmd twm, xclock and xterm and add your DE start cmd)"
echo "#twm &"
echo "#xclock -geometry 50x50-1+1 &"
echo "#xterm -geometry 80x50+494+51 &"
echo "#xterm -geometry 80x20+494-0 &"
echo "#exec xterm -geometry 80x66+0+0 -name login"
echo "exec dbus-run-session -- startkde (or startxfce4 or..)"
echo "Reboot your machine to begin using XRDP."

I modified it to overwrite conflicting files and to avoid root privileges when running yay commands.

Offline

Board footer

Powered by FluxBB