Xfce Forum

Sub domains
 

You are not logged in.

#1 2016-05-24 12:18:19

cmcanulty
Member
From: Beulah, Michigan
Registered: 2014-05-10
Posts: 259

vnc and xrdp

I am having no luck getting vnc and xrdp to work since upgrading to 16.04 I support 12 Xubuntu 16.04 computers at our local library and need this to work. My computer is also 16.04 xubuntu. I have tried researching and tweaking for 3 days including these 2 tutorials with no luck. I am now afraid I have tweaked so much that it will never be right.Thank you

http://scarygliders.net/xrdpconfigurator/

http://c-nergy.be/blog/?p=8952

Offline

#2 2016-05-24 15:46:52

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: vnc and xrdp

Using the instructions from http://c-nergy.be/blog/?p=8952, with the difference of using xfce4-session instead of mate-session, works for me on Xubuntu 16.04. Here are the commands that I used:

sudo apt-get install xrdp

Then, with root privileges, edit the file: /etc/xrdp/startwm.sh so that it looks like this (one line changed):

#!/bin/sh

if [ -r /etc/default/locale ]; then
  . /etc/default/locale
  export LANG LANGUAGE
fi

xfce4-session

...then enable and start the service:

sudo systemctl enable xrdp
sudo systemctl start xrdp

And finally, rdesktop in:

rdesktop x.x.x.x -u USER

...where x.x.x.x is the ip address of the machine and USER is the userid that you are connecting with.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2016-05-24 16:18:03

cmcanulty
Member
From: Beulah, Michigan
Registered: 2014-05-10
Posts: 259

Re: vnc and xrdp

that is very helpful, one question, can I have it with 2 users I connect to on the remote computer?

Offline

#4 2016-05-24 16:28:31

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: vnc and xrdp

What exactly do you mean?

You can simultaneously connect with two different user accounts, yes.
You can be logged in locally and connect with a second account, yes.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2016-05-24 16:40:20

cmcanulty
Member
From: Beulah, Michigan
Registered: 2014-05-10
Posts: 259

Re: vnc and xrdp

What I meant was I need to remotely login to the librarian and the darcy users so how would I do your edit with 2 users-
rdesktop x.x.x.x -u USER
also I get an error code even after I put the # before environment in the 2 files as suggested in http://c-nergy.be/blog/?p=8952 

