Combined in situ structural and ex situ magnetic studies of the Co/NiO(111) and Ni81Fe19/NiO(111) interfaces are presented. The Co and Permalloy films were grown on NiO(111) single crystals. Structural studies were performed by Grazing Incidence X-ray Scattering during growth. The effect of the temperature of the substrate during deposition was investigated. Under specific growth conditions, almost pure FCC Co and NiFe films can be obtained, with small quantities of twins. Magnetic measurements were performed ex situ by Magneto-Optical Kerr Effect (MOKE). A strong correlation between the magnetic properties and the crystallographic structure of the Co film is evidenced. High coercive fields are measured for all samples. High temperature annealing of the NiFe film leads to an improved crystalline quality, but the interface becomes reactive and diffuse: part of the Fe diffuses into the NiO substrate and forms an interface compound, likely to be the spinel NiFe2O4. We also report an in situ grazing incidence X-ray scattering study of the Ni/MgO(001) interface during its formation at room temperature. In-plane measurements reveal that the interface is sharp and that the epitaxial relationship is complex. Two distinct lattices are found to exist: expanded Ni(001) and Ni(110). The latter exhibits several orientations with respect to the substrate depending on the thickness. The Ni(110) orientations disappear by annealing at high temperature, leaving only the Ni cube/cube orientation. The layer was also almost fully transformed into NiO(001) by high temperature oxidation.