We prove global existence of finite energy weak solutions to the quantum Navier-Stokes equations in the whole space with non trivial far-field condition in dimensions d = 2,3. The vacuum regions are included in the weak formulation of the equations. Our method consists in an invading domains approach. More precisely, by using a suitable truncation argument we construct a sequence of approximate solutions. The energy and the BD entropy bounds allow for the passage to the limit in the truncated formulation leading to a finite energy weak solution. Moreover, the result is also valid in the case of compressible Navier-Stokes equations with degenerate viscosity.