Samba 4 Active Directory with Bind DLZ zones, dynamic DNS updates, Windows static RPC (update)

samba_logo_4cThis is a follow up to my previous post on how to install a Samba 4 enabled Active Directory system with Bind DLZ dynamic zones, dynamic DNS updates from Windows clients and how to assign a static RPC port to Windows services.

As of today, the Bind rebuild requirement to enable back ISC SPNEGO is not required anymore. With the help & time of Simo Sorce from Redhat the fix was pushed to the base Kerberos 5 libraries. You can now use the stock Bind to enable dynamic updates in all the current Fedora releases (19, 20 and Rawhide). Just make sure to have the Kerberos 5 libraries equal or greater than these versions:

* krb5-1.12.1-5.fc21
* krb5-1.11.5-4.fc20
* krb5-1.11.3-21.fc19

You can download these from here, if they are not yet in the repositories. Then, to re-align the Bind version to your current Fedora release just issue a yum distro-sync bind*, restart all services and you’re good to go.

Thank you very much to Simo Sorce for helping on this.

An update for all repositories

Another batch of updates to the repositories:

  • MakeMKV has been updated to version 1.8.8, according to the release notes it should contain proper support for Fedora’s OpenSSL package which generated SCSI errors with BluRay drives. The same version has been pushed to the CentOS/RHEL 6 repository, but due to very old ffmpeg packages in this distribution, there is no FLAC encoder for 24-bit audio in the build.
  • The Nvidia driver is now built also for Fedora 21 (rawhide) and for CentOS/RHEL 7 with the updated beta drivers directly from Nvidia (version 334.16). According to the release notes, the Nvidia DDX driver for X no longer loads the kernel module internally but relies on the nvidia-modprobe command in the system. Apparently this is not true, because the libraries try to load the kernel modules also with the system modprobe command if available. On Fedora 21 and RHEL 7 there is not yet aKMOD or kABI modules support as they are not available in their respective repositories; you have to rely on dkms-nvidia for installing the kernel module(s) on those distributions.
  • The CDRtools suite has been updated to version 3.01a22.
  • The Steam package has been updated to version 1.0.0.47, the same build has been pushed to RPMFusion.
  • The Flash plugin package has been updated to version 11.2.202.336 and Skype has been updated to version 4.2.0.13. Both versions have also been pushed to RPMFusion in the form of lpf packages.

Samba 4 Active Directory with Bind DLZ zones, dynamic DNS updates, Windows static RPC

Fedora enablement

Fedora currently needs a patched Samba package to enable the missing Domain Controller functionality. This guide is written against Samba 4.1.3 and Fedora 19, but later versions will work.

Hopefully this change will make it into official packages when Samba will be built with the system’s MIT Kerberos implementation. You can grab the latest Samba source packages from Koji.

The first patch is for disabling MIT Kerberos integration and enabling Heimdal Kerberos with Domain Controller functionality in the Redhat/Fedora package. This has also been reported upstream:

--- samba.spec    2014-02-10 10:00:52.000000000 +0100
+++ samba.spec.dc    2014-02-11 10:43:35.038262193 +0100
@@ -38,8 +38,8 @@
 %endif
 %endif

-%global with_mitkrb5 1
-%global with_dc 0
+%global with_mitkrb5 0
+%global with_dc 1

 %if %{with testsuite}
 # The testsuite only works with a full build right now.
@@ -81,6 +81,7 @@
 Source4: smb.conf.default
 Source5: pam_winbind.conf
 Source6: samba.pamd
+Source7: samba.service

 Source200: README.dc
 Source201: README.downgrade
@@ -245,6 +246,13 @@
 Group: Applications/System
 Requires: %{name}-common = %{samba_depver}
 Requires: %{name}-libs = %{samba_depver}
+Requires: tdb-tools >= %{libtdb_version}
+
+%if %with_dc
+Requires(post): systemd
+Requires(preun): systemd
+Requires(postun): systemd
+%endif

 Provides: samba4-dc-libs = %{samba_depver}
 Obsoletes: samba4-dc-libs < %{samba_depver}
@@ -631,6 +639,9 @@
 %if ! %with_dc
 install -m 0644 %{SOURCE200} packaging/README.dc
 install -m 0644 %{SOURCE200} packaging/README.dc-libs
+%else
+# Systemd unit files
+install -p -m 644 -D %{SOURCE7} %{buildroot}%{_unitdir}/samba.service
 %endif

 install -d -m 0755 %{buildroot}%{_unitdir}
@@ -693,6 +704,16 @@
 %post dc-libs -p /sbin/ldconfig

 %postun dc-libs -p /sbin/ldconfig
+
+%post dc
+%systemd_post samba.service
+
+%preun dc
+%systemd_preun samba.service
+
+%postun dc
+%systemd_postun_with_restart samba.service
+
 %endif # with_dc

 %post libs -p /sbin/ldconfig
@@ -1054,6 +1075,7 @@
 %{_datadir}/samba/setup
 %{_mandir}/man8/samba.8*
 %{_mandir}/man8/samba-tool.8*
