Both companies stand to benefit widely from working together: Samsung gains access to Oculus's software and specialized hardware to help build its own virtual reality headset for mobile devices. Meanwhile, Oculus gains access to Samsung's manufacturing expertise and help as it develops a headset for consumers. In addition, working with the Korean titan will allow Oculus to introduce virtual reality to many more consumers than it otherwise would be able to reach.

The current prototypes are being shipped by Samsung to developers, people familiar with the matter say, and so far it appears they can't make enough to meet demand. Financial considerations between the two companies, how the final product will be unveiled and marketed, which company's names will appear on them, and in what order, are still unclear.

Samsung and Oculus declined to comment.

Oculus and Samsung working together offers an important mutual benefit: the potential to outmaneuver competitors.

For Samsung, a head-mounted virtual reality device would help to differentiate its products from devices like Apple's iPhone with headline-grabbing new functionality.

For Oculus, a mobile version of its software running on smartphones would reach a wider audience, cementing it as a leader for VR in any form.

From virtually out of nowhere

Oculus introduced a prototype of its headset, called the "Rift," in 2012, making a splash with the promise of high-quality virtual reality gaming experiences. Industry veterans began singing its praises; A technology that had been the stuff of Hollywood storytelling since the early 1990s began marching toward store shelves.

Initial versions of the Rift were built by Palmer Luckey, Oculus's founder who cobbled together prototypes with screens and other parts from smartphones. Over the last two years, Oculus further refined its device with high-definition graphics and the ability to track a customer's head in any direction with the help of a separate camera.

Oculus sells its latest prototype for $350 apiece, though the price doesn't include the cost of a computer capable of powering the headset. Video game companies large and small have begun developing for it, but a nagging question is how many consumers will ultimately end up buying one.

Still, that sticker price is likely higher than many mass market consumers will be willing to pay, particularly if they have to buy a performant computer to power their new virtual reality goggles. That's why Oculus is also developing software for mobile devices.

Google's Cardboard VR headset is powered by the smartphone you already have.

"The biggest problem with the introduction of new platforms is the install base," said Amir Rubin, head of motion control technology maker Sixense. Millions of consumers will likely try virtual reality if it's offered through a smartphone and a cheap headset adapter, he added. "With all the hype about VR, this is the first opportunity for mass consumers to experience VR."

The opportunity is indeed large. Nearly a billion smartphones were sold to consumers last year, according to industry researcher Gartner, a jump of nearly 42 percent from 2012. Samsung sold the most, with 31 percent share of the market, double that of Apple, the runner-up.

As a result, Rubin's company and many others are preparing for what they predict will be an onslaught of virtual reality products that utilize smartphones made by a variety of manufacturers. His company is adapting its software to support motion controllers for both Google's Android software and Apple's iOS, for example.

So has Virtuix, maker of a platform called the "Omni" that can track movements of a player as they walk. Jan Goetgeluk, CEO at Virtuix, said his company is integrating Bluetooth wireless technology into its product to ensure easy connectivity with any mobile headset.

Virtual buddies

The virtual reality partnership strikes at the heart of Samsung's struggles building software. Samsung is one of the top consumer electronics companies in the world, in large part because it's often at the forefront of new hardware technologies. Its smartphones are the top selling in the world, it was one of the first companies to release a smart watch, and it's experimenting with groundbreaking new display technology.

But its efforts in software haven't gone as well. It scrapped many of its homegrown programs in favor of partnerships, including turning over control of its video rental and purchase operations to M-Go, a joint venture of DreamWorks Animation and Technicolor. It also pared back the number of Samsung-designed apps it preloads on its devices because of Google anger and poor usage numbers by consumers. And Samsung delayed the launch of a smartphone based on its Tizen open-source software -- its alternative to Android -- because of a lack of apps.

As a result, most of its devices are powered by other company's software. Its computers are powered by Microsoft's Windows operating system and Google's Chrome software, and its smartphones and tablets are powered by Google's Android mobile operating system.

Looking at Oculus

With its hardware expertise, the company could choose to build a virtual reality device on its own, offering a product that merely allows customers to drop their smartphone inside to act as the screen. But Oculus offers specialized software tools that help developers to create software that works with its goggles.

Oculus and Samsung won't be the only companies releasing virtual reality headsets, of course. Sony is developing virtual reality devices for its PlayStation 4 console. Other firms, such as gaming devices maker Razer, ImmersiON-VRelia, and vrAse, are researching, designing, and developing competing products as well. Even Google announced intentions to participate in the industry, unveiling its Cardboard virtual reality headsets in June.

But Oculus's technology is expected to be among the best. It hired employees from top game makers ranging from Electronic Arts, Valve, and others. The company also brought industry veterans into its ranks, including John Carmack, a driving force behind groundbreaking early video game titles such as Wolfenstein 3D and Doom. Carmack, now Oculus's technology chief, has been spearheading the company's mobile efforts.