neutrinolabs / pulseaudio-module-xrdp

xrdp sink / source pulseaudio modules
GNU Lesser General Public License v2.1
211 stars 40 forks source link

Can't compile pulseaudio in Ubuntu 20.04 #72

Closed kujaska closed 2 years ago

kujaska commented 2 years ago

Hi! I'm trying to compile pulseaudio in Ubuntu 20.04 using this guide https://github.com/neutrinolabs/pulseaudio-module-xrdp/wiki/Build-on-Debian-or-Ubuntu

user@user-VirtualBox:/pulseaudio-module-xrdp$ sudo scripts/install_pulseaudio_sources_apt_wrapper.sh 
- Creating focal build root. Log file in /var/tmp/pa-build-root-debootstrap.log
- Creating schroot config file /etc/schroot/chroot.d/pa-build-root.conf
- Copying /etc/apt/sources.list to the root
- Copying the wrapped script to the root
- Building PA sources. Log file in /var/tmp/pa-build-root-schroot.log
** schroot failed. Check log file
user@user-VirtualBox:/pulseaudio-module-xrdp$ cat /var/tmp/pa-build-user-schroot.log
E: Failed to change to directory ‘/pulseaudio-module-xrdp’: No such file or directory
I: The directory does not exist inside the chroot.  Use the --directory option to run the command in a different directory.
E: Failed to change to directory ‘/pulseaudio-module-xrdp’: No such file or directory
I: The directory does not exist inside the chroot.  Use the --directory option to run the command in a different directory.
E: Failed to change to directory ‘/pulseaudio-module-xrdp’: No such file or directory
I: The directory does not exist inside the chroot.  Use the --directory option to run the command in a different directory.
E: Failed to change to directory ‘/pulseaudio-module-xrdp’: No such file or directory
I: The directory does not exist inside the chroot.  Use the --directory option to run the command in a different directory.
user@user-VirtualBox:/pulseaudio-module-xrdp$ 

please help...

kujaska commented 2 years ago

P.S. I run the script above thru mstsc-to-xrdp remote desktop session. May this be the cause? Should I run it from Virtualbox native window from Virtualbox host machine?

matt335672 commented 2 years ago

@kujaska

The scripts use $USER to determine the username in places. It looks like on your system USER is set to root rather than the actual user name.

We should probably cater for this, so I'd like to find out more about your environment. Can you give me the outputs of these 3 commands in your build environment please?

env | sort
id
cat /proc/$$/status | grep ^[UG]id:

Thanks.

matt335672 commented 2 years ago

Scrub the above - I've just realised your problem is here:-

$ sudo scripts/install_pulseaudio_sources_apt_wrapper.sh 

This script is not supposed to be run sudo - it uses sudo as necessary while it is running.

Try without the sudo and let us know how it goes.

kujaska commented 2 years ago

I tried both options - with the same result "** schroot failed. Check log file", first time - without sudo, and no password was requested during script execution, second - with sudo as I thought the script needs it...

matt335672 commented 2 years ago

Please show the log you get without sudo, and we'll go from there.

kujaska commented 2 years ago

ok, here it is:

user@user-VirtualBox:/$ cd pulseaudio-module-xrdp user@user-VirtualBox:/pulseaudio-module-xrdp$ scripts/install_pulseaudio_sources_apt_wrapper.sh

user@user-VirtualBox:/pulseaudio-module-xrdp$ cat /var/tmp/pa-build-user-schroot.log E: Failed to change to directory ‘/pulseaudio-module-xrdp’: No such file or directory I: The directory does not exist inside the chroot. Use the --directory option to run the command in a different directory. E: Failed to change to directory ‘/pulseaudio-module-xrdp’: No such file or directory I: The directory does not exist inside the chroot. Use the --directory option to run the command in a different directory. E: Failed to change to directory ‘/pulseaudio-module-xrdp’: No such file or directory I: The directory does not exist inside the chroot. Use the --directory option to run the command in a different directory. E: Failed to change to directory ‘/pulseaudio-module-xrdp’: No such file or directory I: The directory does not exist inside the chroot. Use the --directory option to run the command in a different directory.

but the directory exists: user@user-VirtualBox:/pulseaudio-module-xrdp$ cd /pulseaudio-module-xrdp user@user-VirtualBox:/pulseaudio-module-xrdp$ ls bootstrap configure.ac instfiles LICENSE Makefile.am README.md scripts src

kujaska commented 2 years ago

may it be I get wrong script by git clone https://github.com/neutrinolabs/pulseaudio-module-xrdp.git command?

mine scripts/install_pulseaudio_sources_apt_wrapper.sh contains this:


#!/bin/sh
#
# xrdp: A Remote Desktop Protocol server.
#
# Copyright (C) 2021 Matt Burt, all xrdp contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# Wrapper to call install_pulseaudio_sources.sh and tidy up afterwards

# ---------------------------------------------------------------------------
# G L O B A L S
# ---------------------------------------------------------------------------
# Where the output files are going. Must be under $HOME as schroot
# assumes this.
PULSE_DIR=$HOME/pulseaudio.src

# Absolute path to the script we're wrapping. This picks it up from
# the same directory this file is in
WRAPPED_SCRIPT=$(cd $(dirname $0) && pwd)/install_pulseaudio_sources_apt.sh

# The buildroot directory. Choose fast, temporary storage if available
BUILDROOT=/var/lib/pa-build/$USER

# Extra packages to install in the build root which the wrapped script
# may be using. These are packages available by default when using
# GitHub actions
WRAPPED_SCRIPT_DEPS="sudo lsb-release"

