  We study a system of two qubits interacting with a common environment,
described by a two-spin boson model. We demonstrate two competing roles of the
environment: inducing entanglement between the two qubits and making them
decoherent. For the environment of a single harmonic oscillator, if its
frequency is commensurate with the induced two-qubit coupling strength, the two
qubits could be maximally entangled and the environment could be separable. In
the case of the environment of a bosonic bath, the gap of its spectral density
function is essential to generate entanglement between two qubits at
equilibrium and for it to be used as a quantum data bus.
