Using ab initio total energy calculations we demonstrate that the nanotubes of germanium with atomic structure based on an alternate prism and antiprism stacking of hexagonal rings, can be stabilized by metal encapsulation. The V or Nb doped infinite nanotube is metallic. However, Mo doping leads to the formation of a metal encapsulated direct band gap semiconducting nanotube of germanium. These nanotubes with metal dependent electronic properties could prove to be vital for the development of future nanotechnologies. {\textcopyright} EDP Sciences, Societ{\`{a}} Italiana di Fisica, Springer-Verlag 2005.