** Updated – Changed for centrifydc – likewise open doesn’t work with pam_mount and /etc/skel.
This is a follow up to my past post. I want to deploy 12.04 for what I consider a typical enterprise environment. That means centralized authentication, file shares, roaming profiles, etc. Your first step should be to acknowledge this is a very hard project to do. If you need to deploy some computers this week, go get your Windows install CD right now. Linux takes about 10 times as long to set up (though easy to clone).

Authentication to Active Directory
Options include Centrify, likewise open, winbind, and pam_ldap. I went with centrify because it works with pam_mount and /etc/skel and this is critical for me. The big disadvantage of Centrify is that it’s very slow. It adds about 30 seconds to boot time in my deployment. However I will include alternative instructions for likewise which I used before 12.04 when it worked better for me.
Either way they both suffer from a fatal flaw that would probably keep all but the most dedicated linux sysadmins far far away from Linux. They don’t work on wifi! I’ve talked about this issue before, basically lightdm starts up before networking is up. The user types in a name, password, gets an error, calls tech support and has the impression that this “Ubuntu” is quite the useless operating system.
First with either option you need to allow users to type in a login in lightdm. Edit /etc/lightdm/lightdm.conf and make it so users can type in a username by adding
greeter-hide-users=true
Also make sure your wireless network is available to all users. (Click the network icon, Edit Connections…). Next follow instructions for either Likewise or Centrify.
Likewise Open
It’s terribly easy to install it. It even has a GUI. So I won’t include instructions for this. However if you need it working on boot as I described above do this. Place this script somewhere like /opt and make it executable. It just checks to see if any networking is up or time out at 20 seconds.
#!/bin/bash
i=0
while [ $i -lt 20 ]; do
sleep 1
is_up=$(ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` > /dev/null && echo 1 || echo 0)
let i=$i+1
if [ $is_up -eq 1 ]; then
let i=999
fi
done
Now edit /etc/init/lightdm.conf and add under the emits section. This script just runs ping test before starting lightdm then waits 5 extra seconds to give things time to settle.
pre-start script
/opt/pingtest.sh
sleep 5
end script
Centrify
It’s also easy to install. You can get it from the Ubuntu partner repo’s. If you have it, you need to check this off in Ubuntu Software Center, Edit, Software Sources. Then update then install centrifydc. Join your domain like
adjoin -w mydomain.org
Centrify doesn’t play nice with pam-auth-update so create a conf file for it called /usr/share/pam-configs/centrifydc
Name: Centrify DC
Default: yes
Priority: 257
Auth-Type: Primary
Auth:
[success=end default=ignore] pam_centrifydc.so try_first_pass
Account-Type: Primary
Account:
[success=end new_authtok_reqd=done default=ignore] pam_centrifydc.so
Session-Type: Additional
Session:
required pam_centrifydc.so homedir
Password-Type: Primary
Password:
[success=end new_authtok_reqd=done ignore=ignore default=die] pam_centrifydc.so try_first_pass
Password-Initial:
[success=end new_authtok_reqd=done ignore=ignore default=die] pam_centrifydc.so
Now run pam-update-auth and centrify will play nice with other modules such as pam-mount
Next we need to resolve the can’t log in on first boot problem. In likewise we just made a simple is networking up yet test. This doesn’t work with Centrify. From what I can tell this is what happens.
- Networking starts
- pingtest script launches lightdm only after networking is up. Right now we could ping the domain controller
- Centrify attempts to contact the domain controller but fails for some unknown reason. It then sites and does nothing for a bit. Then tries again and succeeds. This takes about 30 seconds.
Instead we need to modify /etc/init.d/centrify and add some upstart emits. These will tell us when centrify is ready to use. Look in the start section and add this emit as shown in bold
start)
adclient_check
echo -n "Starting $NAME: "
start-stop-daemon --start --quiet --exec $DAEMON --pidfile $PIDFILE \
-- $OPTIONS
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo "OK"
wait_adclient
# upstart won't start gdm until we say we're connected
initctl emit centrify-connected # added
else
echo "FAIL
This emit signal doesn’t do anything in itself. It’s just an upstart signal we can look for else where, such as /etc/init/lightdm.conf where we will add it at a dependency to start.
start on (filesystem
and started dbus
and (graphics-device-added fb0 PRIMARY_DEVICE_FOR_DISPLAY=1
or drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1
or stopped udevtrigger)
and centrify-connected)
stop on runlevel [016]
But what if the user is at home and will never connect to the domain controller? Well it will take a long time to boot. I’m sorry. If you have a better solution please comment. Let’s compare are boot time to see if it’s reasonable. All tests are on a Lenovo x120e. They are from power button to login prompt
Ubuntu 12.04 with my modified init scripts.
53 seconds (28 of those seconds are just waiting idle for Centrify)
Windows 7
47 seconds
Windows XP
A blazing 26 seconds! It would be pretty hard to recommend Linux if MS didn’t screw up NT with Windows Vista/7.
Anyway I’ve determined we are almost as fast as Win 7 which is what a x120e comes with. While it makes me cringe that I’m making the computer even slower, it’s on par and that makes it a good enough solution. Factor in time waiting for Win 7 to be generally slow after login and one could argue Linux is just as….slow. As much as I hate Linux, I hate Windows more.
Desktop Environment
People seem to like Unity these days, but I still don’t. It’s also unfamiliar with new users. I’m more concerned about reducing tech support calls than wowing users. It’s fairly easy to remove it (but why no gui way?). Install gnome-fallback-session. Now edit /etc/lightdm/lightdm.conf and set
user-session=gnome-classic
Log in as a new user to test, to ensure it’s not just using the previous session. I like to just have one bottom gnome-panel sort of like classic windows.
Also install compiz config manager and enable alt tab which is notably missing!
Copy your ~/.config file into /etc/skel but then delete anything you don’t want (firefox, chrome, etc) so that new users get the same configuration you have now. There used to be a program called sabayon that did this in a more user friendly way but it’s too buggy and it’s faster to just copy things to /etc/skel. All in all the Windows way of having All Users is much easier IMO.
Centralized Printing
You can control printing by having a cups server. The newer printer menu doesn’t let you add cups servers…but the old gui is still there. Run system-config-printer and click Server Settings. Check Show printer shared by other systems. Hit Ok. Now Click Server settings again (this is a bug). Now advanced. Now click add and type in the address of your cups server. The printers will just show up like magic! If users aren’t allowed it to print it just won’t print. Which is really annoying actually. Why can’t it prompt for a password? It used to try this but the prompt was broken and never actually worked
I submitted a bug report about it not asking for credentials.
Windows Applications
There’s probably a lot of Windows only applications you need to run. Crossover/Wine work for some like Office 2010. It’s really really buggy though. See my experience here. For programs that won’t run in wine you can use rdp. Ulteo makes a cool platform that lets users launch apps from a website. Great for Internet Explorer and centralized systems like proprietary databases.
Java
In short – Oracle and Canonical want to kill you in your sleep. It’s just about impossible to install Java now. Really I have no work around. Maybe you can get away with OpenJDK which runs on about 0 out of 10 applications I use. Canonical might just take away your java without warning. You could install it from Oracle…but your users won’t get updates this way. You could try various PPA scripts but it seems Oracle is actively trying to stop this. I went with the Oracle installation which will leave me wide open to exploits. Lovely. You’re an IT person if your reading this. Do me a favor and DON’T EVER BUY ANYTHING FROM ORACLE.
File Shares – Samba
Samba works!!!! You can save files to a file share! Progress!!! I refer to this bug. You still might prefer to use pam_mount. I already talked about it in my previous post so I won’t again. It’s better if you want shares to come up automatically for users. If you just have a few users they can use nautilus to find the shares. Just type in smb://yourserver/share and save it as a bookmark. There is a browse share feature, but I’ve never seen this work in my life. But beware the bookmark thing won’t appear in wine! So if you need MS Office you users won’t be able to save as into the share!
If you do use pam_mount make sure to work around this bug that prevents likewise-open from working with it. FYI This bug is what keep /etc/skel from working with likewise open. If you followed my instructions you are using Centrify and don’t have this issue.
Imaging
I like to use clonezilla for imaging. Here is a script you can use to automate AD joining. Take a minute to look this over and put in your info. Then run it on cron @reboot. It runs only if it sees the hostname as image. Note this script is for likewise open. For centrify just replace the join command.
#!/bin/bash
hostCurrent=$(hostname)
hostOld='image'
commonauth='/etc/pam.d/common-auth'
if [ "$hostCurrent" == "$hostOld" ]
then
date > /opt/ad.log # overwrite log the first time around
# DOE mangled machines to the point that the first serial number is blank!
host1=$(/usr/sbin/dmidecode | /bin/grep -E 'Serial Number:[[:space:]]*[^[:space:]]+' | /bin/sed 's/.*: \(.*\)/\1/;q')
host=$(echo $host | /bin/sed 's/[ ]*//g')
hostname $host
echo $host > /etc/hostname
/opt/pingtest.sh
sleep 10
(
/usr/bin/domainjoin-cli join your.domain.org 'user' 'password'
adreturn=$?
) 2>&1 >> /opt/ad.log
if [ $adreturn -ne 0 ]
then
echo "adjoin failed." >> /opt/ad.log
exit 1
fi
echo "I'm itching to reboot." >> /opt/ad.log
/sbin/reboot
fi
I made this to take inventory. Sorry it sort of sucks and has no installer. Basically the idea to that a script runs that feeds some stats like hostname and hd freespace to some database.
Admin access
If you want to give some users sudo edit /etc/sudoers and add something like
%ADMIN\\UnixAdmins ALL = (ALL) ALL
File Sync (roaming profiles)
You can try using unison. Owncloud has a desktop sync tool but it’s still in beta. I’m using that unison script for now. For desktops just use samba instead since you don’t need the files to copy to the local hard drive.
Web Browser
I use Chrome as the default web browser. There are some not so well documented ways you can make it a nicer experience with default preferences. I really hate the many pop ups it has on first launch for instance. First read this
http://www.chromium.org/administrators/configuring-other-preferences
I don’t think it does a good job explaining that master_preferences goes next to the google-chrome executable (i.e. /opt/google/chrome/master_preferences)
The real exhaustive list of preferences is here right in the source:
http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/pref_names.cc?view=markup
‘user_skipped’ disables the sync promo for instance. Here is my master preferences file. Over 9000 promo views is just for fun.
{
"homepage" : "companyportal.page.com",
"homepage_is_newtabpage" : false,
"browser" : {
"show_home_button" : true,
"check_default_browser" : false
},
"distribution" : {
"skip_first_run_ui" : true,
"show_welcome_page" : false,
"make_chrome_default" : false
},
"first_run_tabs" : [
"http://www.cristoreybrooklyn.org/portal"
],
"sync_promo": {
"startup_count": 1,
"user_skipped": true,
"view_count": 9001
}
}
Overall thoughts
12.04 IMO is as many steps forward as it is back. Some bugs are fixed and some are introduced. It’s a perfect example of why corporations don’t use linux outside IT. You can spend weeks setting up the perfect image in 11.10 but then 12.04 comes out and nothing you did before works. Here are my thoughts overall
+ Much better battery life
+ Gnome fall back session is less buggy.
- Gnome Classic is not as good as 10.04. For example the missing alt tab. Also sometimes wifi manager doesn’t display right for me. Again this is a trivial issue but for an end user to means calling tech support and for a company it means Linux is wasting money.
- Likewise open is more buggy (doesn’t work with /etc/skel)
- CUPS is more buggy (no warning about authorization failure) Also the better GUI isn’t accessible without knowing the cli command.
- Less configurable overall compared to gnome 2.
- Not Ubuntu’s fault, but java is now a nightmare
My advice to Ubuntu is to focus on quality control instead of UI. But it looks like they are going after consumers and not businesses. If they just fixed the bugs I mentioned I would recommend Linux to any small business. As is, I wouldn’t only recommend it to companies that have a deep understanding of Linux already. Windows Server will continue to dominate until Ubuntu is Linux for human beings who have jobs.
As a LTS release 12.04 disappoints me. After all the configuration work – the end user gets a worse experience in my case. A longer boot time and cups is less clear about authentication. But 11.10 is not LTS and not viable for long term deployment. My best hope is that some bugs will be fixed after release but based on past experience this is highly unlikely.