+%{_unitdir}/samba.service
 %else # with_dc
 %doc packaging/README.dc
 %exclude %{_mandir}/man8/samba.8*

The second patch is for BIND, and is used to re-enable the ISC SPN negotiation when enabling GSS authentication, see samba-technical mailing post and CentOS bug 6526 for details. This patch is required only if you don’t have Kerberos 5 packages installed with at least the following versions/revisions:

* krb5-1.12.1-5.fc21
* krb5-1.11.5-4.fc20
* krb5-1.11.3-21.fc19

Note that to enable you actually have to disable the –disable-isc-spnego parameter.

--- bind.spec.old	2014-02-11 11:12:59.762770598 +0100
+++ bind.spec	2014-02-11 11:12:40.219951833 +0100
@@ -394,7 +394,6 @@
 %endif
 %if %{GSSTSIG}
   --with-gssapi=yes \
-  --disable-isc-spnego \
 %endif
   --enable-fixed-rrset \
   --with-docbook-xsl=%{_datadir}/sgml/docbook/xsl-stylesheets \

Version change

Do not forget to bump the Epoch in the RPM spec file so packages do not conflict and are not overwritten by official packages with a lower epoch.

After patching, rebuild the packages with your favorite tools, rpmbuild, mock or koji, whatever your preference is.

Software installation

Install BIND server (required also for other optional domains), the NTP server, the Samba suite and some additional tools used by our environment on the selected server. For servers; replace also firewalld with the base iptables service:

rpm -e firewalld
yum install iptables-services bind bind-utils ntp samba-dc samba-client tdb-tools \
    krb5-workstation policycoreutils-devel libselinux-utils cups
systemctl enable iptables
systemctl start cups
systemctl enable named
systemctl stop chronyd
systemctl disable chronyd
systemctl enable ntpd
systemctl enable samba

Networking

Disable IPv6

I had to disable IPv6 for my internal network, you might need to have it enabled. Do the following to permanently disable IPv6:

sysctl -w net.ipv6.conf.all.disable_ipv6=1

echo "net.ipv6.conf.all.disable_ipv6=1" > /etc/sysctl.conf

Firewall configuration

The following ports need to be opened on the firewall:

* TCP: 53, 88, 135, 445, 464, 1024-5000, 3268
* UDP: 53, 88, 123, 389, 464

Ports 1024-5000 are for the RPC services used by Samba, while port tcp/53 is used by Bind to receive DNS GSS record updates (they use TCP, not UDP).

Create the file /etc/sysconfig/iptables and insert the following contents:

*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp -d 192.168.23.8 --dport 5666 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp -d 192.168.23.8 --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp -d 192.168.23.8 --dport 53 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp -d 192.168.23.8 --dport 53 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp -d 192.168.23.8 --dport 88 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp -d 192.168.23.8 --dport 88 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp -d 192.168.23.8 --dport 123 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp -d 192.168.23.8 --dport 135 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp -d 192.168.23.8 --dport 389 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp -d 192.168.23.8 --dport 389 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp -d 192.168.23.8 --dport 445 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp -d 192.168.23.8 --dport 464 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp -d 192.168.23.8 --dport 464 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp -d 192.168.23.8 -m multiport --ports 1024:5000 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp -d 192.168.23.8 --dport 3268 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

Then start the firewall:

systemctl start iptables

Provisioning the domain

First setup and provisioning can be executed with SELinux disabled to be later re-enabled. This helps debugging issues that are not otherwise present with DAC permissions. Execute the following commands as root to start the provisioning:

setenforce 0
rm -f /etc/samba/smb.conf
samba-tool domain provision --dns-backend=BIND9_DLZ --realm=EXAMPLE.COM \
    --domain=EXAMPLE --server-role=dc --function-level=2008_R2 \
    --adminpass=Password01

Alternatively it can be run without parameters and the installation will be interactive. An output like the following will be returned:

Looking up IPv4 addresses
Looking up IPv6 addresses
No IPv6 address will be assigned
Setting up secrets.ldb
Setting up the registry
Setting up the privileges database
Setting up idmap db
Setting up SAM db
Setting up sam.ldb partitions and settings
Setting up sam.ldb rootDSE
Pre-loading the Samba 4 and AD schema
Adding DomainDN: DC=example,DC=com
Adding configuration container
Setting up sam.ldb schema
Setting up sam.ldb configuration data
Setting up display specifiers
Modifying display specifiers
Adding users container
Modifying users container
Adding computers container
Modifying computers container
Setting up sam.ldb data
Setting up well known security principals
Setting up sam.ldb users and groups
Setting up self join
Adding DNS accounts
Creating CN=MicrosoftDNS,CN=System,DC=example,DC=com
Creating DomainDnsZones and ForestDnsZones partitions
Populating DomainDnsZones and ForestDnsZones partitions
See /var/lib/samba/private/named.conf for an example configuration include file for BIND
and /var/lib/samba/private/named.txt for further documentation required for secure DNS updates
Setting up sam.ldb rootDSE marking as synchronized
Fixing provision GUIDs
A Kerberos configuration suitable for Samba 4 has been generated at /var/lib/samba/private/krb5.conf
Once the above files are installed, your Samba4 server will be ready to use
Server Role:           active directory domain controller
Hostname:              samba
NetBIOS Domain:        EXAMPLE
DNS Domain:            example.com
DOMAIN SID:            S-1-5-21-1504993763-4098306314-3392174306

