My personal and professional life

Showing posts with label Fedora. Show all posts
Showing posts with label Fedora. Show all posts

2020-01-09

Using xrdp on various Linuxes and a problem on Fedora

I've been using various Linuxes in virtual machines since more than 15 years in order to keep my skills sharp. It's simply not enough to know just one Linux distribution, but you have to know at least the major ones (e.g. Debian, RPM or based on another package management system ones). So apart from Slackware, I also regularly use Debian, Ubuntu, Fedora, OpenSuSE, CentOS and more recently Oracle Linux (for Oracle XE). Over the years, I have also experimented with Gentoo, FreeBSD, OpenBSD, NetBSD and others.
What I immediately need in any of these is secure shell (SSH) of course, so I could type commands remotely. However, I also like to work and play with GUI software, so I also need remote graphics access. Over the years I used VNC and NoMachine, but I never liked any of these for various reasons. What I have always missed in Linux was an easy to use access like RDP with real session management and all the other goodies that is lightweight and robust (e.g. NoMachine also manages sessions, but encodes video of the desktop, which makes the picture blurred and frequently doesn't work on my Linux virtual machines after upgrades).
So, I discovered xrdp, which is "an open source RDP server". It's easy to install, configure and run on Debian, Ubuntu and OpenSuSE and it just works. The installation for Fedora requires some additional steps, which are described in README.Fedora by xrdp package's maintainer Bojan Smojver. By default, xrdp on Fedora works only with VNC sessions, but I already said I do not like it, so I prefer using Xorg like with my other Linuxes. I'll summarize the steps here:
  1. Install necessary packages: dnf install xrdp xorgxrdp
  2. Edit /etc/xrdp/xrdp.ini and enable Xorg sessions;
  3. Enable access by anybody or just specific users, e.g. echo "allowed_users = anybody" >> /etc/X11/Xwrapper.config (see also bug 1450720);
  4. Enable port 3389 on the firewall, e.g. firewall-cmd --zone=dmz --add-port=3389/tcp
  5. Point your RDP client to the Linux machine and have fun.
Well, until yesterday. After upgrading my Fedora virtual machine to Fedora 31 the RDP connection stopped working with Xorg sessions although VNC sessions were working fine. The xrdp log at /var/log/xrdp-session.log was suggesting that the Xorg session is crashing just after it's started, so I was getting a blank screen.

[20200109-10:12:53] [INFO ] setpriv --no-new-privs Xorg :10 -auth .Xauthority -config xrdp/xorg.conf -noreset -nolisten tcp -logfile .xorgxrdp.%s.log
[20200109-10:12:53] [CORE ] waiting for window manager (pid 4902) to exit
[20200109-10:12:57] [CORE ] window manager (pid 4902) did exit, cleaning up session
[20200109-10:12:57] [INFO ] calling auth_stop_session and auth_end from pid 4877

Investigating the reason, I noticed the following in the journal (e.g. with journalctl -r):

Jan 09 10:12:55 fedora systemd[4881]: Failed to start GNOME Shell on X11.
Jan 09 10:12:55 fedora systemd[4881]: gnome-shell-x11.service: Failed with result 'protocol'.
Jan 09 10:12:55 fedora gnome-shell[5157]:   Current serial number in output stream:  359
Jan 09 10:12:55 fedora gnome-shell[5157]:   Serial number of failed request:  358
Jan 09 10:12:55 fedora gnome-shell[5157]:   Minor opcode of failed request:  7 (RRSetScreenSize)
Jan 09 10:12:55 fedora gnome-shell[5157]:   Major opcode of failed request:  139 (RANDR)
Jan 09 10:12:55 fedora gnome-shell[5157]: X Error of failed request:  BadMatch (invalid parameter attributes)
Jan 09 10:12:55 fedora xrdp-sesman[4870]: rdpRRScreenSetSize: not allowing resize
Jan 09 10:12:55 fedora xrdp-sesman[4870]: rdpRRScreenSetSize: width 1688 height 932 mmWidth 447 mmHeight 247
Jan 09 10:12:55 fedora gnome-shell[5157]: Xlib:  extension "DPMS" missing on display ":10.0".
Jan 09 10:12:55 fedora xrdp-sesman[4870]: rdpRRGetInfo:

So, gnome-shell was failing actually. Initially, I found bug 1575792, which seemed similar, but it wasn't resolved. Finally, the problem turned out to be the latest version of xorgxrdp 0.2.12 (see issue #156). I had to simply downgrade to xorgxrdp 0.2.11, by forcefully installing the RHEL 8's xorgxrdp package like this:

rpm --nodeps -i xorgxrdp-0.2.11-1.el8.x86_64.rpm

And things are again back to normal.

Update 2020-01-14: Of course it's good to eclude package xorgxrdp from upgrades (see Excluding Packages From Transactions) or simply echo "excludepkgs=xorgxrdp" >> /etc/dnf/dnf.conf as one line command.

Happy using your favorite Linux distro!

2018-10-21

First impressions from Oracle XE 18c trying to install it on Fedora 28/29 and Oracle Linux 7

Oracle released Oracle Database Express Edition (or better known as XE) on October 19, 2018. This date also happens to be my birthday, so what a birthday surprise! Let's get the present open and try it!
It was a long wait for Oracle XE 18c since the previous version (based on 11g Release 2) appeared more than 7 years ago (on September 24, 2011) and a release based on Oracle 12c never appeared. I was running XE on Fedora since 11g appeared in 2011, but with the new Fedora releases this become impossible. The database was behaving strange and was not usable after reboot, but I never found the time to investigate deeper these issues. I was thus considering trying Oracle Linux instead (see Which OS is “the best” for Oracle? for an expert opinion).

Fedora 28/29

Since I do not have enough space on the virtual machine I downloaded the RPMs on a server and tried to install them from an NFS mount following the instructions in the Quick Start:

[root@fedora ~]# yum -y localinstall /mnt/vm/oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm
Last metadata expiration check: 2:01:29 ago on Sun 21 Oct 2018 11:07:06 AM EEST.
Error:
 Problem: conflicting requests
  - nothing provides compat-libcap1 needed by oracle-database-preinstall-18c-1.0-1.el7.x86_64



Hmm... I'm just missing a required package compat-libcap1, but why it's not installed automatically?

[root@fedora ~]# yum install compat-libcap1
Last metadata expiration check: 1:24:06 ago on Sun 21 Oct 2018 11:07:06 AM EEST.
No match for argument: compat-libcap1
Error: Unable to find a match


That's strange, but Fedora doesn't provide this package. I found it in CentOS repository (direct download link) and after installing compat-libcap1 the preinstall RPM installed successfully. However, the database installation failed:

[root@fedora ~]# yum -y localinstall /mnt/vm/oracle-database-xe-18c-1.0-1.x86_64.rpm
Last metadata expiration check: 2:16:29 ago on Sun 21 Oct 2018 11:07:06 AM EEST.
Dependencies resolved.
==========================================================
 Package                Arch   Version Repository    Size
==========================================================
Installing:
 oracle-database-xe-18c x86_64 1.0-1   @commandline 2.4 G

Transaction Summary
==========================================================
Install  1 Package

Total size: 2.4 G
Installed size: 5.2 G
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Error: Transaction check error:
  package oracle-database-xe-18c-1.0-1.x86_64 does not verify: no digest
  installing package oracle-database-xe-18c-1.0-1.x86_64 needs 2472MB on the / filesystem


Error Summary
-------------
Disk Requirements:
   At least 2472MB more space needed on the / filesystem.


Apparently the disk space requirements have increased, because previously I was able to install XE 11gR2 on the same virtual machine. I had to enlarge the disk and extend the volume. However, the problem Error: Transaction check error: package oracle-database-xe-18c-1.0-1.x86_64 does not verify: no digest remains, so I wrote in the forum (see thread 14969247).

To overcome this I used the following command. But to make it work I had to install also libnsl (i.e. dnf install libnsl) and increase the disk space once more. Apparently, the installation of the RPM requires about 5.2 GB.

[root@fedora ~]# rpm -i --nodigest /mnt/vm/oracle-database-xe-18c-1.0-1.x86_64.rpm
warning: /mnt/vm/oracle-database-xe-18c-1.0-1.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
[INFO] Executing post installation scripts...
[INFO] Oracle home installed successfully and ready to be configured.
To configure Oracle Database XE, optionally modify the parameters in '/etc/sysconfig/oracle-xe-18c.conf' and then execute '/etc/init.d/oracle-xe-18c configure' as root.


Then, it's time to configure. For the creation of the database 4.5 GB more disk space is necessary.

[root@fedora ~]# /etc/init.d/oracle-xe-18c configure
Specify a password to be used for database accounts. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9]. Note that the same password will be used for SYS, SYSTEM and PDBADMIN accounts:
Confirm the password:
Configuring Oracle Listener.
Listener configuration succeeded.
Configuring Oracle Database XE.
[WARNING] [DBT-11209] Current available memory is less than the required available memory (796MB) for creating the database.
   CAUSE: Following nodes do not have required available memory :
 Node:fedora            Available memory:471.8672MB (483192.0KB)

