Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Samba mounted home dirs (and running KDE with them)
View unanswered posts
View posts from last 24 hours

Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message

Joined: 21 Feb 2003
Posts: 57
Location: UK

PostPosted: Tue Mar 16, 2004 2:24 pm    Post subject: Samba mounted home dirs (and running KDE with them) Reply with quote

Don't know if this is an obvious trick or not, but I couldn't find details of how to get it to work anywhere else, so am posting what I have done. First, here is a quick overview of my setup:

I am fairly new to linux, and so want an environment in which linux systems coexist well with the rest of my windows-based network. I successfully set up samba 3 with winbind to authenticate active directory users logging on to linux, but the next problem was home directories. Of course, on my windows domain, the users' home directories are all stored on an ntfs partition on a server and shared out via smb. So the question was how to get this to work for linux home directories as well.

In some more detail... the windows home folders are shared as follows:

is mapped to Y: in windows as a user's home folder

contains the user's windows roaming profile

This is a fairly typical setup for windows, with all home folders accessed through a single smb share (\\server\profiles). But of course for samba there is the problem that it is unable to mount subfolders within shares. Only shares themselves can be mounted. And doing something along the lines of mounting \\server\profiles to /home in linux wouldn't work since I don't see a way to set the permissions correctly, without ending up giving everyone write access to everyone else's files!

So my solution was to use pam_mount to mount \\server\profiles to /home/username for each user that logs in, transparently using their own active directory account and password as the credentials for accessing the share. Then setting up samba to use /home/username/username/linux as that user's home directory. This way they can access their windows files by going to the parent directory of their linux home. And can access their linux files whilst using windows too. Plus they can't access other users' files through /home/username because the server's ntfs permissions take care of that.

The remaining piece of the puzzle is to get kde to play nicely with the new home directories mounted over samba. Some of the files KDE stores in a user's home directory need to make use of features not supported by a samba mounted filesystem, causing a problem. However this can be overcome by use of KDE's environment variables.

By setting $KDEHOME, $ICEAUTHORITY and $DCOPAUTHORITY to a location outside of the samba mounted homes, all of KDE's user files will no longer be accessed over samba, allowing KDE to run once again, but then it defeats the purpose of having centrally stored home directories. So I decided to start by doing this, pointing those environment variables to somewhere inside /tmp, but then making 2 symlinks from the new $KDEHOME back into the samba mounted home directory so that all the user settings are indeed still stored in the user's home directory over samba.

To do this I added these lines to /env/profile:

export KDEHOME="/tmp/$USER/.kde"
export ICEAUTHORITY="/tmp/$USER/.ICEauthority"

and added the following lines before "/usr/kde/3.2/bin/startkde" in /etc/X11/Sessions/kde-3.2.0:

rm -rf /tmp/$USER
mkdir -p /tmp/$USER/.kde
mkdir -p $HOME/.kde3.2/share
mkdir -p $HOME/.kde3.2/Autostart
ln -s $HOME/.kde3.2/share /tmp/$USER/.kde/share
ln -s $HOME/.kde3.2/Autostart /tmp/$USER/.kde/Autostart

I realise there is a slight possibilty of a conflict of files used in /tmp, eg if they already exist but are not writable by the user who is trying to put their $KDEHOME there. So it could be improved. But the basic functionality works just fine! Everywhere else I looked people were simply saying "it isn't possible to to run KDE from a samba mounted home directory", but by doing this trick it does work :)
Back to top
View user's profile Send private message

Joined: 07 Oct 2003
Posts: 39
Location: Oregon, USA

PostPosted: Tue Mar 16, 2004 6:44 pm    Post subject: Reply with quote

interesting trick!
~Jake B
Back to top
View user's profile Send private message

Joined: 27 Oct 2003
Posts: 22
Location: Netherlands

PostPosted: Thu Nov 25, 2004 1:05 am    Post subject: Reply with quote

Very very intresting indeed !!
I'm looking at the same problem as we speak...
Just wondering aren't there more programs having the same problems as KDE ?
And haven't you had any Userpermission error's ?

could you also please give your pam_mount settings ? :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum