GaN nanowires (NWs) were grown selectively in holes of a patterned silicon oxide mask, by rf-plasma-assisted molecular beam epitaxy (PAMBE), without any metal catalyst. The oxide was deposited on a thin AlN buffer layer previously grown on a Si(111) substrate. Regular arrays of holes in the oxide layer were obtained using standard e-beam lithography. The selectivity of growth has been studied varying the substrate temperature, gallium beam equivalent pressure and patterning layout. Adjusting the growth parameters, GaN NWs can be selectively grown in the holes of the patterned oxide with complete suppression of the parasitic growth in between the holes. The occupation probability of a hole with a single or multiple NWs depends strongly on its diameter. The selectively grown GaN NWs have one common crystallographic orientation with respect to the Si(111) substrate via the AlN buffer layer, as proven by x-ray diffraction (XRD) measurements. Based on the experimental data, we present a schematic model of the GaN NW formation in which a GaN pedestal is initially grown in the hole.