When having more than one Gentoo installation at the same location, you should seriously consider sharing the Portage tree to avoid a lot of unnecessary downloads. This can be done by having the tree on only one machine and share it with NFS, the Network File System.
Server (Gentoo Linux)
First, we're going to configure the server, having the Portage tree installed in /usr/portage. I suggest following the first half of my previous article on setting up a NFS connection between Gentoo and FreeBSD.
In the /etc/exports file, you put the following two lines instead:
/usr/portage/distfiles host(async,rw,no_subtree_check,insecure,no_root_squash)
The first line is for the whole Portage tree, which we only want to mount as read-only. However, clients should be able to write to the distfiles folder, where the downloaded packages reside. So that's why the second line is there, it sets read-write permissions for only the distfiles folder, acting as an override.
After you've finished the /etc/exports folder, run
and you should be done with setting up the server.
Client (Gentoo Linux)
To start with, you should check if NFS is enabled in the client's kernel:
Network File Systems --->
<*> NFS file system support
[*] Provide NFSv3 client support
And rebuild the kernel if necessary. I chose NFSv3 here, but choose whatever version your server provides.
The client doesn't need much extra fiddling with the settings. Start up the NFS services required to mount NFS systems:
And at this stage already, you should be able to mount the Portage tree as follows:
# mount -t nfs server-ip:/usr/portage/distfiles /usr/portage/distfiles
If you believe this is tiresome to type this everytime, you could also put new entries in /etc/fstab:
server-ip:/usr/portage/distfiles /usr/portage/distfiles nfs rw 0 0
This was the first time that setting up NFS went so easily. I should squeeze my arm to see if I'm not dreaming.