In S04E09 of Doctor Who, Forest of the Dead, the Doctor Moon, the antimalware guardian of the computer running The Library, saves 4,022 of its visitors from the Vashta Nerada by teleporting them out and saving them into its hard drive, where they lived virtual lives, albeit drastically condensed because of the hard drive's limited space. One of those saved in this way was Donna Noble.
However, there seems to be no explanation given for why: a) the Doctor Moon continued to appear to Donna in her virtual life in order to ensure that she remained unaware of where she was, and b) why the Doctor Moon appears malevolent to her.