We study the generation of entanglement between two distant qubits mediated by the surface plasmons of a metallic waveguide. We show that a V-shaped channel milled in a flat metallic surface is much more efficient for this purpose than a metallic cylinder. The role of the misalignments of the dipole moments of the qubits, an aspect of great importance for experimental implementations, is also studied. A careful analysis of the quantum dynamics of the system by means of a master equation shows that two-qubit entanglement generation is essentially due to the dissipative part of the effective qubit-qubit coupling provided by the surface plasmons. The influence of a coherent external pumping, needed to achieve a steady-state entanglement, is discussed. Finally, we pay attention to the question of how to get information experimentally on the degree of entanglement achieved in the system.