Enter SYS user password:
*************
Enter SYSTEM user password:
*************
Enter PDBADMIN User Password:
**************
Prepare for db operation
7% complete
Copying database files
29% complete
Creating and starting Oracle instance
30% complete
31% complete
34% complete
38% complete
41% complete
43% complete
Completing Database Creation
47% complete
50% complete
Creating Pluggable Databases
54% complete
71% complete
Executing Post Configuration Actions
93% complete
Running Custom Scripts
100% complete
Database creation complete. For details check the logfiles at:
 /opt/oracle/cfgtoollogs/dbca/XE.
Database Information:
Global Database Name:XE
System Identifier(SID):XE
Look at the log file "/opt/oracle/cfgtoollogs/dbca/XE/XE.log" for further details.

Connect to Oracle Database using one of the connect strings:
     Pluggable database: fedora:1539/XEPDB1
     Multitenant container database: fedora:1539
Use https://localhost:5500/em to access Oracle Enterprise Manager for Oracle Database XE


Note: If you receive  Listener configuration failed. Check log '/opt/oracle/cfgtoollogs/netca/netca_configure_out.log' and into the log there is the line No valid IP Address returned for the host fedora simply set the fully qualified domain name (FQDN) into /etc/hostname and start configuration again.

The same procedure applies also to Fedora 29.