# -----------------------------------------------------------------------------
# I N S T A L L   R E Q U I R E D   P A C K A G E S
#
# Installs packages required for the build on the host machine
# -----------------------------------------------------------------------------
InstallRequiredPackages()
{
    set -- \
        /usr/sbin/debootstrap   debootstrap \
        /usr/bin/schroot        schroot \
        /usr/bin/lsb_release    lsb-release

    pkgs=
    while [ $# -ge 2 ]; do
        if [ ! -x $1 ]; then
            pkgs="$pkgs $2"
        fi
        shift 2
    done

    if [ -n "$pkgs" ]; then
        echo "- Need to install packages :$pkgs"
        echo
        echo "  These can be removed when this script completes with:-"
        echo "  sudo apt-get purge$pkgs && apt-get autoremove"
        echo
        sudo apt-get install -y $pkgs
    fi
}

# -----------------------------------------------------------------------------
# R U N   W R A P P E D   S C R I P T
#
# Runs the wrapped build script using schroot
#
# This function definition uses () rather than {} to create an extra
# sub-process where we can run 'set -e' without affecting the parent
# -----------------------------------------------------------------------------
RunWrappedScript()
(
    # In this sub-process, fail on error
    set -e

    # Install extra dependencies
    schroot -c pa-build-$USER -u root -- \
        apt-get install -y $WRAPPED_SCRIPT_DEPS

    # Allow normal user to sudo without a password
    schroot -c pa-build-$USER -u root -- \
        /bin/sh -c "echo '$USER ALL=(ALL) NOPASSWD:ALL'>/etc/sudoers.d/nopasswd-$USER"
    schroot -c pa-build-$USER -u root -- chmod 400 /etc/sudoers.d/nopasswd-$USER

    # Call the wrapped script
    schroot -c pa-build-$USER -- /wrapped_script -d $PULSE_DIR
)

# -----------------------------------------------------------------------------
# M A I N
# -----------------------------------------------------------------------------

# Start with a few sanity checks
if [ -d $PULSE_DIR ]; then
    echo "** Target directory $PULSE_DIR already exists" >&2
    exit 0
fi

if [ ! -x $WRAPPED_SCRIPT ]; then
    echo "** Can't find wrapped script $WRAPPED_SCRIPT" >&2
    exit 1
fi

if [ -e $BUILDROOT ]; then
    echo "** Remove old build root $BUILDROOT before running this script"
    exit 1
fi

# Do we need extra packages?
InstallRequiredPackages || exit $?

# We should be able to determine the distro now
distro=$(lsb_release -cs) ; # e.g. 'bullseye'
if [ -z "$distro" ]; then
    echo "** Can't determine current distro" >&2
    exit 1
fi

# Create the build root
log=/var/tmp/pa-build-$USER-debootstrap.log
echo "- Creating $distro build root. Log file in $log"
sudo debootstrap $distro $BUILDROOT >$log 2>&1 || {
    echo "** debootstrap failed. Check log file" >&2
    exit 1
}

# Create the config file for schroot
schroot_conf=/etc/schroot/chroot.d/pa-build-$USER.conf
echo "- Creating schroot config file $schroot_conf"
{
    echo "[pa-build-$USER]"
    echo "description=Build PA on current system for $USER"
    echo "directory=$BUILDROOT"
    echo "root-users=$USER"
    echo "users=$USER"
    echo "type=directory"
} | sudo tee $schroot_conf >/dev/null || exit $?

# Copy some files to the build root
for file in /etc/apt/sources.list; do
    echo "- Copying $file to the root"
    sudo cp $file $BUILDROOT/$file || exit $?
done

# Copy the wrapped script to the buildroot root
echo "- Copying the wrapped script to the root"
sudo cp $WRAPPED_SCRIPT $BUILDROOT/wrapped_script || exit $?
sudo chmod +x $BUILDROOT/wrapped_script || exit $?

# Run the wrapped script
log=/var/tmp/pa-build-$USER-schroot.log
echo "- Building PA sources. Log file in $log"
RunWrappedScript >$log 2>&1 || {
    echo "** schroot failed. Check log file" >&2
    exit 1
}

# Done! Remove the schroot config file as its no longer needed
echo "- Removing schroot config file and build root"
sudo rm -rf $schroot_conf $BUILDROOT

echo "- All done. Configure PA xrdp module with PULSE_DIR=$PULSE_DIR"
exit 0
matt335672 commented 2 years ago

The script is fine.

It looks to me that you're trying to build this in a directory under the file system root. You must be running the script under the home directory of the user, or it won't work. The instructions don't make this at all clear.

If you're using user user with a home directory of /home/user, try running the script in any directory under /home/user.

kujaska commented 2 years ago

isn't this a home dir?.. user@user-VirtualBox:~$ pwd /home/user

user@user-VirtualBox:~$ ls pulseaudio-module-xrdp

kujaska commented 2 years ago

tried to move pulseaudio-module-xrdp to subdir test and it finally worked: user@user-VirtualBox:~/test/pulseaudio-module-xrdp$ scripts/install_pulseaudio_sources_apt_wrapper.sh

kujaska commented 2 years ago

now I have:

/home/user/pulseaudio.src directory

tried to do next step: Build the xrdp pulseaudio module ./bootstrap && ./configure PULSE_DIR=~/pulseaudio.src make

bootstrap file contents:

#!/bin/sh
autoreconf -ivf

dir contents:

user@user-VirtualBox:~/test/pulseaudio-module-xrdp$ ls
bootstrap     instfiles  Makefile.am  scripts
configure.ac  LICENSE    README.md    src
matt335672 commented 2 years ago

Try this:-

sudo apt install build-essential autotools-dev libpulse-dev

then:-

./bootstrap && ./configure PULSE_DIR=~/pulseaudio.src
kujaska commented 2 years ago

ok, autotools installed OK, but the same error:

user@user-VirtualBox:~/test/pulseaudio-module-xrdp$ ./bootstrap && ./configure PULSE_DIR=~/pulseaudio.src
./bootstrap: 2: autoreconf: not found
metalefty commented 2 years ago

Install all tools used in bootstrap script, then proceed to next.

matt335672 commented 2 years ago
sudo apt install autoconf libtool

It seems these were installed by default on bionic, but no longer on focal.

I've updated the wiki page and run through it with a fresh installation of Focal server.

I'm unable to reproduce the earlier problem you had. I've been explicit about starting in the user home directory, and that works OK here.

kujaska commented 2 years ago

sudo apt install autoconf libtool

thanks a lot, that helped - I've successfully run bootstrap and the rest of the guide.

Finally this command

ls $(pkg-config --variable=modlibexecdir libpulse) | grep xrdp

shows module-xrdp-sink.so and module-xrdp-source.so - i.e. PulseAudio modules are properly built and installed.

BUT... remember, I run Ubuntu inside Virtualbox as a guest OS? Host OS is Windows 10 x64 home. So, results are not as expected:

a) I can hear the sound on Host PC (where Win 10 runs Virtualbox which in turn runs Ubuntu virtual machine with all the xrdp parts inside) if I run it as usual (in Virtualbox window), here I see a sound device ('analog audio - output' or something close to that as I have to translate it from russian locale) in Ubuntu settings. As far as I remember there was no any sound issue here without this pulseaudio shamanism.

b) BUT the goal is to open the session to that Ubuntu virtual machine from a remote PC (in same LAN) and get sound on that remote PC - still no luck here: if I do that by mstsc I get sound on the Host PC (in another room, funny, isn't it?) P.S. I start Ubuntu virtual machine in Virtualbox headless mode so that no Virtualbox window is opened on Host PC. AND I do not see any sound device in Ubuntu settings if connected as a remote session

Any ideas what to do next?

P.P.S. sorry for my stupid questions but I'm new to Linux...

matt335672 commented 2 years ago

They really aren't stupid questions. Pulseaudio is complicated. With the last release we've tried to make things simpler, but it's not easy to get it right first time.

There's a script which make install should have installed in /usr/libexec/pulseaudio-module-xrdp/load_pa_modules.sh which runs when you log in to xrdp. The job of this script is to load the xrdp modules into pulseaudio and make them the default ones for the user. For some reason that script doesn't seem to be working.

After building the modules, you need to have log out of your xrdp session and in again. This will trigger the automatic running of the script.

Assuming you've done that and sound is still misbehaving, try entering the command /usr/libexec/pulseaudio-module-xrdp/load_pa_modules.sh in your xrdp session and see what happens.

kujaska commented 2 years ago

thanx! I can see the load_pa_modules.sh in correct directory:

user@user-VirtualBox:~$ cd /usr/libexec/pulseaudio-module-xrdp
user@user-VirtualBox:/usr/libexec/pulseaudio-module-xrdp$ ls
load_pa_modules.sh

but if I run it under xrdp session I get this (translated from russian error output by google):

user @ user-VirtualBox: ~ $ /usr/libexec/pulseaudio-module-xrdp/load_pa_modules.sh
Connection error: Connection rejected
An error occurred while executing pa_context_connect (): Connection refused
? Can't load pulseaudio xrdp-sink
Connection error: Connection rejected
An error occurred while executing pa_context_connect (): Connection refused
? Can't load pulseaudio xrdp-source
matt335672 commented 2 years ago

Interesting.

Depending on how your system is set up, you may be able to get something in English without translation with this command:-

LANG=C /usr/libexec/pulseaudio-module-xrdp/load_pa_modules.sh

Have you get any audio devices added to the VirtualBox VM? If so, try removing them so we've got as simple a setup as possible.

kujaska commented 2 years ago

Almost the same:

user@user-VirtualBox:~$ LANG=C /usr/libexec/pulseaudio-module-xrdp/load_pa_modules.sh
Connection failure: Connection refused
pa_context_connect() failed: Connection refused
? Can't load pulseaudio xrdp-sink
Connection failure: Connection refused
pa_context_connect() failed: Connection refused
? Can't load pulseaudio xrdp-source

Have you get any audio devices added to the VirtualBox VM?

What do you mean / how to check that? I tried to disable audio in Audio tab in virtualbox VM settings window - result is the same

matt335672 commented 2 years ago

I don't have VirtualBox here I'm afraid, so I can't answer that particular question. On the virtualisation systems I've used there's generally a way to configure the devices in the VM. Maybe 'disable Audio' does that.

One thing - you need to enter the command in the xrdp session, not in a separate session.

Assuming you're doing that, let's have a check of a few things 1) What desktop are you running? 2) What is the output of ps -ef | grep pulseaudio?