Disable NetBIOS

Edit the file /etc/samba/smb.conf and make sure that the [global] section contains the following lines (in addition to the others) to disable NetBIOS support:

[global]
    server services = -dns, -nbt
    smb ports = 445

Windows 2000 and later systems setup two connections simultaniously to a server one on port 445 and one on port 139. If it gets a response from port 445 it will reset (RST) the port 139 connection. If it only gets a response from port 139, that one is used. If you disable NBT (NetBIOS over TCP/IP) on your client only port 445 is being tried. Pre-Windows 2000 clients only use port 139.

Configure Kerberos

Copy the provision generated Kerberos file to the default system location:

cp /var/lib/samba/private/krb5.conf /etc/krb5.conf

Make sure the Kerberos configuration file contains the check-ticket-addresses directive; as it is required for clients connecting through a NAT; which is the case for our IIMs / Remote PCs.

--- /etc/krb5.conf.old	2013-04-08 15:49:33.310944976 +0200
+++ /etc/krb5.conf	2013-04-08 15:49:57.989473099 +0200
@@ -2,3 +2,6 @@
 	default_realm = EXAMPLE.COM
 	dns_lookup_realm = false
 	dns_lookup_kdc = true
+
+[kdc]
+	check-ticket-addresses = false

Configure NTP server

Change the NTP configuration file to enable Microsoft signed time queries:

--- /etc/ntp.conf.default	2013-08-09 10:10:07.362235547 +0200
+++ /etc/ntp.conf	2013-08-19 12:31:44.356572515 +0200
@@ -5,8 +5,8 @@

 # Permit time synchronization with our time source, but do not
 # permit the source to query or modify the service on this system.
-restrict default kod nomodify notrap nopeer noquery
-restrict -6 default kod nomodify notrap nopeer noquery
+restrict default kod nomodify notrap nopeer noquery mssntp
+restrict -6 default kod nomodify notrap nopeer noquery mssntp

 # Permit all access over the loopback interface.  This could
 # be tightened as well, but to do so would effect some of
@@ -51,3 +51,5 @@

 # Enable writing of statistics records.
 #statistics clockstats cryptostats loopstats peerstats
+
+ntpsigndsocket /var/lib/samba/ntp_signd/

Change permissions of the NTP folders which should be accessible by the NTP daemon:

chgrp ntp /var/lib/samba/ntp_signd/

Configure DNS server

Look at the hints in the previous output regarding Bind and modify the file /etc/named.conf and remember to fill appropriately the zone files with the correct records. Replace my addresses with yours, of course.

--- named.conf.rpmnew	2013-10-30 12:35:25.000000000 +0100
+++ named.conf	2014-02-11 10:19:13.361403985 +0100
@@ -8,29 +8,24 @@
 //

 options {
-	listen-on port 53 { 127.0.0.1; };
+	listen-on port 53 { 127.0.0.1; 192.168.1.8; };
 	listen-on-v6 port 53 { ::1; };
 	directory 	"/var/named";
 	dump-file 	"/var/named/data/cache_dump.db";
 	statistics-file "/var/named/data/named_stats.txt";
 	memstatistics-file "/var/named/data/named_mem_stats.txt";
-	allow-query     { localhost; };
+	// forwarders  { 192.168.1.54; 192.168.1.55; };
+	allow-query { any; };

-	/* 
-	 - If you are building an AUTHORITATIVE DNS server, do NOT enable recursion.
-	 - If you are building a RECURSIVE (caching) DNS server, you need to enable 
-	   recursion. 
-	 - If your recursive DNS server has a public IP address, you MUST enable access 
-	   control to limit queries to your legitimate users. Failing to do so will
-	   cause your server to become part of large scale DNS amplification 
-	   attacks. Implementing BCP38 within your network would greatly
-	   reduce such attack surface 
-	*/
-	recursion yes;
-
-	dnssec-enable yes;
-	dnssec-validation yes;
-	dnssec-lookaside auto;
+	/* Allow recursion from Samba server itself and its Windows management system */
+	allow-recursion {
+        	192.168.1.8;
+        	192.168.1.11;
+	};
+
+	dnssec-enable no;
+	dnssec-validation no;
+	// dnssec-lookaside auto;

 	/* Path to ISC DLV key */
 	bindkeys-file "/etc/named.iscdlv.key";
@@ -38,7 +33,8 @@
 	managed-keys-directory "/var/named/dynamic";

 	pid-file "/run/named/named.pid";
-	session-keyfile "/run/named/session.key";
+
+	tkey-gssapi-keytab "/var/lib/samba/private/dns.keytab";
 };

 logging {
@@ -56,3 +52,6 @@
 include "/etc/named.rfc1912.zones";
 include "/etc/named.root.key";

+dlz "example.com" {
+	database "dlopen /usr/lib64/samba/bind9/dlz_bind9_9.so";
+};

The DNS server can also to be authoritative for additional stub zones hosted in the same BIND instance, as an example:

// Additional zones required for EXAMPLE
zone "swisslos.ch" IN {
	type master;
	file "/var/named/swisslos.ch.zone";
};

Change permissions to reach the folders containing the dynamic zones which should be accessible by Bind:

chgrp named /var/lib/samba/private /etc/krb5.conf
chmod g+rx /var/lib/samba/private

Disable IPv6 also on Bind, to avoid flooding the logs with unwanted messages. Add the following line to /etc/sysconfig/named:

OPTIONS="-4"

Starting services

Make the Samba system use its Bind recursive DNS server as primary DNS. This is required for proper Samba 4 operation of the Domain Controller. Any external request made by the server will be forwarded through the POP DNS servers.

Edit /etc/sysconfig/network-scripts/ifcfg- and change the DNS1 line to read as follows:

DNS1=192.168.1.8

Then delete all other DNS* lines from the file. Afterwards restart the network:

systemctl restart NetworkManager

Finally start Bind, NTP server and Samba:

systemctl start named
systemctl start samba
systemctl start ntpd

Troubleshooting

For debugging, launch Bind, the NTP server and Samba with the following options to start them in the foreground:

named -u named -f -g -d 2
ntpd -u ntp:ntp -g -I 192.168.23.08 -D 3
samba -i -M single -d 3

MS-SNTP troubleshooting

To troubleshoot NTP settings, perform the following command on the Windows clients to check the Windows Time Service settings and status:

w32tm /query /status /verbose

You should obtain an output like the following:

Leap Indicator: 0(no warning)
Stratum: 4 (secondary reference - syncd by (S)NTP)
Precision: -6 (15.625ms per tick)
Root Delay: 0.0458527s
Root Dispersion: 7.9058500s
ReferenceId: 0xC0A81708 (source IP:  192.168.1.8)
Last Successful Sync Time: 8/19/2013 2:33:08 PM
Source: samba.example.com
Poll Interval: 10 (1024s)

Phase Offset: -0.0377036s
ClockRate: 0.0156007s
State Machine: 1 (Hold)
Time Source Flags: 2 (Authenticated )
Server Role: 0 (None)
Last Sync Error: 0 (The command completed successfully.)
Time since Last Good Sync Time: 34.8648825s

It identifies the last succesful sync time; the fact that the client / server communication is using MS-SNTP to communicate (Time Source Flags: 2 (Authenticated )) and that the last command was executed successfully.

In case it doesn’t work; to manually set Windows Time Service configuration to read NTP settings from the domain perform the following commands to reset the configuration and to sync again the client to the server:

w32tm /config /update /syncfromflags:DOMHIER
w32tm /resync

Then check again the status with the previous command.

If the time server specified in the Windows client is a normal NTP server, then the Windows client will not ask for MS-SNTP signed responses. The command to synchronize the clock is as follows:

w32tm /config /update /syncfromflags:MANUAL
w32tm /resync

This is the output of the query:

Leap Indicator: 0(no warning)
Stratum: 5 (secondary reference - syncd by (S)NTP)
Precision: -6 (15.625ms per tick)
Root Delay: 0.0853119s
Root Dispersion: 7.8537712s
ReferenceId: 0xC0A80101 (source IP:  192.168.1.1)
Last Successful Sync Time: 1/28/2014 3:47:02 PM
Source: 192.168.1.1
Poll Interval: 10 (1024s)

Phase Offset: 0.3340008s
ClockRate: 0.0156001s
State Machine: 1 (Hold)
Time Source Flags: 0 (None)
Server Role: 0 (None)
Last Sync Error: 0 (The command completed successfully.)
Time since Last Good Sync Time: 3.3566832s

Please note that the Time Source Flags do not list the sync as Authenticated.

Kerberos authentication

Test the Active Directory Administrator password and check that the Kerberos ticket and password policies are valid:

$ kinit administrator@EXAMPLE.COM
Password for administrator@EXAMPLE.COM: 
Warning: Your password will expire in 41 days on Mon 20 May 2013 02:19:04 PM CEST
$ klist
Ticket cache: FILE:/tmp/krb5cc_1000
Default principal: administrator@EXAMPLE.COM

Valid starting       Expires              Service principal
04/08/2013 15:45:14  04/09/2013 01:45:14  krbtgt/EXAMPLE.COM@EXAMPLE.COM
	renew until 04/09/2013 15:45:10

SMB/CIFS file sharing

You should now see all your local default shares by browsing:

$ smbclient -L localhost -U%

To test that authentication is working, you should try to connect to the netlogon share using the Administrator password you set earlier:

$ smbclient //localhost/netlogon -UAdministrator%'Password01' -c 'ls'

To see that all the required DNS records are exposed in the DNS, launch the following commands:

$ host -t SRV _ldap._tcp.example.com.
_ldap._tcp.example.com has SRV record 0 100 389 samba.example.com.
$ host -t SRV _kerberos._udp.example.com.
_kerberos._udp.example.com has SRV record 0 100 88 samba.example.com.
$ host -t A samba.example.com.
samba.example.com has address 192.168.1.8

DNS and GSSEC records insertion/deletion

To test DNS dynamic updates perform the following command on the Windows client:

ipconfig /registerdns

This will create a DNS record for the system in the Active Directory DNS zone using a secure Kerberos authenticated update.

If the record does not appear start debugging on the server for DNS records availability and proper functioning of the DLZ zone. To proceed launch the following command with both Samba and Bind running:

samba_dnsupdate --verbose --all-names
samba_dnsupdate --verbose

This will fetch all the minimum required DNS records for Active Directory from the Samba database and try to re-insert them into the zone using a kerberized (GSSEC) DNS update to the Bind server.

In case you obtain the following message while trying to run the above command:

dns_tkey_negotiategss: TKEY is unacceptable

This means you have some problems with your current Bind Kerberos keytab file. Perform the following command to check that the service principals are contained in the file:

# klist -k -K -t /var/lib/samba/private/dns.keytab
Keytab name: FILE:/var/lib/samba/private/dns.keytab
KVNO Timestamp           Principal
---- ------------------- ------------------------------------------------------

If you obtain an empty list like the one above, extra the DNS service principal with the following command.

samba-tool domain exportkeytab --principal=DNS/samba.example.com \
    /var/lib/samba/private/dns.keytab

After generation, make sure to check again its contents. If the file is totally corrupt, regenerate it and apply permissions again. You should have some contents like the following:

# klist -k -K -t /var/lib/samba/private/dns.keytab

Keytab name: FILE:/var/lib/samba/private/dns.keytab
KVNO Timestamp           Principal
---- ------------------- ------------------------------------------------------
   1 15/04/2013 14:08:56 DNS/samba.example.com@EXAMPLE.COM (0xd95bd6c789b30d0d)
   1 15/04/2013 14:08:56 DNS/samba.example.com@EXAMPLE.COM (0xd95bd6c789b30d0d)
   1 15/04/2013 14:08:56 DNS/samba.example.com@EXAMPLE.COM (0x9208e7dd4029fe8bdaa18dee16ffb8fc)
   1 15/04/2013 14:08:56 DNS/samba.example.com@EXAMPLE.COM (0x79c8d7df152f3a7d5c42a3fe64248caa4faf854579b66453bea9af7c155286f9)
   1 15/04/2013 14:08:56 DNS/samba.example.com@EXAMPLE.COM (0x5ab2a4df523518d47d3b8f6be79faa2f)

In case you’re guessing what are those weird record types (like RT) you see queried in Samba’s DNS by Windows Clients, please look at the following links:

* http://www.iana.org/assignments/dns-parameters/dns-parameters.xml
* http://technet.microsoft.com/en-us/library/cc758321%28v=ws.10%29.aspx

Windows client networking adjustments

Disable NetBios over TCP/IP

To make the necessary tests; make sure that the Windows system has NetBIOS over TCP/IP disabled in the Advanced TCP/IP settings configuration pane.

Disable-netbios

Windows 2000 and later systems setup two connections simultaniously to a server one on port 445 and one on port 139. If it gets a response from port 445 it will reset (RST) the port 139 connection. If it only gets a response from port 139, that one is used. If you disable NBT (NetBIOS over TCP/IP) on your client only port 445 is being tried. Pre-Windows 2000 clients only use port 139.

Disable Teredo IPv6 Tunneling

To disable Teredo IPv6 Tunnelling execute the following command in an Administrator Windows command prompt:

netsh interface teredo set state disabled

Disable NCSI testing

To disable Network Connectivity Status Indicator checking on Microsoft servers for internet connectivity, start the Group Policy Editor (gpedit.msc); navigate to the correct tree and set “Turn off Windows Network Connectivity Status Indicator active tests” to Enable.

Disable-ncsi

Windows firewall integration

For Windows 7, the following ports need to be enabled in the firewall; all the other rules should be disabled. This is a subset of the ones listed in Microsoft’s Active Directory required ports:

* TCP: 135, 445, 3268, 1024-5000, 49154
* UDP: 123
* TCP/UDP: 53, 88, 389, 464

To make the RPC server listen only on port 49154; the following registry file needs to be applied and the system rebooted:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Rpc\Internet]
"Ports"=hex(7):34,00,39,00,31,00,35,00,34,00,00,00,00,00
"PortsInternetAvailable"="Y"
"UseInternetPorts"="Y"