librarian@Ubuntu5:~$ sudo apt-get install xrdp
[sudo] password for librarian:
Reading package lists... Done
Building dependency tree       
Reading state information... Done
xrdp is already the newest version (0.6.1-2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up xrdp (0.6.1-2) ...
A dependency job for xrdp.service failed. See 'journalctl -xe' for details.
invoke-rc.d: initscript xrdp, action "start" failed.
dpkg: error processing package xrdp (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
xrdp
E: Sub-process /usr/bin/dpkg returned an error code (1)
librarian@Ubuntu5:~$


I was really hoping to use xrdp with remmina like before as I have to do 12 computers over wan with 2 users each

Last edited by cmcanulty (2016-05-24 16:46:35)

Offline

#6 2016-05-24 16:56:01

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: vnc and xrdp

cmcanulty wrote:

What I meant was I need to remotely login to the librarian and the darcy users so how would I do your edit with 2 users-

You don't need to do the edits or instructions I listed above with 2 users. Use the user account that has root privileges to make the changes.

rdesktop x.x.x.x -u USER
also I get an error code even after I put the # before environment in the 2 files as suggested in http://c-nergy.be/blog/?p=8952

I'm sorry but I don't understand. Where in that blog does it say to put an "#" before "environment"? There is a sed command that they use - but you don't need it. Edit the /etc/xrdp/startwm.sh file directly and make it look like the example I showed above. You need to edit this file with root privileges.

If you have created a ~/.xsession file somewhere along the line, delete it. It is not required for this scenario.

librarian@Ubuntu5:~$ sudo apt-get install xrdp
[sudo] password for librarian:
Reading package lists... Done
Building dependency tree       
Reading state information... Done
xrdp is already the newest version (0.6.1-2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up xrdp (0.6.1-2) ...
A dependency job for xrdp.service failed. See 'journalctl -xe' for details.
invoke-rc.d: initscript xrdp, action "start" failed.
dpkg: error processing package xrdp (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
xrdp
E: Sub-process /usr/bin/dpkg returned an error code (1)
librarian@Ubuntu5:~$

Try purging xrdp:

sudo apt-get purge xrdp

...then to be on the safe side, reboot. Then re-install xrdp:

sudo apt-get install xrdp

...and follow my instructions above one more time. Post back if you get another error message re-installing xrdp.


I was really hoping to use xrdp with remmina like before as I have to do 12 computers over wan with 2 users each

Remmina is a graphical rdp client. It should also work. I was using the command line rdesktop application.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#7 2016-05-24 19:18:07

cmcanulty
Member
From: Beulah, Michigan
Registered: 2014-05-10
Posts: 259

Re: vnc and xrdp

OK here is the confusion, there are 2 articles from c-nergy the one that says to alter the 2 files with the # before environment is this link

http://c-nergy.be/blog/?p=8316 

I am afraid though that by following those links, and the scarygliders x11rdp-omatic, and the digital ocean link  I have things totally screwed up and need to somehow fix xrdp from scratch including all the edited files. I didn't realize until your reply that there are 2 c-nergy articles with different tweaks from each other. thank you. I really need to get this fixed.

Offline

#8 2016-05-24 19:58:26

cmcanulty
Member
From: Beulah, Michigan
Registered: 2014-05-10
Posts: 259

Re: vnc and xrdp

OK so I did the purge and install but I get the error again that I had altered the #environment in the 2 files to fix (changed them back to the original before the purge


librarian@Ubuntu5:~$ sudo apt-get purge xrdp
[sudo] password for librarian:
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  xrdp*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 1,620 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 236665 files and directories currently installed.)
Removing xrdp (0.6.1-2) ...
Purging configuration files for xrdp (0.6.1-2) ...
Removing user `xrdp' ...
Warning: group `xrdp' has no more members.
Done.
The group `xrdp' does not exist.
Processing triggers for man-db (2.7.5-1) ...
librarian@Ubuntu5:~$ sudo apt-get install xrdp
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  xrdp
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/215 kB of archives.
After this operation, 1,620 kB of additional disk space will be used.
Selecting previously unselected package xrdp.
(Reading database ... 236602 files and directories currently installed.)
Preparing to unpack .../xrdp_0.6.1-2_amd64.deb ...
Unpacking xrdp (0.6.1-2) ...
Processing triggers for systemd (229-4ubuntu6) ...
Processing triggers for ureadahead (0.100.0-19) ...
ureadahead will be reprofiled on next reboot
Processing triggers for man-db (2.7.5-1) ...
Setting up xrdp (0.6.1-2) ...
A dependency job for xrdp.service failed. See 'journalctl -xe' for details.
invoke-rc.d: initscript xrdp, action "start" failed.
dpkg: error processing package xrdp (--configure):
subprocess installed post-installation script returned error exit status 1
Processing triggers for systemd (229-4ubuntu6) ...
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
xrdp
E: Sub-process /usr/bin/dpkg returned an error code (1)
librarian@Ubuntu5:~$  sudo apt-get install xrdp
Reading package lists... Done
Building dependency tree       
Reading state information... Done
xrdp is already the newest version (0.6.1-2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up xrdp (0.6.1-2) ...
A dependency job for xrdp.service failed. See 'journalctl -xe' for details.
invoke-rc.d: initscript xrdp, action "start" failed.
dpkg: error processing package xrdp (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
xrdp
E: Sub-process /usr/bin/dpkg returned an error code (1)
librarian@Ubuntu5:~$ journalctl -xe
--
-- The start-up result is done.
May 24 15:59:38 Ubuntu5 systemd[1]: xrdp-sesman.service: Failed to load environm
May 24 15:59:38 Ubuntu5 systemd[1]: xrdp-sesman.service: Failed to run 'start' t
May 24 15:59:38 Ubuntu5 systemd[1]: Failed to start xrdp session manager.
-- Subject: Unit xrdp-sesman.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/li … temd-devel
--
-- Unit xrdp-sesman.service has failed.
--
-- The result is failed.
May 24 15:59:38 Ubuntu5 systemd[1]: Dependency failed for xrdp daemon.
-- Subject: Unit xrdp.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/li … temd-devel
--
-- Unit xrdp.service has failed.
--
-- The result is dependency.
May 24 15:59:38 Ubuntu5 systemd[1]: xrdp.service: Job xrdp.service/start failed
May 24 15:59:38 Ubuntu5 systemd[1]: xrdp-sesman.service: Failed with result 'res
May 24 15:59:40 Ubuntu5 sudo[6377]: pam_unix(sudo:session): session closed for u
lines 2158-2180/2180 (END)

Last edited by cmcanulty (2016-05-24 20:00:59)

Offline

#9 2016-05-24 21:05:15

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: vnc and xrdp

To begin with, I want to state that this really isn't an issue with Xfce. You're xrdp install is foo-bar'd. I can offer some general assistance, but I don't have too much experience with xrdp.

That being said, we need to see more of the log file since it truncates the ends (where the important parts are). Try this command instead:

sudo journalctl -u xrdp --no-pager

OK so I did the purge and install but I get the error again that I had altered the #environment in the 2 files to fix (changed them back to the original before the purge

Can you provide more information here. What two environment files did you change? What change did you make?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#10 2016-05-24 22:00:35

cmcanulty
Member
From: Beulah, Michigan
Registered: 2014-05-10
Posts: 259

Re: vnc and xrdp

OK from this web page I did the preferred fix.

http://c-nergy.be/blog/?p=8316

I am copying the relevant part below. But I undid the fix before I tried your purge and reinstall of xrdp

The Proper Fix

If you want to have systemd really managing the xrdp service, the proper fix here is to update the content of the xrdp.service and xrdp-sesman.service files. As mentioned above, these files contain information about path that does not apply to ubuntu.
xrdp.service file

The xrdp.service file should contain the following information.  copy/paste the text below into the /lib/systemd/system/xrdp.service file and save it.  You need to use sudo command in order to be able to modify this file.((i.e. sudo gedit /lib/systemd/system/xrdp.service)

    [Unit]
    Description=xrdp daemon
    Requires=xrdp-sesman.service
    After=syslog.target network.target xrdp-sesman.service

    [Service]
    Type=forking
    PIDFile=/var/run/xrdp.pid
    #EnvironmentFile=/etc/sysconfig/xrdp
    ExecStart=/usr/local/sbin/xrdp $XRDP_OPTIONS
    ExecStop=/usr/local/sbin/xrdp $XRDP_OPTIONS –kill

    [Install]
    WantedBy=multi-user.target

     

xrdp-sesman.service file

The xrdp-sesman.service file should look like the one below.  Copy/paste the text below into the /lib/systemd/system/xrdp-sesman.service file and save it.  You need to use sudo command in order to be able to modify this file. (i.e. sudo gedit /lib/systemd/system/xrdp-sesman.service)

    [Unit]
    Description=xrdp session manager
    After=syslog.target network.target
    StopWhenUnneeded=true

    [Service]
    Type=forking
    PIDFile=/var/run/xrdp-sesman.pid
    #EnvironmentFile=/etc/sysconfig/xrdp
    ExecStart=/usr/sbin/xrdp-sesman $SESMAN_OPTIONS
    ExecStop=/usr/sbin/xrdp-sesman $SESMAN_OPTIONS –kill

    [Install]
    WantedBy=multi-user.target


Using systemctl to apply changes

The final step here is to issue the following command because we have modified the service units files of XRDP.  Systemd needs to know about these changes.  From a Terminal session, you will issue the following command

    sudo systemctl daemon-reload

    sudo systemctl enable xrdp.service

Reboot your system and check that the xrdp service is starting properly.  If this is the case, you should be able to perform an xrdp connection and you are back on track.

  Here is the output of your command

librarian@Ubuntu5:~$ sudo journalctl -u xrdp --no-pager
[sudo] password for librarian:
-- Logs begin at Tue 2016-05-24 12:29:42 EDT, end at Tue 2016-05-24 17:59:55 EDT. --
May 24 12:29:59 Ubuntu5 systemd[1]: Dependency failed for xrdp daemon.
May 24 12:29:59 Ubuntu5 systemd[1]: xrdp.service: Job xrdp.service/start failed with result 'dependency'.
May 24 12:33:14 Ubuntu5 systemd[1]: Dependency failed for xrdp daemon.
May 24 12:33:14 Ubuntu5 systemd[1]: xrdp.service: Job xrdp.service/start failed with result 'dependency'.
May 24 12:42:03 Ubuntu5 systemd[1]: Dependency failed for xrdp daemon.
May 24 12:42:03 Ubuntu5 systemd[1]: xrdp.service: Job xrdp.service/start failed with result 'dependency'.
May 24 12:44:08 Ubuntu5 systemd[1]: Stopped xrdp daemon.
May 24 12:44:23 Ubuntu5 systemd[1]: Dependency failed for xrdp daemon.
May 24 12:44:23 Ubuntu5 systemd[1]: xrdp.service: Job xrdp.service/start failed with result 'dependency'.
May 24 15:19:20 Ubuntu5 systemd[1]: Stopped xrdp daemon.
May 24 15:19:44 Ubuntu5 systemd[1]: Stopped xrdp daemon.
May 24 15:20:50 Ubuntu5 systemd[1]: Dependency failed for xrdp daemon.
May 24 15:20:50 Ubuntu5 systemd[1]: xrdp.service: Job xrdp.service/start failed with result 'dependency'.
May 24 15:55:54 Ubuntu5 systemd[1]: Stopped xrdp daemon.
May 24 15:56:38 Ubuntu5 systemd[1]: Dependency failed for xrdp daemon.
May 24 15:56:38 Ubuntu5 systemd[1]: xrdp.service: Job xrdp.service/start failed with result 'dependency'.
May 24 15:59:38 Ubuntu5 systemd[1]: Dependency failed for xrdp daemon.
May 24 15:59:38 Ubuntu5 systemd[1]: xrdp.service: Job xrdp.service/start failed with result 'dependency'.
librarian@Ubuntu5:~$

Offline

#11 2016-05-25 00:13:26

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: vnc and xrdp

Okay, I see. Those two files you created are not needed. Do this:

Start off by disabling the existing xrdp service:

sudo systemctl disable xrdp

Then delete those two files:

sudo rm /lib/systemd/system/xrdp.service
sudo rm /lib/systemd/system/xrdp-sesman.service

Reload the systemd daemon:

sudo systemctl daemon-reload

Then start the xrdp daemon and see if you get any errors:

sudo systemctl start xrdp

If this works, don't forget to enable it so it starts automatically:

sudo systemctl enable xrdp

Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#12 2016-05-25 00:25:10

cmcanulty
Member
From: Beulah, Michigan
Registered: 2014-05-10
Posts: 259

Re: vnc and xrdp

Oh wow you got it to work! I connected to both users, now I have to recreate that on the other machines. I still got some errors, are they important? I wish I understood all this but I don.t. Thank you very much.

librarian@Ubuntu5:~$ sudo systemctl enable xrdp
xrdp.service is not a native service, redirecting to systemd-sysv-install
Executing /lib/systemd/systemd-sysv-install enable xrdp
insserv: warning: current start runlevel(s) (empty) of script `xrdp' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `xrdp' overrides LSB defaults (0 1 6).
librarian@Ubuntu5:~$

Offline

#13 2016-05-25 01:06:57

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: vnc and xrdp

Don't worry about them, they are just warnings. Everything is fine.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#14 2020-05-18 08:41:43

victorhj
Member
Registered: 2020-05-18
Posts: 1

Re: vnc and xrdp

ToZ wrote:

Don't worry about them, they are just warnings. Everything is fine.

Thank you! it makes me alive... I faced similar solution , after my ubuntu 18.04 restarted, xrdp failed with similar error.

Offline

Board footer

Powered by FluxBB