Thanks.

kujaska commented 2 years ago
user@user-VirtualBox:~$ ps -ef | grep pulseaudio
user         806     797  0 20:41 ?        00:00:00 /usr/bin/pulseaudio --daemonize=no --log-target=journal
user        3895    3883  0 20:43 pts/0    00:00:00 grep --color=auto pulseaudio

What desktop are you running?

How to identify that? .. remember, I'm new to Linux ;) i.e. I can say that I did not change anything in Focal default software except installing Opera browser

In remote session from mstsc I login with Xorg option

kujaska commented 2 years ago

And finally I can't login to xrdp session for some reason - after connecting from mstsc I login with Xorg option and get Ubuntu lock screen: image

from regular virtualbox window (without xrdp) VM works fine... reboots do not help...

matt335672 commented 2 years ago

Are you logged in at the machine console on the same user - that will do it. Modern Linux systems don't support having the same user logged in on the console and also on xrdp. That wasn't our design decision by the way - it's forced on us by the way systemd --user works.

matt335672 commented 2 years ago

Can you also give me the output of env | sort from your terminal in the xrdp session?

kujaska commented 2 years ago

Are you logged in at the machine console on the same user - that will do it. Modern Linux systems don't support having the same user logged in on the console and also on xrdp.

I do not quite understand what is machine console (is it a terminal window?), but I can tell you that:

1) there were cases when I:

2) now I have rebooted and fully shut down that VM from VBox UI several times - and still get Ubuntu lock screen in xrdp session which I can't bypass (screenshot from yesterday) - is it due to 'machine console logged in'? what should I do to log off?..

kujaska commented 2 years ago

ok somehow xrdp allowed me to connect to VM today

this is from mstsc running on host PC (connect to xrdp in VM @ 127.0.0.2):

user@user-VirtualBox:~$ env | sort
_=/bin/env
COLORTERM=truecolor
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-67XUTAbvo3,guid=eec7738591c897aac5f6ce3961dd4913
DISPLAY=:10.0
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
GNOME_KEYRING_CONTROL=/home/user/.cache/keyring-HMCDF1
GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/5d77478f_569f_4b87_bb6e_46ae0fab5a81
GNOME_TERMINAL_SERVICE=:1.91
GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1
GTK_MODULES=gail:atk-bridge
HOME=/home/user
LANG=ru_RU.UTF-8
LESSCLOSE=/bin/lesspipe %s %s
LESSOPEN=| /bin/lesspipe %s
LOGNAME=user
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
PATH=/sbin:/bin:/usr/bin:/usr/local/bin:/snap/bin
PULSE_SCRIPT=/etc/xrdp/pulse/default.pa
PWD=/home/user
QT_ACCESSIBILITY=1
QT_IM_MODULE=ibus
SESSION_MANAGER=local/user-VirtualBox:@/tmp/.ICE-unix/3124,unix/user-VirtualBox:/tmp/.ICE-unix/3124
SHELL=/bin/bash
SHLVL=0
SSH_AGENT_PID=3312
SSH_AUTH_SOCK=/home/user/.cache/keyring-HMCDF1/ssh
TERM=xterm-256color
UID=1000
USER=user
VTE_VERSION=6003
XDG_CURRENT_DESKTOP=GNOME
XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share:/usr/share:/var/lib/snapd/desktop
XDG_MENU_PREFIX=gnome-
XDG_SESSION_CLASS=user
XDG_SESSION_TYPE=x11
XMODIFIERS=@im=ibus
XRDP_PULSE_SINK_SOCKET=xrdp_chansrv_audio_out_socket_10
XRDP_PULSE_SOURCE_SOCKET=xrdp_chansrv_audio_in_socket_10
XRDP_SESSION=1
XRDP_SOCKET_PATH=/run/xrdp/sockdir

this is from mstsc running on remote PC (connect to xrdp in VM @ 192.168.0.1 (host PC ip)) - slightly different (but if I understand that right it should be different):

user@user-VirtualBox:~$ env | sort
_=/bin/env
COLORTERM=truecolor
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-IkXwaMuy4U,guid=eaaf6ab0dc5fa1f3b9ce557b61dd4d11
DISPLAY=:10.0
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
GNOME_KEYRING_CONTROL=/home/user/.cache/keyring-ZROJF1
GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/9641367f_aa6f_436e_a58d_da35babbab8c
GNOME_TERMINAL_SERVICE=:1.80
GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1
GTK_MODULES=gail:atk-bridge
HOME=/home/user
LANG=ru_RU.UTF-8
LESSCLOSE=/bin/lesspipe %s %s
LESSOPEN=| /bin/lesspipe %s
LOGNAME=user
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
PATH=/sbin:/bin:/usr/bin:/usr/local/bin:/snap/bin
PULSE_SCRIPT=/etc/xrdp/pulse/default.pa
PWD=/home/user
QT_ACCESSIBILITY=1
QT_IM_MODULE=ibus
SESSION_MANAGER=local/user-VirtualBox:@/tmp/.ICE-unix/2049,unix/user-VirtualBox:/tmp/.ICE-unix/2049
SHELL=/bin/bash
SHLVL=0
SSH_AGENT_PID=2148
SSH_AUTH_SOCK=/home/user/.cache/keyring-ZROJF1/ssh
TERM=xterm-256color
UID=1000
USER=user
VTE_VERSION=6003
XDG_CURRENT_DESKTOP=GNOME
XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share:/usr/share:/var/lib/snapd/desktop
XDG_MENU_PREFIX=gnome-
XDG_SESSION_CLASS=user
XDG_SESSION_TYPE=x11
XMODIFIERS=@im=ibus
XRDP_PULSE_SINK_SOCKET=xrdp_chansrv_audio_out_socket_10
XRDP_PULSE_SOURCE_SOCKET=xrdp_chansrv_audio_in_socket_10
XRDP_SESSION=1
XRDP_SOCKET_PATH=/run/xrdp/sockdir
matt335672 commented 2 years ago

Let's get the machine console cleared up first, and then look at pulse - these may be related problems.

The 'machine console' for a physical machine would be the keyboard, monitor and mouse connected to it.

In the virtual world, this will be whatever virtualbox provides instead of that.

You won't be able to log into the machine via virtualbox and xrdp at the same time with the same user because of the way systemd --user works, which we have no control over. If that is absolutely a requirement you will have to use a non-systemd distribution.

By default Firefox checks whether it is running by looking for files in the home directory (on your system, in /home/user/.mozilla). If you're using the same user from virtualbox and xrdp, this will happen too.

So what I suggest you do (if your use-case allows for it) is to set up a user for using the machine from VirtualBox and set up a user for using the machine from xrdp. When that's done, and you're happy with it, we can get back to the pulseaudio problem.

Does that make sense?

kujaska commented 2 years ago

yes, thanx, I need a single user session, I'm happy with it, so let's continue with audio, please see ENV in my previous post

matt335672 commented 2 years ago

This looks a bit suspect to me:-

DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-IkXwaMuy4U,guid=eaaf6ab0dc5fa1f3b9ce557b61dd4d11

also, XDG_RUNTIME_DIR is missing.

I'd expect something like:-

DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
. . .
XDG_RUNTIME_DIR=/run/user/1000

What do you get for these commands?

systemctl --user show-environment | sort
find /etc -type f -exec grep -l DBUS_SESSION_BUS_ADDRESS {} + 2>/dev/null
grep DBUS_SESSION_BUS_ADDRESS ~/.bash* ~/.profile

Thanks.

kujaska commented 2 years ago

ok:


