This paper proposes a cyber-physical system to manage flexible residential loads based on virtualized energy packets. Before being used, flexible loads need to request packets to an energy server, which may be granted or not. If granted, the energy server guarantees that the request will be fulfilled. Each different load has a specific consumption profile and user requirement. In the proposed case study, the residential consumers share a pool of energy resources that need to be allocated by the energy server whose aim is to minimize the imports related to such a group. The proposed solution shows qualitative advantages compared to the existing approaches in relation to computational complexity, fairness of the resource allocation outcomes and effectiveness in peak reduction. We demonstrate our solution based on three different representative flexible loads; namely, electric vehicles, saunas and dishwashers. The numerical results show the efficacy of the proposed solution for three different representative examples, demonstrating the advantages and drawbacks of different allocation rules.