Page MenuHomeSolus

Get xrdp working out of the box for budgie
ClosedPublic

Authored by tarkah on Apr 5 2019, 11:55 PM.

Details

Summary

Added additional files needed to get xrdp working out of the box with Budgie.

  • Startwm.sh could be updated to better handle launching the appropriate DE
  • /etc/X11/Xwrapper.config file needs to either be shipped w/ allowed_users=anybody or documented in help center

Signed-off-by: Cory Forsstrom <cforsstrom18@gmail.com>

Test Plan
  • Vagrant file w/ relevant box of Solus 4 created at link
  • Copy xrdp & xorgxrdp eopkg files to ./share for copy to vagrant box
  • vagrant up and rdp to 127.0.0.1:33389
    • vagrant username / password = vagrant
  • Reminna client works if advanced connection options "Relaxed Order Checks" and "Glyph Cache" are checked

Diff Detail

Repository
R3279 xrdp
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

tarkah created this revision.Apr 5 2019, 11:55 PM
tarkah requested review of this revision.Apr 5 2019, 11:55 PM
tarkah edited the summary of this revision. (Show Details)Apr 5 2019, 11:56 PM
tarkah edited the test plan for this revision. (Show Details)
tarkah edited the test plan for this revision. (Show Details)Apr 6 2019, 12:27 AM
kyrios123 added inline comments.
files/Xwrapper.config
1 ↗(On Diff #14349)

This (if accepted) should probably be part of the X server package otherwise if multiple packages provide a Xwrapper.config will conflict.

It could also be documented on the help center instead of being added in a package.

files/startwm.sh
3 ↗(On Diff #14349)

Okay but what about GNOME, MATE and Plasma ?

tarkah added inline comments.Apr 6 2019, 4:43 PM
files/Xwrapper.config
1 ↗(On Diff #14349)

Agreed, I'll remove this. Probably best to just document it.

files/startwm.sh
3 ↗(On Diff #14349)

Yep, this needs to be improved, though I can't say I know the best way to determine and choose the default DE to launch.

tarkah updated this revision to Diff 14354.Apr 6 2019, 5:00 PM
  • Removed Xwrapper.config file, this shouldn't be shipped with this package
  • Updated startwm.sh to include launch option for each DE, however only commented out for now
tarkah marked 2 inline comments as done.Apr 6 2019, 5:01 PM
tarkah marked an inline comment as not done.
tarkah added inline comments.
files/startwm.sh
3 ↗(On Diff #14349)

@kyrios123 How about this for now? One can just uncomment the applicable DE.

tarkah edited the summary of this revision. (Show Details)Apr 6 2019, 5:07 PM
kyrios123 added inline comments.Apr 6 2019, 5:15 PM
files/startwm.sh
3 ↗(On Diff #14349)

I suppose environment variables like $XDG_CURRENT_DESKTOP or $DESKTOP_SESSION won't be set since the DE won't be started yet...

A possible hack would be to check the .desktop file in /usr/share/xsessions to determine the DE, but then again if a user installed multiple DE, it could be an issue (we could take the first that is found though).

tarkah updated this revision to Diff 14357.Apr 6 2019, 6:29 PM

Updated startwm.sh to get Exec option from first .desktop file in /usr/share/xsessions

  • Tested on budgie with desktop.mate and desktop.kde.core installed
  • It first launched budgie, I then deleted budgie-dektop.desktop file
  • Next it launched Plasma, then deleted that file
  • Last it launched Mate
tarkah added inline comments.Apr 6 2019, 6:32 PM
files/startwm.sh
3 ↗(On Diff #14349)

@kyrios123 I took a stab at this hack and it works. I had a base install of Budgie then added desktop.mate & desktop.kde.core. Budgie was first in the directory, then Plasma then Mate. It launched Budgie, then I deleted that file... Then it launched Plasma, deleted... then it launched Mate.

My apologies for this arbitrary addition, but it appears this no longer works in the latest release of Solus 4.0 Fortitude. On attempting to remotely log into the machine through RDP after following the above steps yields the following in the journal:

Aug 01 17:52:21 dwt-lenovo-solus xrdp[2241]: (2241)(140642634756864)[INFO ] xrdp_wm_log_msg: login successful for display 10
Aug 01 17:52:21 dwt-lenovo-solus xrdp-sesman[2220]: (2220)(140305131460416)[DEBUG] Closed socket 8 (AF_INET6 ::1 port 3350)
Aug 01 17:52:21 dwt-lenovo-solus xrdp-sesman[2242]: (2242)(140305131460416)[INFO ] calling auth_start_session from pid 2242
Aug 01 17:52:21 dwt-lenovo-solus xrdp[2241]: (2241)(140642634756864)[DEBUG] xrdp_wm_log_msg: started connecting
Aug 01 17:52:21 dwt-lenovo-solus xrdp-sesman[2242]: pam_unix(xrdp-sesman:session): session opened for user dave by (uid=0)
Aug 01 17:52:21 dwt-lenovo-solus xrdp-sesman[2242]: gkr-pam: unable to locate daemon control file
Aug 01 17:52:21 dwt-lenovo-solus systemd-logind[620]: New session 3 of user dave.
Aug 01 17:52:21 dwt-lenovo-solus systemd[1]: Started Session 3 of user dave.
Aug 01 17:52:21 dwt-lenovo-solus xrdp-sesman[2242]: (2242)(140305131460416)[DEBUG] Closed socket 7 (AF_INET6 ::1 port 3350)
Aug 01 17:52:21 dwt-lenovo-solus xrdp-sesman[2242]: (2242)(140305131460416)[DEBUG] Closed socket 8 (AF_INET6 ::1 port 3350)
Aug 01 17:52:21 dwt-lenovo-solus xrdp-sesman[2249]: (2249)(140305131460416)[INFO ] Xorg :10 -auth .Xauthority -config xrdp/xorg.conf -noreset -nolisten tcp -logfile .xorgxrdp.%s.log
Aug 01 17:52:21 dwt-lenovo-solus dbus-daemon[848]: [session uid=1000 pid=848] Activating via systemd: service name='org.freedesktop.Tracker1' unit='tracker-store.service' requested by ':1.56' (uid=1000 pid=1068>
Aug 01 17:52:21 dwt-lenovo-solus systemd[836]: Starting Tracker metadata database store and lookup manager...
Aug 01 17:52:21 dwt-lenovo-solus dbus-daemon[848]: [session uid=1000 pid=848] Successfully activated service 'org.freedesktop.Tracker1'
Aug 01 17:52:21 dwt-lenovo-solus systemd[836]: Started Tracker metadata database store and lookup manager.
Aug 01 17:52:22 dwt-lenovo-solus xrdp-sesman[2242]: (2242)(140305131460416)[CORE ] waiting for window manager (pid 2248) to exit
Aug 01 17:52:22 dwt-lenovo-solus xrdp-sesman[2242]: (2242)(140305131460416)[CORE ] window manager (pid 2248) did exit, cleaning up session

It's the messages such as gkr-pam: unable to locate daemon control file which appear to be killing the login.

I sincerely apologise if this is in the incorrect place and please correct me if it is; I just wanted to point this out.

Thanks.

tarkah added a comment.EditedAug 6 2019, 11:24 PM

@davewthompson It still works, I use it every day. A few things:

  • Package and install using this diff, not the source or from the repository. Otherwise, install from repository and manually follow the guide I posted to Reddit here
  • Make sure you have xorgxrdp installed as well
  • I removed it from this diff, but make sure you create the Xwrapper.config at /etc/X11/Xwrapper.config, containing allowed_users=anybody
  • If you have remmina installed, and are using this diff, it will pickup the .desktop file installed by that package instead of budgie.desktop and fail to launch
Matf added a subscriber: Matf.Aug 14 2019, 5:19 PM
Matf added a comment.EditedAug 14 2019, 5:32 PM

I followed all the steps mentioned in the Reddit guide or in your above post @tarkah, but it is still failing for me. Could you please elaborate on your last point about the .desktop file?

I do have Remmina installed (on the client only), and when I try to connect to the server with it, it seems to authenticate correctly (no error prompt), but will end up on a black screen. "Relax Order Checks" and "Glyph Cache" are checked.

If I try to connect using xfreerdp with xfreerdp /w:1024 /v:solus-manips.local /u:mathieu /relax-order-checks +glyph-cache, I do get a login GUI, but then end up on a blue screen with no possible interaction.

I suppose it fails to start the DE in both cases, but I am not sure what I am missing if it does work for you.

tarkah added a comment.EditedOct 29 2019, 11:23 PM

@Matf Were you ever able to get this working? Sorry for my delayed response. My reference to the .desktop file was related to the various files installed to /usr/share/xsessions/ for each DE you may have installed on your machine. If you are using this diff with my changes to the startwm.sh file, it tries to extract the Exec= command from the first file in that folder and exec that (most people will usually only have a single DE installed so it will just pick it up from that file and this package will work dynamically regardless of DE being used). When you install Remmina on your machine, it apparently installs a .desktop file to that path, and unfortunately is picked up before the budgie-desktop.desktop. If you are using budgie, just hard code exec /usr/bin/budgie-desktop into your startwm.sh file.

If that's not the issue, no idea what else it could be. I have had xrdp working ever since 4.0 was released without any issues, outside the Reminna issue just mentioned. I mostly connect from Windows 10, maybe try a windows client just to rule out it isn't a client issue?

DataDrake requested changes to this revision.Nov 18 2019, 7:24 AM
DataDrake added a subscriber: DataDrake.

Why not just have multiple startup scripts in separate packages, one for each DE (e.g. xrdp-budgie-integration) with all the proper rundeps set?

This revision now requires changes to proceed.Nov 18 2019, 7:24 AM

That's definitely cleaner and simpler, I think we should take that route. Though it's more of an edge case, how would file collisions be handled if someone had multiple DE's and tried to install the "budgie" and "mate" integration packages? There's no concept of mutually exclusive packages, right?

Overall, it seems the best thing would be to have a new article published to the help center to cover setup and hazards for users wanting to use XRDP. If you'd prefer the integration package approach, I can work on creating those and eventually submit a PR to the help docs for a new page aligned with this approach.

@tarkah I'd rather have conflicting packages that only allow one DE to support remote access than a script that breaks as soon as two or more DEs are installed at the same time. Ortherwise, we still need a better approach than has been presented so far.

tarkah updated this revision to Diff 20812.EditedApr 13 2020, 11:55 PM

@DataDrake thanks for the feedback. See D8667, which will handle installing the startwm.sh file with applicable settings for budgie. If this looks good, I can create the same packages for Plasma, Gnome and Mate

DataDrake requested changes to this revision.Apr 15 2020, 4:54 AM

See D8667

This revision now requires changes to proceed.Apr 15 2020, 4:54 AM

I see how patterns would work to have another package just ship startwm.sh. But how would this work with 4 different packages shipping the same file / pattern?

tarkah updated this revision to Diff 20858.Apr 16 2020, 3:55 PM

Added xrdp-budgie-integration as sub-package with appropriate patterns / rundeps

I'm not sure how to include 3 more sub-packages for each DE into this package.yml since they all share the same pattern / file (with different file contents).

DataDrake requested changes to this revision.May 13 2020, 3:31 PM

I'm not sure how to include 3 more sub-packages for each DE into this package.yml since they all share the same pattern / file (with different file contents).

Ahhh. I'm not sure what I was smoking that day, but yeah, ypkg can't handle that. We will need to have separate packages for each of the DE integrations each with a conflicts section listing all of the other integration packages. Sorry for making you do more work because of my mistake.

This revision now requires changes to proceed.May 13 2020, 3:31 PM

No worries! I'll go ahead and revive D8667, adding a conflicts section. And then submit a few more for Mate, Gnome and Plasma.

tarkah updated this revision to Diff 21337.May 13 2020, 10:15 PM

Removed patterns.. back to separate packages they go!

I've added the integration package for Plasma: D8868

Mate Integration package D8869

Gnome Integration package D8870

Sweet, got them all added. Once you give this the green light, I'll go ahead and submit a PR for the help center docs. Should be as simple as installing the correct integration package and adding the /etc/X11/Xwrapper.config line allowed_users=anybody

DataDrake accepted this revision.May 14 2020, 2:45 AM

LGTM. Thanks!

This revision is now accepted and ready to land.May 14 2020, 2:45 AM
This revision was automatically updated to reflect the committed changes.