Commands to add the Windows Firewall rules from the command line:

netsh advfirewall firewall add rule name="Samba-TCP-In" protocol=TCP localport="88,135,445,49154" action=allow dir=IN remoteip=192.168.1.8
netsh advfirewall firewall add rule name="Samba-UDP-In" protocol=UDP localport="88" action=allow dir=IN remoteip=192.168.1.8
netsh advfirewall firewall add rule name="Samba-TCP-Out" protocol=TCP localport="53,88,135,389,445,464,1024-5000,3268" action=allow dir=OUT remoteip=192.168.1.8
netsh advfirewall firewall add rule name="Samba-UDP-Out" protocol=UDP localport="53,88,389,464" action=allow dir=OUT remoteip=192.168.1.8

To debug connections, use the PortQueryUI command that you can download from the Microsoft website:

* http://www.microsoft.com/en-us/download/details.aspx?id=24009

Updated repositories for Steam, Nvidia, HandBrake/MakeMKV, CDRtools

Another batch of updates to the repositories:

  • MakeMKV has finally been updated to version 1.8.7-2, which contains a small tweak as suggested in MakeMKV‘s forums to re-enable internal SSL support. This should solve all SCSI errors when decrypting BluRay discs on recent Fedora OpenSSL releases that do not ship all EC curves.
  • The HandBrake build with some of the bundled libraries removed in favour of system libraries (~50% of them) has been pushed as the supported build.
  • The nvidia-settings package now builds the external libXNVCtrl.so library that can be used to control the graphic cards through the NV-CONTROL extension. This library updates the old and obsolete one in Fedora based on drivers version 165.
  • The CDRtools suite has been updated to version 3.01a21.
  • The Steam package now produces an additional steam-noruntime subpackage that contains all the library requirements for running Steam without using the Steam Runtime. More details on the Steam repository page. This build has also been pushed to RPMFusion and will become the next update; so users which have the Steam package installed from the RPMFusion repositories will still have a Valve supported configuration with the Runtime enabled.