Oracle Linux Server 7.5

The installation of preinstall RPM happens smoothly:


[root@oracle ~]# yum -y localinstall /mnt/vm/oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm
Loaded plugins: ulninfo
Examining /mnt/vm/oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm: oracle-database-preinstall-18c-1.0-1.el7.x86_64
Marking /mnt/vm/oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package oracle-database-preinstall-18c.x86_64 0:1.0-1.el6 will be installed
...
--> Processing Dependency: compat-libcap1 for package: oracle-database-preinstall-18c-1.0-1.el6.x86_64
...
Dependencies Resolved

====================================================================
 Package                         Arch   Version     Repository Size
====================================================================
Installing:                                                  
 oracle-database-preinstall-18c  x86_64 1.0-1.el7   /oracle... 55 k
Installing for dependencies:                                 
...                                                          
 compat-libcap1                  x86_64 1.10-7.el7  ol7_latest 17 k
...
Install  1 Package (+37 Dependent packages)
...
Installed:
  oracle-database-preinstall-18c.x86_64 0:1.0-1.el7

Dependency Installed:
compat-libcap1.x86_64 0:1.10-7.el7
...
Complete!


The dependency on compat-libcap1 was easily resolved as well as 36 other dependencies, because my installation of Oracle Linux is new and I do not have many packages installed yet. The installation of the RPM with the database also happened without problems:

[root@oracle ~]# yum -y localinstall /mnt/vm/oracle-database-xe-18c-1.0-1.x86_64.rpm
Loaded plugins: ulninfo
Examining /mnt/vm/oracle-database-xe-18c-1.0-1.x86_64.rpm: oracle-database-xe-18c-1.0-1.x86_64
Marking /mnt/vm/oracle-database-xe-18c-1.0-1.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package oracle-database-xe-18c.x86_64 0:1.0-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

