One can fetch packages for virtual machines using various portage variables with one notable exception: There seems to be no way to tell portage to use another path instead of /var/db/pkg. Thus one has to bind mount the virtual machine's /var/db/pkg on the host which is error prone. It would be nice to have an environment variable like PORTAGE_CONFIGROOT which allows to set the patch to /var/db/pkg, a suggestion would be PORTAGE_DBPKGROOT. Reproducible: Always
Using a copy of /var/db/pkg is a clever way to make emerge -f do what you want, but it would be nice to have a more general solution that operates on SRC_URI metadata (bug 629048).