Experimental builds of HandBrake with system libraries

In addition to the normal HandBrake, MakeMKV and libdvdcss repository, I’m preparing the next set of HandBrake packages, whether they be the SVN version or different builds of the released version 0.9.9.

Considering that from version 0.9.9 HandBrake supports using system libraries in place of the external ones, I’ve built the Fedora 20 packages for x86_64 with a few additions:

  • Fedora’s GCC default compiler options.
  • Use of system libraries for libbluray, lame, mpeg2dec, a52dec (with patch), libmkv (with patch) and x264.
  • Use GStreamer 1.x in place of GStreamer 0.x on Fedora.
  • Addition of the optional fdk-aac encoders.

Since I’m not sure about the stability of the program with its bundled libraries removed in favour of system ones and the forcing of Fedora’s GCC compiler options, I’m not pushing this updated packages in the repositories for a while; but instead I’m asking users to test it and provide some feedback.

$ rpm -q --requires HandBrake-gui | egrep -i "gst|x264|mkv|mpeg|mkv|a52|lame|blu"
liba52.so.0()(64bit)
libbluray.so.1()(64bit)
libgstaudio-1.0.so.0()(64bit)
libgstbase-1.0.so.0()(64bit)
libgstpbutils-1.0.so.0()(64bit)
libgstreamer-1.0.so.0()(64bit)
libgstvideo-1.0.so.0()(64bit)
libmkv.so.0()(64bit)
libmp3lame.so.0()(64bit)
libmpeg2.so.0()(64bit)
libx264.so.138()(64bit)

The package gets also 400kb smaller than the one with the bundled libraries. All the other libraries still bundled (faac, fdk-aac, libav, libdvdnav, libdvdread, mp4v2) cannot be removed due to patching and/or using different versions.

If you happen to have a Fedora 20 x86_64 system and would like to help, please install the HandBrake repository and then install the updated HandBrake packages:

yum install https://negativo17.org/repos/HandBrake/fedora-20/x86_64/HandBrake-gui-0.9.9-9.fc20.x86_64.rpm

If you also want the command line version:

yum install https://negativo17.org/repos/HandBrake/fedora-20/x86_64/HandBrake-cli-0.9.9-9.fc20.x86_64.rpm

And then let me know, by post comments or by mail.

Steam runtime, disabling again

After re-enabling the Steam (ubuntu) runtime in package version 1.0.0.43-9, I’ve made some more tests with the runtime disabled on my systems.

The main driving factor for re-enabling the runtime was the introduction by Valve of the obsolete libudev.so.0 which has been replaced by libudev.so.1 library during the Fedora 18 release cycle.

I’ve now added back all libraries required for the client in the package prerequisites and disabled the runtime again. This time it has been disabled not through a profile script that is sourced at login time, but I’ve instead patched the main steam script in the package with a very simple patch:

--- steam.old/steam	2013-12-20 20:50:34.014610244 +0100
+++ steam/steam	2013-12-20 21:59:57.731725731 +0100
@@ -186,6 +186,17 @@
 # go to the install directory and run the client
 cp "$LAUNCHSTEAMBOOTSTRAPFILE" "$LAUNCHSTEAMDIR/bootstrap.tar.xz"
 cd "$LAUNCHSTEAMDIR"
+
+if [ ! -v STEAM_RUNTIME ]; then
+    if [ ! -h $LAUNCHSTEAMPLATFORM/libudev.so.0 ]; then
+        ln -sf /usr/lib/libudev.so.1 $LAUNCHSTEAMPLATFORM/libudev.so.0
+    fi
+    rm -fr $LAUNCHSTEAMPLATFORM/steam-runtime
+    export STEAM_RUNTIME=0
+else
+    rm -f $LAUNCHSTEAMPLATFORM/libudev.so.0
+fi
+
 if [ "`command -v tee`" != "" ]; then
 	mkdir -p --mode=777 /tmp/dumps
 	exec "$LAUNCHSTEAMDIR/$STEAMBOOTSTRAP" "$@" 2>&1 | tee "/tmp/dumps/${USER}_stdout.txt"