user@user-VirtualBox:~$ systemctl --user show-environment | sort
Failed to get environment: Process org.freedesktop.systemd1 exited with status 1
user@user-VirtualBox:~$ find /etc -type f -exec grep -l DBUS_SESSION_BUS_ADDRESS {} + 2>/dev/null
/etc/xrdp/startwm.sh
/etc/X11/Xsession.d/75dbus_dbus-launch
/etc/X11/Xsession.d/20dbus_xdg-runtime
/etc/X11/Xsession.d/95dbus_update-activation-env
user@user-VirtualBox:~$ grep DBUS_SESSION_BUS_ADDRESS ~/.bash* ~/.profile
user@user-VirtualBox:~$ 
matt335672 commented 2 years ago

I thought I'd replied to this, but it looks like I must have closed my window without saving edits. Sorry for the delay.

That first command failing is pretty bad. The pulseaudio server is started by systemd --user on Ubuntu 20.04. It looks like pam_systemd.so is not getting called when you log in.

Thanks.

kujaska commented 2 years ago

Hi!

Have you done anything you're aware of to disable parts of systemd?

No

Assuming you haven't, what are the contents of these files? /etc/pam.d/xrdp-sesman

#%PAM-1.0
@include common-auth
@include common-account
@include common-session
@include common-password

/etc/pam.d/common-session

#

/etc/pam.d/common-session - session-related modules common to all services

#

This file is included from other service-specific PAM config files,

and should contain a list of modules that define tasks to be performed

at the start and end of sessions of any kind (both interactive and

non-interactive).

#

As of pam 1.0.1-6, this file is managed by pam-auth-update by default.

To take advantage of this, it is recommended that you configure any

local modules either before or after the default block, and use

pam-auth-update to manage selection of other modules. See

pam-auth-update(8) for details.

here are the per-package modules (the "Primary" block)

session [default=1] pam_permit.so

here's the fallback if no module succeeds

session requisite pam_deny.so

prime the stack with a positive return value if there isn't one already;

this avoids us returning an error just because nothing sets a success code

since the modules above will each just jump around

session required pam_permit.so

The pam_umask module will set the umask according to the system default in

/etc/login.defs and user settings, solving the problem of different

umask settings with different shells, display managers, remote sessions etc.

See "man pam_umask".

session optional pam_umask.so

and here are more per-package modules (the "Additional" block)

session required pam_unix.so session optional pam_systemd.so

end of pam-auth-update config

>What do you get for this command?
>ls -l /lib/*/security/pam_systemd.so

user@user-VirtualBox:~$ ls -l /lib/*/security/pam_systemd.so -rw-r--r-- 1 root root 475944 sep 7 21:37 /lib/x86_64-linux-gnu/security/pam_systemd.so

matt335672 commented 2 years ago

That all looks OK.

Can you log out completely from xrdp, log in again and generate a complete system log with:-

sudo journalctl -S -1m

The switches limit the log to the last minute to cut the output down.

Also, get a general health state of the system with:-

sudo systemctl list-units --state=failed
kujaska commented 2 years ago

I have rebooted ubuntu just before these commands:

user@user-VirtualBox:~$ sudo journalctl -S -1m
[sudo] пароль для user: 
-- Logs begin at Wed 2021-11-10 20:38:34 MSK, end at Thu 2022-01-13 20:13:47 MS>
jan 13 20:12:48 user-VirtualBox tracker-store[910]: OK
jan 13 20:12:48 user-VirtualBox systemd[774]: tracker-store.service: Succeeded.
jan 13 20:12:49 user-VirtualBox systemd[1]: systemd-hostnamed.service: Succeede>
jan 13 20:12:49 user-VirtualBox systemd[1]: systemd-localed.service: Succeeded.
jan 13 20:12:50 user-VirtualBox systemd[1]: fprintd.service: Succeeded.
jan 13 20:12:51 user-VirtualBox systemd[1]: systemd-timedated.service: Succeede>
jan 13 20:12:58 user-VirtualBox xrdp[758]: (758)(140144810325824)[INFO ] Socket>
jan 13 20:12:58 user-VirtualBox xrdp[758]: (758)(140144810325824)[DEBUG] Closed>
jan 13 20:12:58 user-VirtualBox xrdp[1270]: (1270)(140144810325824)[DEBUG] Clos>
jan 13 20:12:58 user-VirtualBox xrdp[1270]: (1270)(140144810325824)[INFO ] Usin>
jan 13 20:12:58 user-VirtualBox xrdp[1270]: (1270)(140144810325824)[INFO ] Usin>
jan 13 20:12:58 user-VirtualBox xrdp[1270]: (1270)(140144810325824)[DEBUG] TLSv>
jan 13 20:12:58 user-VirtualBox xrdp[1270]: (1270)(140144810325824)[DEBUG] TLSv>
jan 13 20:12:58 user-VirtualBox xrdp[1270]: (1270)(140144810325824)[DEBUG] Secu>
jan 13 20:12:58 user-VirtualBox xrdp[1270]: (1270)(140144810325824)[DEBUG] Clos>
jan 13 20:12:58 user-VirtualBox xrdp[758]: (758)(140144810325824)[INFO ] Socket>
jan 13 20:12:58 user-VirtualBox xrdp[758]: (758)(140144810325824)[DEBUG] Closed>
jan 13 20:12:58 user-VirtualBox xrdp[1271]: (1271)(140144810325824)[DEBUG] Clos>
jan 13 20:12:58 user-VirtualBox xrdp[1271]: (1271)(140144810325824)[INFO ] Usin>
jan 13 20:12:58 user-VirtualBox xrdp[1271]: (1271)(140144810325824)[INFO ] Usin>
jan 13 20:12:58 user-VirtualBox xrdp[1271]: (1271)(140144810325824)[DEBUG] TLSv>
jan 13 20:12:58 user-VirtualBox xrdp[1271]: (1271)(140144810325824)[DEBUG] TLSv>
jan 13 20:12:58 user-VirtualBox xrdp[1271]: (1271)(140144810325824)[DEBUG] Secu>
jan 13 20:12:58 user-VirtualBox xrdp[1271]: (1271)(140144810325824)[INFO ] conn>
jan 13 20:12:58 user-VirtualBox xrdp[1271]: (1271)(140144810325824)[INFO ] addi>
jan 13 20:12:58 user-VirtualBox xrdp[1271]: (1271)(140144810325824)[INFO ] addi>
jan 13 20:12:58 user-VirtualBox xrdp[1271]: (1271)(140144810325824)[INFO ] addi>
jan 13 20:12:58 user-VirtualBox xrdp[1271]: (1271)(140144810325824)[INFO ] addi>
jan 13 20:12:58 user-VirtualBox xrdp[1271]: (1271)(140144810325824)[INFO ] addi>
jan 13 20:12:58 user-VirtualBox xrdp[1271]: (1271)(140144810325824)[INFO ] addi>
jan 13 20:12:58 user-VirtualBox xrdp[1271]: (1271)(140144810325824)[INFO ] TLS >
jan 13 20:12:58 user-VirtualBox xrdp[1271]: (1271)(140144810325824)[DEBUG] xrdp>
jan 13 20:12:58 user-VirtualBox xrdp[1271]: (1271)(140144810325824)[INFO ] Load>
jan 13 20:12:58 user-VirtualBox xrdp[1271]: (1271)(140144810325824)[WARN ] loca>
jan 13 20:13:19 user-VirtualBox xrdp[1271]: (1271)(140144810325824)[DEBUG] xrdp>
jan 13 20:13:19 user-VirtualBox xrdp-sesman[730]: (730)(140296907183680)[INFO ]>
jan 13 20:13:19 user-VirtualBox xrdp[1271]: (1271)(140144810325824)[INFO ] xrdp>
jan 13 20:13:19 user-VirtualBox xrdp[1271]: (1271)(140144810325824)[DEBUG] xrdp>
jan 13 20:13:19 user-VirtualBox xrdp[1271]: (1271)(140144810325824)[DEBUG] retu>
jan 13 20:13:19 user-VirtualBox xrdp-sesman[730]: (730)(140296907183680)[INFO ]>
jan 13 20:13:19 user-VirtualBox xrdp-sesman[730]: (730)(140296907183680)[INFO ]>
jan 13 20:13:19 user-VirtualBox xrdp-sesman[730]: (730)(140296907183680)[DEBUG]>
jan 13 20:13:19 user-VirtualBox xrdp-sesman[730]: (730)(140296907183680)[DEBUG]>
jan 13 20:13:19 user-VirtualBox xrdp-sesman[730]: (730)(140296907183680)[DEBUG]>
jan 13 20:13:19 user-VirtualBox xrdp[1271]: (1271)(140144810325824)[INFO ] xrdp>
jan 13 20:13:19 user-VirtualBox xrdp-sesman[730]: (730)(140296907183680)[DEBUG]>
jan 13 20:13:19 user-VirtualBox xrdp-sesman[1272]: (1272)(140296907183680)[INFO>
jan 13 20:13:19 user-VirtualBox xrdp[1271]: (1271)(140144810325824)[DEBUG] xrdp>
jan 13 20:13:19 user-VirtualBox xrdp-sesman[1272]: pam_unix(xrdp-sesman:session>
jan 13 20:13:19 user-VirtualBox systemd[1]: Created slice User Slice of UID 100>
jan 13 20:13:19 user-VirtualBox systemd[1]: Starting User Runtime Directory /ru>
jan 13 20:13:19 user-VirtualBox systemd-logind[630]: New session c2 of user use>
jan 13 20:13:19 user-VirtualBox systemd[1274]: pam_unix(systemd-user:session): >
jan 13 20:13:19 user-VirtualBox systemd[1]: Finished User Runtime Directory /ru>
jan 13 20:13:19 user-VirtualBox systemd[1]: Starting User Manager for UID 1000.>
jan 13 20:13:19 user-VirtualBox systemd[1274]: Started Pending report trigger f>
jan 13 20:13:19 user-VirtualBox systemd[1274]: Reached target Paths.
jan 13 20:13:19 user-VirtualBox dbus-daemon[1285]: [session uid=1000 pid=1285] >
jan 13 20:13:19 user-VirtualBox systemd[1274]: Reached target Timers.
jan 13 20:13:19 user-VirtualBox xrdp-sesman[1272]: (1272)(140296907183680)[DEBU>
jan 13 20:13:19 user-VirtualBox systemd[1274]: Starting D-Bus User Message Bus >
jan 13 20:13:19 user-VirtualBox dbus-daemon[1285]: [session uid=1000 pid=1285] >
jan 13 20:13:19 user-VirtualBox systemd[1274]: Listening on GnuPG network certi>
jan 13 20:13:19 user-VirtualBox xrdp-sesman[1272]: (1272)(140296907183680)[DEBU>
jan 13 20:13:19 user-VirtualBox systemd[1274]: Listening on GnuPG cryptographic>
jan 13 20:13:19 user-VirtualBox dbus-daemon[1285]: [session uid=1000 pid=1285] >
jan 13 20:13:19 user-VirtualBox systemd[1274]: Listening on GnuPG cryptographic>
jan 13 20:13:19 user-VirtualBox xrdp-sesman[1303]: (1303)(140296907183680)[INFO>
jan 13 20:13:19 user-VirtualBox systemd[1274]: Listening on GnuPG cryptographic>
jan 13 20:13:19 user-VirtualBox dbus-daemon[1285]: [session uid=1000 pid=1285] >
jan 13 20:13:19 user-VirtualBox systemd[1274]: Listening on GnuPG cryptographic>
jan 13 20:13:19 user-VirtualBox systemd[1274]: Listening on debconf communicati>
jan 13 20:13:19 user-VirtualBox systemd[1274]: Listening on Sound System.
jan 13 20:13:19 user-VirtualBox systemd[1274]: Listening on REST API socket for>
jan 13 20:13:19 user-VirtualBox systemd[1274]: Listening on D-Bus User Message >
jan 13 20:13:19 user-VirtualBox systemd[1274]: Reached target Sockets.
jan 13 20:13:19 user-VirtualBox systemd[1274]: Reached target Basic System.
jan 13 20:13:19 user-VirtualBox systemd[1]: Started User Manager for UID 1000.
jan 13 20:13:19 user-VirtualBox systemd[1]: Started Session c2 of user user.
jan 13 20:13:19 user-VirtualBox systemd[1274]: Starting Sound Service...
jan 13 20:13:19 user-VirtualBox systemd[1274]: Starting Tracker metadata extrac>
jan 13 20:13:19 user-VirtualBox systemd[1274]: Starting Tracker file system dat>
jan 13 20:13:19 user-VirtualBox tracker-extract[1281]: Set scheduler policy to >
jan 13 20:13:19 user-VirtualBox tracker-extract[1281]: Setting priority nice le>
jan 13 20:13:19 user-VirtualBox tracker-miner-f[1282]: Set scheduler policy to >
jan 13 20:13:19 user-VirtualBox tracker-miner-f[1282]: Setting priority nice le>
jan 13 20:13:19 user-VirtualBox systemd[1274]: Started D-Bus User Message Bus.
jan 13 20:13:19 user-VirtualBox systemd[1274]: Starting Virtual filesystem serv>
jan 13 20:13:19 user-VirtualBox dbus-daemon[1285]: [session uid=1000 pid=1285] >
jan 13 20:13:19 user-VirtualBox systemd[1274]: Started Virtual filesystem servi>
jan 13 20:13:19 user-VirtualBox systemd[1274]: Starting Virtual filesystem serv>
jan 13 20:13:19 user-VirtualBox systemd[1274]: Started Virtual filesystem servi>
jan 13 20:13:19 user-VirtualBox dbus-daemon[1285]: [session uid=1000 pid=1285] >
jan 13 20:13:19 user-VirtualBox systemd[1274]: Starting Virtual filesystem serv>
jan 13 20:13:19 user-VirtualBox dbus-daemon[1285]: [session uid=1000 pid=1285] >
jan 13 20:13:19 user-VirtualBox systemd[1274]: Started Virtual filesystem servi>
jan 13 20:13:19 user-VirtualBox dbus-daemon[1285]: [session uid=1000 pid=1285] >
jan 13 20:13:19 user-VirtualBox systemd[1274]: Starting Virtual filesystem serv>
jan 13 20:13:19 user-VirtualBox dbus-daemon[1285]: [session uid=1000 pid=1285] >
jan 13 20:13:19 user-VirtualBox systemd[1274]: Started Virtual filesystem servi>
jan 13 20:13:19 user-VirtualBox dbus-daemon[1285]: [session uid=1000 pid=1285] >
jan 13 20:13:19 user-VirtualBox systemd[1274]: Starting Virtual filesystem serv>
jan 13 20:13:19 user-VirtualBox dbus-daemon[1285]: [session uid=1000 pid=1285] >
jan 13 20:13:19 user-VirtualBox systemd[1274]: Started Virtual filesystem servi>
jan 13 20:13:19 user-VirtualBox dbus-daemon[1285]: [session uid=1000 pid=1285] >
jan 13 20:13:19 user-VirtualBox systemd[1274]: Starting Virtual filesystem serv>
jan 13 20:13:19 user-VirtualBox dbus-daemon[1285]: [session uid=1000 pid=1285] >
jan 13 20:13:19 user-VirtualBox goa-daemon[1340]: goa-daemon version 3.36.1 sta>
jan 13 20:13:19 user-VirtualBox dbus-daemon[1285]: [session uid=1000 pid=1285] >
jan 13 20:13:19 user-VirtualBox dbus-daemon[1285]: [session uid=1000 pid=1285] >
jan 13 20:13:19 user-VirtualBox dbus-daemon[1285]: [session uid=1000 pid=1285] >
jan 13 20:13:19 user-VirtualBox dbus-daemon[1285]: [session uid=1000 pid=1285] >
jan 13 20:13:19 user-VirtualBox systemd[1274]: Started Virtual filesystem servi>
jan 13 20:13:19 user-VirtualBox xrdp[1271]: (1271)(140144810325824)[INFO ] lib_>
jan 13 20:13:19 user-VirtualBox xrdp[1271]: (1271)(140144810325824)[DEBUG] xrdp>
jan 13 20:13:19 user-VirtualBox dbus-daemon[1285]: [session uid=1000 pid=1285] >
jan 13 20:13:19 user-VirtualBox systemd[1274]: Starting Tracker metadata databa>
jan 13 20:13:19 user-VirtualBox dbus-daemon[593]: [system] Activating via syste>
jan 13 20:13:19 user-VirtualBox systemd[1]: Condition check resulted in Bluetoo>
jan 13 20:13:19 user-VirtualBox rtkit-daemon[791]: Supervising 2 threads of 1 p>
jan 13 20:13:19 user-VirtualBox systemd[1274]: Started Tracker file system data>
jan 13 20:13:19 user-VirtualBox rtkit-daemon[791]: Supervising 2 threads of 1 p>
jan 13 20:13:19 user-VirtualBox dbus-daemon[1285]: [session uid=1000 pid=1285] >
jan 13 20:13:19 user-VirtualBox systemd[1274]: Started Tracker metadata databas>
jan 13 20:13:19 user-VirtualBox rtkit-daemon[791]: Supervising 2 threads of 1 p>
jan 13 20:13:19 user-VirtualBox rtkit-daemon[791]: Supervising 2 threads of 1 p>
jan 13 20:13:19 user-VirtualBox rtkit-daemon[791]: Supervising 2 threads of 1 p>
jan 13 20:13:19 user-VirtualBox systemd[1274]: Started Tracker metadata extract>
jan 13 20:13:19 user-VirtualBox systemd[1274]: Started Sound Service.
jan 13 20:13:19 user-VirtualBox systemd[1274]: Reached target Main User Target.
jan 13 20:13:19 user-VirtualBox systemd[1274]: Startup finished in 242ms.
jan 13 20:13:19 user-VirtualBox xrdp-sesman[1272]: (1272)(140296907183680)[CORE>
jan 13 20:13:19 user-VirtualBox dbus-daemon[1402]: [session uid=1000 pid=1400] >
jan 13 20:13:19 user-VirtualBox xrdp[1271]: (1271)(140144810325824)[DEBUG] xrdp>
jan 13 20:13:19 user-VirtualBox xrdp[1271]: (1271)(140144810325824)[DEBUG] Clos>
jan 13 20:13:19 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:19 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:19 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox gnome-session[1489]: gnome-session-check-accele>
jan 13 20:13:20 user-VirtualBox gnome-session[1522]: libEGL warning: DRI2: fail>
jan 13 20:13:20 user-VirtualBox geoclue[997]: Service not used for 60 seconds. >
jan 13 20:13:20 user-VirtualBox systemd[1]: geoclue.service: Succeeded.
jan 13 20:13:20 user-VirtualBox gnome-session[1489]: gnome-session-check-accele>
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox gnome-keyring-ssh.desktop[1561]: GNOME_KEYRING_>
jan 13 20:13:20 user-VirtualBox gnome-keyring-ssh.desktop[1561]: SSH_AUTH_SOCK=>
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox gnome-keyring-pkcs11.desktop[1558]: GNOME_KEYRI>
jan 13 20:13:20 user-VirtualBox gnome-keyring-pkcs11.desktop[1558]: SSH_AUTH_SO>
jan 13 20:13:20 user-VirtualBox gnome-keyring-secrets.desktop[1557]: GNOME_KEYR>
jan 13 20:13:20 user-VirtualBox gnome-keyring-secrets.desktop[1557]: SSH_AUTH_S>
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox org.gnome.Shell.desktop[1571]: Xlib:  extension>
jan 13 20:13:20 user-VirtualBox gnome-shell[1571]: Impossible to set scaling on>
jan 13 20:13:20 user-VirtualBox org.gnome.Shell.desktop[1571]: Window manager w>
jan 13 20:13:20 user-VirtualBox org.gnome.Shell.desktop[1571]: Xlib:  extension>
jan 13 20:13:20 user-VirtualBox gnome-shell[1571]: Some code accessed the prope>
jan 13 20:13:20 user-VirtualBox gnome-shell[1571]: Unset XDG_SESSION_ID, getCur>
jan 13 20:13:20 user-VirtualBox gnome-shell[1571]: Will monitor session c2
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox org.a11y.Bus[1508]: dbus-daemon[1508]: Activati>
jan 13 20:13:20 user-VirtualBox org.a11y.Bus[1508]: dbus-daemon[1508]: Successf>
jan 13 20:13:20 user-VirtualBox org.a11y.Bus[1628]: SpiRegistry daemon is runni>
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[593]: [system] Activating via syste>
jan 13 20:13:20 user-VirtualBox systemd[1]: Starting Location Lookup Service...
jan 13 20:13:20 user-VirtualBox polkitd(authority=local)[613]: Registered Authe>
jan 13 20:13:20 user-VirtualBox gnome-shell[1571]: Telepathy is not available, >
jan 13 20:13:20 user-VirtualBox goa-daemon[1653]: goa-daemon version 3.36.1 sta>
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[593]: [system] Successfully activat>
jan 13 20:13:20 user-VirtualBox systemd[1]: Started Location Lookup Service.
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:20 user-VirtualBox org.gnome.Shell.desktop[1571]: Xlib:  extension>
jan 13 20:13:21 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:21 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:21 user-VirtualBox NetworkManager[595]: <info>  [1642094001.0568] >
jan 13 20:13:21 user-VirtualBox pulseaudio.desktop[1757]: Ошибка подключения: С>
jan 13 20:13:21 user-VirtualBox pulseaudio.desktop[1757]: Произошла ошибка при >
jan 13 20:13:21 user-VirtualBox gnome-shell[1571]: Error looking up permission:>
jan 13 20:13:21 user-VirtualBox gnome-session[1302]: gnome-session-binary[1302]>
jan 13 20:13:21 user-VirtualBox gnome-session-binary[1302]: WARNING: App 'pulse>
jan 13 20:13:21 user-VirtualBox gsd-rfkill[1738]: Could not open rfkill device:>
jan 13 20:13:21 user-VirtualBox dbus-daemon[593]: [system] Activating via syste>
jan 13 20:13:21 user-VirtualBox systemd[1]: Starting Hostname Service...
jan 13 20:13:21 user-VirtualBox gsd-media-keys[1735]: Unable to inhibit keypres>
jan 13 20:13:21 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:21 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:21 user-VirtualBox org.gnome.SettingsDaemon.Keyboard.desktop[1807]>
jan 13 20:13:21 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:21 user-VirtualBox gsd-sharing[1776]: Failed to StopUnit service: >
jan 13 20:13:21 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:21 user-VirtualBox gsd-sharing[1776]: Failed to StopUnit service: >
jan 13 20:13:21 user-VirtualBox gsd-sharing[1776]: Failed to StopUnit service: >
jan 13 20:13:21 user-VirtualBox gsd-sharing[1776]: Failed to StopUnit service: >
jan 13 20:13:21 user-VirtualBox dbus-daemon[593]: [system] Activating via syste>
jan 13 20:13:21 user-VirtualBox systemd[1]: Starting Locale Service...
jan 13 20:13:21 user-VirtualBox dbus-daemon[593]: [system] Successfully activat>
jan 13 20:13:21 user-VirtualBox systemd[1]: Started Hostname Service.
jan 13 20:13:21 user-VirtualBox org.gnome.SettingsDaemon.XSettings.desktop[1746>
jan 13 20:13:21 user-VirtualBox tracker-miner-f[1872]: Set scheduler policy to >
jan 13 20:13:21 user-VirtualBox tracker-miner-f[1872]: Setting priority nice le>
jan 13 20:13:21 user-VirtualBox gsd-color[1763]: failed to get edid: unable to >
jan 13 20:13:21 user-VirtualBox org.gnome.SettingsDaemon.Power.desktop[1756]: e>
jan 13 20:13:21 user-VirtualBox dbus-daemon[593]: [system] Successfully activat>
jan 13 20:13:21 user-VirtualBox systemd[1]: Started Locale Service.
jan 13 20:13:21 user-VirtualBox vmware-user.desktop[1894]: vmware-user: could n>
jan 13 20:13:21 user-VirtualBox tracker-extract[1897]: Set scheduler policy to >
jan 13 20:13:21 user-VirtualBox tracker-extract[1897]: Setting priority nice le>
jan 13 20:13:21 user-VirtualBox gnome-session-binary[1302]: Entering running st>
jan 13 20:13:21 user-VirtualBox vmware-user.desktop[1894]: Error: /usr/bin/vmto>
jan 13 20:13:21 user-VirtualBox pulseaudio-xrdp.desktop[1921]: Ошибка подключен>
jan 13 20:13:21 user-VirtualBox pulseaudio-xrdp.desktop[1921]: Произошла ошибка>
jan 13 20:13:21 user-VirtualBox pulseaudio-xrdp.desktop[1904]: ? Can't load pul>
jan 13 20:13:21 user-VirtualBox pulseaudio-xrdp.desktop[1924]: Ошибка подключен>
jan 13 20:13:21 user-VirtualBox pulseaudio-xrdp.desktop[1924]: Произошла ошибка>
jan 13 20:13:21 user-VirtualBox pulseaudio-xrdp.desktop[1904]: ? Can't load pul>
jan 13 20:13:21 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:21 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:21 user-VirtualBox ubuntu-software-service.desktop[1925]: cmd_run.>
jan 13 20:13:21 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:21 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:21 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:21 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:21 user-VirtualBox systemd[774]: tmp-snap.rootfs_vepzgN.mount: Suc>
jan 13 20:13:21 user-VirtualBox systemd[1274]: tmp-snap.rootfs_vepzgN.mount: Su>
jan 13 20:13:21 user-VirtualBox systemd[1]: tmp-snap.rootfs_vepzgN.mount: Succe>
jan 13 20:13:21 user-VirtualBox audit[1925]: AVC apparmor="DENIED" operation="c>
jan 13 20:13:21 user-VirtualBox kernel: kauditd_printk_skb: 29 callbacks suppre>
jan 13 20:13:21 user-VirtualBox kernel: audit: type=1400 audit(1642094001.503:4>
jan 13 20:13:21 user-VirtualBox gsd-media-keys[1735]: Failed to grab accelerato>
jan 13 20:13:21 user-VirtualBox gsd-media-keys[1735]: Failed to grab accelerato>
jan 13 20:13:21 user-VirtualBox gsd-media-keys[1735]: Failed to grab accelerato>
jan 13 20:13:21 user-VirtualBox gsd-media-keys[1735]: Failed to grab accelerato>
jan 13 20:13:21 user-VirtualBox gsd-media-keys[1735]: Failed to grab accelerato>
jan 13 20:13:21 user-VirtualBox gsd-media-keys[1735]: Failed to grab accelerato>
jan 13 20:13:21 user-VirtualBox gnome-shell[1571]: GNOME Shell started at Thu J>
jan 13 20:13:21 user-VirtualBox gnome-shell[1571]: Registering session with GDM
jan 13 20:13:22 user-VirtualBox audit[1925]: SECCOMP auid=4294967295 uid=1000 g>
jan 13 20:13:22 user-VirtualBox kernel: audit: type=1326 audit(1642094002.983:4>
jan 13 20:13:23 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:23 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:23 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:23 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:23 user-VirtualBox dbus-daemon[593]: [system] Activating via syste>
jan 13 20:13:23 user-VirtualBox systemd[1]: Starting Firmware update daemon...
jan 13 20:13:23 user-VirtualBox dbus-daemon[593]: [system] Successfully activat>
jan 13 20:13:23 user-VirtualBox systemd[1]: Started Firmware update daemon.
jan 13 20:13:23 user-VirtualBox audit[593]: USER_AVC pid=593 uid=103 auid=42949>
                                                exe="/usr/bin/dbus-daemon" saui>
jan 13 20:13:23 user-VirtualBox audit[593]: USER_AVC pid=593 uid=103 auid=42949>
                                                exe="/usr/bin/dbus-daemon" saui>
jan 13 20:13:23 user-VirtualBox kernel: audit: type=1107 audit(1642094003.739:4>
                                            exe="/usr/bin/dbus-daemon" sauid=10>
jan 13 20:13:23 user-VirtualBox kernel: audit: type=1107 audit(1642094003.739:4>
                                            exe="/usr/bin/dbus-daemon" sauid=10>
jan 13 20:13:23 user-VirtualBox audit[593]: USER_AVC pid=593 uid=103 auid=42949>
                                                exe="/usr/bin/dbus-daemon" saui>
jan 13 20:13:23 user-VirtualBox audit[593]: USER_AVC pid=593 uid=103 auid=42949>
                                                exe="/usr/bin/dbus-daemon" saui>
jan 13 20:13:23 user-VirtualBox snap-store[1925]: enabled plugins: desktop-cate>
jan 13 20:13:23 user-VirtualBox snap-store[1925]: disabled plugins: dpkg, dummy>
jan 13 20:13:23 user-VirtualBox kernel: audit: type=1107 audit(1642094003.751:4>
                                            exe="/usr/bin/dbus-daemon" sauid=10>
jan 13 20:13:23 user-VirtualBox kernel: audit: type=1107 audit(1642094003.751:4>
                                            exe="/usr/bin/dbus-daemon" sauid=10>
jan 13 20:13:24 user-VirtualBox audit[1925]: AVC apparmor="DENIED" operation="o>
jan 13 20:13:24 user-VirtualBox snap-store[1925]: /etc/PackageKit/Vendor.conf f>
jan 13 20:13:24 user-VirtualBox kernel: audit: type=1400 audit(1642094004.079:4>
jan 13 20:13:24 user-VirtualBox PackageKit[998]: uid 1000 is trying to obtain o>
jan 13 20:13:25 user-VirtualBox polkitd(authority=local)[613]: Operator of unix>
jan 13 20:13:25 user-VirtualBox colord[1148]: failed to get seat for session c2>
jan 13 20:13:25 user-VirtualBox gsd-color[1763]: unable to get EDID for xrandr->
jan 13 20:13:25 user-VirtualBox gsd-color[1021]: no xrandr-rdp0 device found: F>
jan 13 20:13:28 user-VirtualBox polkitd(authority=local)[613]: Operator of unix>
jan 13 20:13:28 user-VirtualBox PackageKit[998]: uid 1000 obtained auth for org>
jan 13 20:13:29 user-VirtualBox PackageKit[998]: refresh-cache transaction /325>
jan 13 20:13:29 user-VirtualBox snap-store[1925]: adding wildcard app */*/*/*/o>
jan 13 20:13:29 user-VirtualBox snap-store[1925]: adding wildcard app */*/*/*/o>
jan 13 20:13:29 user-VirtualBox snap-store[1925]: adding wildcard app */*/*/*/o>
jan 13 20:13:29 user-VirtualBox snap-store[1925]: adding wildcard app */*/*/*/o>
jan 13 20:13:29 user-VirtualBox snap-store[1925]: adding wildcard app */*/*/*/o>
jan 13 20:13:29 user-VirtualBox snap-store[1925]: adding wildcard app */*/*/*/o>
jan 13 20:13:29 user-VirtualBox snap-store[1925]: adding wildcard app */*/*/*/o>
jan 13 20:13:29 user-VirtualBox snap-store[1925]: adding wildcard app */*/*/*/o>
jan 13 20:13:29 user-VirtualBox snap-store[1925]: adding wildcard app */*/*/*/o>
jan 13 20:13:29 user-VirtualBox snap-store[1925]: Only 0 apps for recent list, >
jan 13 20:13:29 user-VirtualBox snap-store[1925]: hiding category productivity >
jan 13 20:13:29 user-VirtualBox snap-store[1925]: hiding category games feature>
jan 13 20:13:30 user-VirtualBox systemd[1274]: tracker-extract.service: Succeed>
jan 13 20:13:30 user-VirtualBox snap-store[1925]: FIXME: Unknown progress handl>
jan 13 20:13:30 user-VirtualBox snap-store[1925]: FIXME: Unknown progress handl>
jan 13 20:13:30 user-VirtualBox snap-store[1925]: FIXME: Unknown progress handl>
jan 13 20:13:30 user-VirtualBox snap-store[1925]: FIXME: Unknown progress handl>
jan 13 20:13:30 user-VirtualBox snap-store[1925]: automatically prevented from >
jan 13 20:13:30 user-VirtualBox snapd[624]: storehelpers.go:710: cannot refresh>
jan 13 20:13:31 user-VirtualBox PackageKit[998]: resolve transaction /326_ebbac>
jan 13 20:13:31 user-VirtualBox org.gnome.SettingsDaemon.MediaKeys.desktop[1735>
jan 13 20:13:31 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:32 user-VirtualBox dbus-daemon[1431]: [session uid=1000 pid=1429] >
jan 13 20:13:32 user-VirtualBox PackageKit[998]: search-file transaction /327_b>
jan 13 20:13:32 user-VirtualBox PackageKit[998]: get-details transaction /328_c>
jan 13 20:13:32 user-VirtualBox snap-store[1925]: automatically prevented from >
jan 13 20:13:32 user-VirtualBox snap-store[1925]: automatically prevented from >
jan 13 20:13:33 user-VirtualBox snap-store[1925]: automatically prevented from >
jan 13 20:13:33 user-VirtualBox snap-store[1925]: automatically prevented from >
jan 13 20:13:44 user-VirtualBox dbus-daemon[593]: [system] Failed to activate s>
jan 13 20:13:44 user-VirtualBox pulseaudio[1280]: GetManagedObjects() failed: o>
jan 13 20:13:47 user-VirtualBox sudo[2446]:     user : TTY=pts/0 ; PWD=/home/us>
jan 13 20:13:47 user-VirtualBox sudo[2446]: pam_unix(sudo:session): session ope>
lines 330-352/352 (END)

user@user-VirtualBox:~$ sudo systemctl list-units --state=failed
  UNIT LOAD ACTIVE SUB DESCRIPTION
0 loaded units listed.
matt335672 commented 2 years ago

Well, that's not very useful!

Try redirecting the log to a file first, and then add the log to a post here.

sudo journalctl -S -1m >/tmp/jctl.log.txt
kujaska commented 2 years ago

file is here: jctl.log.txt

matt335672 commented 2 years ago

Thanks - that's interesting although it's still not totally clear what's happening.

The systemd session starts at around line 1912:-

jan 14 11:06:13 user-VirtualBox systemd[1]: Started Session c2 of user user.

At around lines 1922-1961, the session d-Bus appears to be starting services happily.

However, at line 1967, things start to go wrong:-

jan 14 11:06:13 user-VirtualBox dbus-daemon[1426]: [session uid=1000 pid=1424] Activating service name='org.freedesktop.systemd1' requested by ':1.4' (uid=1000 pid=1296 comm="/usr/libexec/gnome-session-binary --builtin " label="unconfined")
jan 14 11:06:13 user-VirtualBox dbus-daemon[1426]: [session uid=1000 pid=1424] Activated service 'org.freedesktop.systemd1' failed: Process org.freedesktop.systemd1 exited with status 1

I suspect this is a problem with the environment which is causing this. I think that would either be because pam_systemd is not working correctly, or possibly because XDG_RUNTIME_DIR is missing.

Looking at the pam_systemd source code we can see that pam_systemd uses pam_syslog() for error logging. This uses LOG_AUTHPRIV, which on my system is redirected to /var/log/auth.log

Can you have a look in /var/log/auth.log for recent messages after a login attempt?

Thanks.

kujaska commented 2 years ago

ok, attached is /var/log/auth.log - rows for today auth_log_sample.txt

matt335672 commented 2 years ago

That all looks fine to me, so it looks like pam_systemd is not logging any errors. That doesn't however mean it's working perfectly.

Can you edit /etc/pam.d/common-session and replace this line:-

session optional    pam_systemd.so 

with:-

session optional    pam_systemd.so  debug

then log out of xrdp completely, log in again, and see if /var/log/auth.log has any more information in it?

Thanks.

kujaska commented 2 years ago

Done, attached auth_log_sample2.txt

matt335672 commented 2 years ago

Thanks @kujaska

Well, it looks like pam_systemd is working perfectly as well, so that doesn't leave many possibilities.

pam_systemd should be setting XDG_RUNTIME_DIR and DBUS_SESSION_BUS_ADDRESS for the session, so all I can think is that if they're not in the session, something must be clearing them before the session starts.

Let's try setting them explicitly.

Can you create a file /home/user/startwm.sh with the following contents:-

#!/bin/bash

# Create a log 
exec >/tmp/startwm.log 2>&1
echo "Start environment"
echo "-----------------"
env | sort

. /etc/profile

echo "Environment after profile"
echo "-------------------------"
env | sort

export XDG_RUNTIME_DIR=/run/user/$(id -u)
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus
exec /etc/X11/Xsession

Make the file executable with chmod +x ~/startwm.sh. Then log in over xrdp and see what happens. The contents of /tmp/startwm.log will be interesting.

kujaska commented 2 years ago

Hi! Finally done it:

The contents of /tmp/startwm.log

Start environment
-----------------
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
DISPLAY=:10.0
HOME=/home/user
LOGNAME=user
PATH=/sbin:/bin:/usr/bin:/usr/local/bin
PULSE_SCRIPT=/etc/xrdp/pulse/default.pa
PWD=/home/user
SHELL=/bin/bash
SHLVL=0
UID=1000
USER=user
XDG_RUNTIME_DIR=/run/user/1000
XDG_SESSION_CLASS=user
XDG_SESSION_ID=c2
XDG_SESSION_TYPE=x11
XRDP_PULSE_SINK_SOCKET=xrdp_chansrv_audio_out_socket_10
XRDP_PULSE_SOURCE_SOCKET=xrdp_chansrv_audio_in_socket_10
XRDP_SESSION=1
XRDP_SOCKET_PATH=/run/xrdp/sockdir
_=/bin/env
Environment after profile
-------------------------
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
DISPLAY=:10.0
HOME=/home/user
LOGNAME=user
PATH=/sbin:/bin:/usr/bin:/usr/local/bin:/snap/bin
PULSE_SCRIPT=/etc/xrdp/pulse/default.pa
PWD=/home/user
SHELL=/bin/bash
SHLVL=0
UID=1000
USER=user
XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop
XDG_RUNTIME_DIR=/run/user/1000
XDG_SESSION_CLASS=user
XDG_SESSION_ID=c2
XDG_SESSION_TYPE=x11
XRDP_PULSE_SINK_SOCKET=xrdp_chansrv_audio_out_socket_10
XRDP_PULSE_SOURCE_SOCKET=xrdp_chansrv_audio_in_socket_10
XRDP_SESSION=1
XRDP_SOCKET_PATH=/run/xrdp/sockdir
_=/bin/env
kujaska commented 2 years ago

And...

Good News:

Bad News:

Questions:

1) why does it finally work with startwm.sh script? is that script a target solution or something will be done in xrdp installation scripts?

2) Is there any way to make fast youtube video run smoothly?

Thanx!

matt335672 commented 2 years ago

To answer your questions:- 1) The reason your setup wasn't working at first was because XDG_RUNTIME_DIR and DBUS_SESSION_BUS_ADDRESS are not set correctly in your desktop environment. I suspect looking at the above that something else you've changed has fixed this, and if you revert startwm.sh all will be well. I certainly don't have enough information to suggest any changes to the installation scripts based on what we have at the moment. 2) You can try enabling the RFX codec by following the instructions in this discussion item. This might get you a better throughput. Work is afoot to improve on this further, but that's the best we can so at the moment.