========================================================
 Package                 Arch   Version Repository Size
========================================================
Installing:
 oracle-database-xe-18c  x86_64 1.0-1   /oracle... 5.2 G

Transaction Summary
========================================================
Install  1 Package

Total size: 5.2 G
Installed size: 5.2 G
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : oracle-database-xe-18c-1.0-1.x86_64  1/1
[INFO] Executing post installation scripts...
[INFO] Oracle home installed successfully and ready to be configured.
To configure Oracle Database XE, optionally modify the parameters in '/etc/sysconfig/oracle-xe-18c.conf' and then execute '/etc/init.d/oracle-xe-18c configure' as root.
  Verifying  : oracle-database-xe-18c-1.0-1.x86_64  1/1

Installed:
  oracle-database-xe-18c.x86_64 0:1.0-1

Complete!


And apparently about 5.2 GB is the space really needed for the software itself, because before the installation I had about this space more on the volume. Let's try to configure the database then:

[root@oracle ~]# /etc/init.d/oracle-xe-18c configure
The location '/opt/oracle' specified for database files has insufficient space.
Database creation needs at least '4.5GB' disk space.
Specify a different database file destination that has enough space in the configuration file '/etc/sysconfig/oracle-xe-18c.conf'.


Aha... so the disk space requirements are actually pretty much the same as for Standard Edition on Linux. After resizing the virtual disk and enlarging the volume the configuration passes successfully for about 10 minutes:

[root@oracle ~]# /etc/init.d/oracle-xe-18c configure
Specify a password to be used for database accounts. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9]. Note that the same password will be used for SYS, SYSTEM and PDBADMIN accounts:
Confirm the password:
Configuring Oracle Listener.
Listener configuration succeeded.
Configuring Oracle Database XE.
Enter SYS user password:
*************
Enter SYSTEM user password:
***************
Enter PDBADMIN User Password:
***********
Prepare for db operation
7% complete
Copying database files
29% complete
Creating and starting Oracle instance
30% complete
31% complete
34% complete
38% complete
41% complete
43% complete
Completing Database Creation
47% complete
50% complete
Creating Pluggable Databases
54% complete
71% complete
Executing Post Configuration Actions
93% complete
Running Custom Scripts
100% complete
Database creation complete. For details check the logfiles at:
 /opt/oracle/cfgtoollogs/dbca/XE.
Database Information:
Global Database Name:XE
System Identifier(SID):XE
Look at the log file "/opt/oracle/cfgtoollogs/dbca/XE/XE.log" for further details.

Connect to Oracle Database using one of the connect strings:
     Pluggable database: oracle.sotirov-bg.net/XEPDB1
     Multitenant container database: oracle.sotirov-bg.net
Use https://localhost:5500/em to access Oracle Enterprise Manager for Oracle Database XE


Even after successful installation and configuration there are few manual steps necessary:
  •  Set environment variables. For this I just added the following to /etc/profile:
export ORACLE_HOME=/opt/oracle/product/18c/dbhomeXE
export ORACLE_SID=XE
pathmunge $ORACLE_HOME/bin after

  • Enable database start at system boot. For this I used the default script at /etc/init.d/oracle-xe-18c and executed one of the following:
chkconfig --add oracle-xe-18c; chkconfig oracle-xe-18c on
systemctl enable oracle-xe-18c
  • Enable access over the network. For this it's necessary to allow the default listener port 1521 on the firewall:
firewall-cmd --permanent --zone=public --add-port=1521/tcp
systemctl reload firewalld

Time to connect to the database:

[root@oracle ~]# sqlplus sys/password@//localhost:1521/XE as sysdba

SQL*Plus: Release 18.0.0.0.0 - Production on Sun Oct 21 19:16:35 2018
Version 18.4.0.0.0

Copyright (c) 1982, 2018, Oracle.  All rights reserved.

Connected to:
Oracle Database 18c Express Edition Release 18.0.0.0.0 - Production
Version 18.4.0.0.0

SQL>


Hurray! Now that the database is installed and accessible it's time to load some data and start experimenting.