Microsoft may be the only company in a position to provide "any real competition" for Google in the online search business, CEO Steve Ballmer said Thursday. But first it will need to figure out a way to do it.

"We need to do some work to fundamentally reinvent the search business model," Ballmer said during a dinner at the Churchill Club in Silicon Valley. "You don't brute-force your way into a market. You only make great strides when you redefine the category for the user."

And that will take some time. "It's a five-year task," Ballmer said. But Microsoft is ready to spend a lot of money trying. The company told its shareholders recently that it was prepared to lose "5 to 10 percent of total operating income for several years" to improve its position in search, Ballmer said.

The CEO offered little in the way of new insights during the evening, except that Microsoft will discuss "Project Red Dog," its secretive cloud computing initiative, at the Microsoft Professional Developer Conference next month.

Red Dog has been described as "EC2 for Windows," a comparison with Amazon's Elastic Compute Cloud, said Ann Winblad, the venture capitalist who posed the questions to Ballmer. She asked him to elaborate but he said she would have to wait for the conference in six weeks.

Asked about server virtualization, Ballmer said Microsoft aims to "democratize" the technology by offering lower prices, integrated management tools and better-quality software. "If you want to have virtualization on 80 percent of servers instead of 5 percent, you'd better not charge three times the price of the server for the software," he said, in a jab at market leader VMware, which has been criticized for high prices.

Asked about smartphones, Ballmer said Nokia, Research in Motion and Apple will all lose out as the market expands over the next five years, because they design their own proprietary hardware and tie it closely to their software.

Nokia leads the smartphone market today with about a 30 percent share, he said. "If you want to reach more than that, you have to separate the hardware and software in the platform," he said.

In other words, he thinks the same strategy that helped Microsoft become the leader on the desktop -- licensing its OS for use by other hardware makers -- will let it win out on smartphones. Long term, he said, the battle will be between the Symbian OS (which is now open source), mobile versions of Linux and Windows Mobile.

Apple won't boost its share of the personal computer market or become a threat in the enterprise for similar reasons, according to Ballmer -- because it won't license its software to others.

"Apple's a good company, I won't take anything away from them, but they have a certain kind of strategy. They believe in putting the hardware and software together, they don't believe in letting other people make it."

"I'm not saying there isn't a threat" from Apple, he said. But if Microsoft and its PC partners "do our jobs right, there's really no reason Apple should get any footprint in the enterprise."

Microsoft does "very well on balance" when it comes to software developers, he said. But the company has two areas of weakness, according to Ballmer: high-performance and technical computing -- which is important to Microsoft because "there are 5 million engineers and they use a lot of compute power" -- and in Web server applications, where it is losing out to Linux and PHP.

"Forty percent of servers run Windows, 60 percent run Linux," he said. "How are we doing? Forty is less than 60, so I don't like it. ... We have some work to do."

Winblad asked about the health of the IT business in light of the economic crisis in the U.S. "At least for now, people I talk to in our business are relatively -- I wouldn't say optimistic -- but feel better than if all you did was watch CNBC all day," Ballmer said, referring to the U.S. television news channel.

A member of the audience asked Ballmer how he manages his stress and stays healthy. Ballmer, who looks thinner and fitter than he did a few years ago, said his regime consists of PowerBars "to keep the blood sugar steady," "a constant dose of caffeine," and running.

"I did a five-mile run this morning. It does a lot to ease the stress and set up a good day."