The head of Microsoft's India division, Ravi Venkatesan, said Gates plans to focus "on realizing India's potential" during his visit.

Microsoft has long viewed India, a country of 1 billion people with a fast growing economy, as a potentially huge market, and this will be Gates' fourth visit. He'll meet with senior Indian officials, business leaders and programmers and detail Microsoft's long-announced plans to invest $400 million in India in the coming years.

Gates is an icon to legions of programmers in India, and Indian leaders and business moguls line up to shake hands with him when he visits.

But Microsoft has found itself contending with the fact that many Indian companies are increasingly turning toward open source operating systems, particularly Linux, as a low-cost alternative to Windows.

Open source operating systems allow users to copy, distribute and modify the program's code, and are relatively cheap compared to proprietary systems like Windows, which does not allow users to modify its secret code.

"Gates' visit comes at a time when Microsoft's domination is very much being eroded," said Javed Tapia, head of Linux vendor Red Hat Inc.'s India operations. "This time, we have a lot of success stories to show him."

While exact figures are hard to come by, a survey of Indian companies by Network Magazine released in June found that nearly 40 percent use Linux to run their servers. The magazine polled 340 companies, and offered no margin of error.

However, Microsoft insists its market share in server operating systems grew from 57 percent in early 2004 to 65 percent in late 2005. "We continue to consolidate on the Indian market and are excited about our growth," said Vaibhav Phadnis, director of Microsoft's server business in India.

(MSNBC is a Microsoft - NBC joint venture.)

Still, there's ample anecdotal evidence that Linux and other open-source operating systems are making inroads.

The Indian government last year dropped a requirement that companies doing business with it use Windows and now encourages the use of open source software, even going so far as to set up an open source software development center in the southern city of Madras.

The government of India's western state of Maharashtra runs some of its operations on servers using Linux, as does the southern state of Andhra Pradesh.

India has 200,000 open-source software programmers, and "companies are switching over to open source, layer by layer by layer," said Atul Chitnis, a software consultant in Bangalore, the country's technology hub.

Linux is also attracting researchers with high performance and stability, said Professor Gopi Garge of the Indian Institute of Science in Bangalore. "People have opened their windows for Linux now," he said.

Before arriving in India, Gates and his wife, Melinda, made a brief stop in neighboring Bangladesh, visiting a public health research center and a microcredit project that gives small loans to the poor in downtown Dhaka, state-run Bangladesh Television showed.