The Star Trek Encyclopedia speculates that there could be a connection between the Borg and V'ger, the vessel encountered in Star Trek: The Motion Picture; this is advanced in William Shatner's novel The Return. The connection was also suggested in a letter in Starlog No. 160 (November 1990). The letter writer, Christopher Haviland, also speculated that the original Borg drones were members of a race called "The Preservers", which Spock had suggested in the original series episode "The Paradise Syndrome" might be responsible for why so many humanoids populate the galaxy. It was confirmed in the The Next Generation episode "The Chase" that an ancient species seeded hundreds, if not thousands of planets with their DNA, creating the Humans, Vulcans, Klingons, Romulans, Cardassians and many more. Coincidentally, in the novelization of Star Trek: The Motion Picture (written by Gene Roddenberry), the Vejur entity notes that the Ilia probe is resisting the programming given to it because of residual memories and feelings for Captain Decker, from its precise replication of the Deltan lieutenant. When Vejur becomes aware of this, it decides that "the resistance was futile, of course".
The extra section of the game Star Trek: Legacy contains the "Origin of the Borg", which tells the story of V'ger being sucked into a black hole. V'ger was found by a race of living machines which gave it a form suitable to fulfilling its simplistic programming. Unable to determine who its creator could be, the probe declared all carbon-based life an infestation of the creator's universe, leading to assimilation. From this, the Borg were created, as extensions of V'ger's purpose. Drones were made from those assimilated and merged into a collective consciousness. The Borg Queen was created out of the necessity for a single unifying voice. However, with thoughts and desires of her own, she was no longer bound to serve V'ger. This explanation, however, is not canon.
In the graphic novel Star Trek: The Manga, the Borg resulted from an experiment in medical nanotechnology gone wrong. An alien species under threat of extinction by an incurable disease created a repository satellite containing test subjects infused with body parts, organs, and DNA of multiple species along with cybernetic enhancements put in place by advanced medical technology. The satellite was maintained by nanomachines, which also maintained the medical equipment on board. The medical facility is parked in orbit by a black hole, and along with the anomalous states of time around the black hole, allows long-term research to continue at an accelerated time scale rather than in real time speed. The medical facility deteriorates and so too does the programming of the nanomachines. The nanomachines began infusing themselves into the patients, interpreting them as part of the satellite in need of repair. Among the patients is the daughter of the head medical researcher of the satellite. The satellite eventually falls apart in an encounter with an away team from the Enterprise under the command of James T. Kirk. In the final moments of the satellite's destruction and the escape of the crew members of the Enterprise with the patients, the subjects display qualities inherently resembling the Borg; injection of nanomachines in a fashion like assimilation, rapid adaptation to weaponry, and a hive mind consciousness, as all the subjects begin following the whim of the daughter. As succumbing to the disease was inevitable, and the corrupt nanomachine programming infused itself into the bodies, the final image of the page of the manga Borg origin is left with the daughter turned Borg Queen, stating, "Resistance is futile." This origin story shares many similarities with that of the Replicators from Stargate SG-1.