Hybrid thin films with a high loading and homogeneous dispersion of functional nanoparticles (and/or molecules) find applications in (bio)sensors and electronic devices. The fabrication of such hybrid thin films, however, suffers from the complex and diverse surface and physicochemical properties of individual nanoparticles. To address this challenge, a facile and general strategy toward compartmentalized thin films through the interfacial cross-linking of viral protein cages is reported. Employing these protein cages, gold nanoparticles, as well as enzyme horseradish peroxidase, are encapsulated into virus-like particles and then cross-linked into thin films with a thickness varying from monolayer to submicron dimensions. These compartmentalized thin films not only ensure that the cargo is homogeneously dispersed, but also display good catalytic activity. This strategy is, in principle, applicable for a wide range of (bio)-organic nanocontainers, enabling the versatile fabrication of 2D thin films with extensive application prospects.