This checks if the STEAM_RUNTIME environment variable has been set and takes action accordingly. In the case it has not been set (the default), the script creates a symlink to the system libudev.so.1 library in the Steam folder and deletes the unpacked Ubuntu runtime. On the contrary, if you want the Ubuntu runtime enabled, by launching Steam with STEAM_RUNTIME=1 steam it will simply unpack again the runtime and restore the normal behaviour by deleting the symlink.

By using Steam’s internal variables, this also works in the following cases:

  • You’ve moved your Steam installation folder
  • You have played with the runtime enabled and are going to disable and viceversa
  • Saves me a lot of emails if I’m issuing an update to the Steam package that enables / disables the runtime; without the need for logging your user out, it works out of the box even after an update and a rerun in the same desktop session

I would say that here the “keep it simple stupid” principle applies perfectly.

The size of the Steam client has now become a little thinner again on the system on where it is installed. For comparison, here is today’s difference in size for a Steam beta client installation that uses the runtime and one that doesn’t (the SteamApps folder is the folder where applications/games are installed):

$ cd Steam
$ du -hs --exclude=SteamApps
1.4G .
$ du -hs --exclude=SteamApps --exclude=steam-runtime
1.1G .

Again, if we could run the client forcing it to avoid downloading the runtime archives as well; then the client would weigh nearly 500 mb less:

$ du -hs --exclude=SteamApps --exclude=steam-runtime*
906M

I’ve pushed this change only on the repository on this site, if it works fine and I see no objections I will push the change in RPMFusion’s repositories. The instructions in the repository page have been updated, including information on how to move your Steam installation around.

Any feedback is much appreciated!

Just in case you’re wondering, yes, I have a lot of games (~100), mostly bought off through the Humble Bundle bundles!

steam

New and updated repositories

In the past few days, I’ve updated most of the repositories:

  • The Flash plugin repository does now contain separate control center packages (so an x86_64 system can have both i686 and x86_64 plugins but one control center) and has been updated to version 11.2.202.332.
  • MakeMKV has finally been updated to version 1.8.7, solving all the bugs that have been introduced by upstream in version 1.8.6.
  • Steam has been updated to version 1.0.0.45.
  • All the repository pages now contain updated instructions and information.

As a latest addition, a repository for the Spotify client (upon a colleague request) and for the RAR archiver have been added.

MakeMKV beta registration key

MakeMKV has been updated to version 1.8.6; which requires FFMpeg version 2.x to compile succesfully. Unfortunately FFMpeg is available only in Fedora 20; so at the moment there’s no way to push MakeMKV 1.8.6 to the repositories.

If you are already running Fedora 20; you should receive MakeMKV version 1.8.6 along with the updates; otherwise please use the provided beta registration key published by the developers:

http://www.makemkv.com/forum2/viewtopic.php?f=5&t=1053

After starting MakeMKV just press the “Register” button and paste the provided code:

makemkv_register

I’ve added a note on the repository page with the registration details.

DKMS patches for ZFS On Linux merged

Thanks to the awesome help of the ZFS On Linux team (Darik Horn, Brian Behlendorf and Richard Yao) now all the ZFS On Linux patches required for DKMS functionality are now integrated into the EPEL 6 and Fedora DKMS packages. This means that in a future ZFS On Linux release a custom DKMS package will not be required for those platforms.

Please leave some feedback for version 2.2.0.3-20 if it works for you!

Nvidia driver repository updated

I’ve updated the Nvidia driver repository to the latest 331.20 release. Since this release has been promoted by Nvidia to a long lived branch release; also the CentOS/RHEL 6 repository has been updated to this version. This means all currently supported Fedora releases have the same driver version as in CentOS/RHEL.

This driver release brings the usual assortment of fixes and features; but the most important things are the additions of the Unified Video Memory kernel module, the “private” Nvidia OpenGL Framebuffer Compression libraries and the packaging introduction of the multiple kernel modules as an alternative to the single module; as specified by the driver documentation.

Starting from the less important things, the Nvidia OpenGL Framebuffer Compression libraries have been packaged into a separate package as their usage is very specific and according to the documentation their usage is documented only with specific approved Nvidia partners. I’m pretty sure we will not miss these libraries on our systems.

Kernel module packages now contain/generate also the nvidia-uvm.ko kernel module and the multiple nvidia.ko modules that can be used to assign separate kernel module instances to separate GPU devices.

The resulting install of the kernel module packages ends up like this:

$ ls -laghs
total 127M
4.0K drwxr-xr-x. 2 root 4.0K Nov  7 20:20 .
4.0K drwxr-xr-x. 6 root 4.0K Nov  7 20:20 ..
 15M -rw-r--r--. 1 root  15M Nov  7 20:20 nvidia0.ko
 15M -rw-r--r--. 1 root  15M Nov  7 20:20 nvidia1.ko
 15M -rw-r--r--. 1 root  15M Nov  7 20:20 nvidia2.ko
 15M -rw-r--r--. 1 root  15M Nov  7 20:20 nvidia3.ko
 15M -rw-r--r--. 1 root  15M Nov  7 20:20 nvidia4.ko
 15M -rw-r--r--. 1 root  15M Nov  7 20:20 nvidia5.ko
 15M -rw-r--r--. 1 root  15M Nov  7 20:20 nvidia6.ko
 15M -rw-r--r--. 1 root  15M Nov  7 20:20 nvidia7.ko
 12K -rw-r--r--. 1 root  11K Nov  7 20:20 nvidia-frontend.ko
 15M -rw-r--r--. 1 root  15M Nov  7 20:20 nvidia.ko
 48K -rw-r--r--. 1 root  48K Nov  7 20:20 nvidia-uvm.ko
$ du -hs .
127M    .

As you can see, the space used by these modules is huge; and they are only used in specific setups. I’m planning to make the multiple kernel modules in an optional package that can be installed separately from the main nvidia.ko and nvidia-uvm.ko modules.

Currently DKMS and AKMODs packages have these modules enabled; but the binary kMOD package for CentOS/RHEL 6 does not contain them. If I try to integrate them into the package, the kABI list of symbols is not exported correctly and I don’t know why. All the numbered modules are very similar (each one contains the 12 mb binary object that is included in the normal module) and for some reason this screws up the package assembly. In detail, this is the binary kMOD package that does not contain the numbered modules:

$ rpm -qp --requires kmod-nvidia-331.20-1.el6.x86_64.rpm
rpmlib(VersionedDependencies) <= 3.0.3-1
nvidia-driver = 2:331.20
/sbin/depmod
/sbin/depmod
/bin/sh
/bin/sh
/bin/sh
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(CompressedFileNames) <= 3.0.4-1
kernel(__free_pages) = 0xffd35acd
kernel(__init_rwsem) = 0xa2b8a2ba
kernel(__list_add) = 0x0343a1a8
kernel(__lock_page) = 0xda778235
kernel(__stack_chk_fail) = 0xf0fdf6cb
kernel(_cond_resched) = 0xa1c76e0a
kernel(alloc_chrdev_region) = 0x29537c9e
kernel(alloc_pages_current) = 0x4f3bf785
kernel(cdev_add) = 0xa6d1bdca
kernel(cdev_del) = 0x42e80c19
kernel(cdev_init) = 0xc45a9f63
kernel(copy_from_user) = 0x3302b500
kernel(copy_to_user) = 0x85f8a266
kernel(down_read) = 0xb4b0ee4e
kernel(down_write) = 0x45d55543
kernel(find_vma) = 0x38e4e189
kernel(get_page) = 0xe46d84e9
kernel(kmem_cache_alloc) = 0xee065ced
kernel(kmem_cache_create) = 0xe4a639f8
kernel(kmem_cache_destroy) = 0x806e575f
kernel(kmem_cache_free) = 0x7329e40d
kernel(list_del) = 0x0521445b
kernel(mcount) = 0xb4390f9a
kernel(memset) = 0xde0bdcff
kernel(module_layout) = 0x14522340
kernel(per_cpu__current_task) = 0x4f1939c7
kernel(printk) = 0xea147363
kernel(unmap_mapping_range) = 0x310b6f21
kernel(unregister_chrdev_region) = 0x7485e15e
kernel(up_read) = 0xe23d7acb
kernel(up_write) = 0xd851af78
kernel(vfree) = 0x999e8297
kernel(vm_insert_page) = 0x44986362
kernel(vmalloc) = 0xd6ee688f
kernel(warn_slowpath_null) = 0x16305289
ksym(nvUvmInterfaceDeRegisterUvmOps) = 0x2103c3ad
ksym(nvUvmInterfaceRegisterUvmOps) = 0x9b2a1db7
rpmlib(PayloadIsXz) <= 5.2-1

And this is the binary kMOD package that does contain them. As you can see the symbols are missing. This happens independently of the fact that the base module and  / or the UVM module are included in the same package.

$ rpm -qp --requires kmod-nvidia-331.20-1.el6.x86_64.rpm
rpmlib(VersionedDependencies) <= 3.0.3-1
nvidia-driver = 2:331.20
/sbin/depmod
/sbin/depmod
/bin/sh
/bin/sh
/bin/sh
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(CompressedFileNames) <= 3.0.4-1
kernel(__per_cpu_offset) = 0x32047ad5
kernel(__register_chrdev) = 0xfa0d49c7
kernel(__tracepoint_module_get) = 0xacdeb154
kernel(__unregister_chrdev) = 0x6bc3fbc0
kernel(create_proc_entry) = 0x6d6b15ff
kernel(down) = 0x748caf40
kernel(mcount) = 0xb4390f9a
kernel(module_layout) = 0x14522340
kernel(module_put) = 0xcbd81171
kernel(per_cpu__cpu_number) = 0x9629486a
kernel(printk) = 0xea147363
kernel(remove_proc_entry) = 0x1a6d6e4f
kernel(up) = 0x3f1899f1
rpmlib(PayloadIsXz) <= 5.2-1

RPM spec files are in the same place, so if you have any hint on how to fix it, please drop me a note.