China recently banned the use of Microsoft's (NASDAQ:MSFT) Windows 8 on government computers, striking a critical blow against the tech titan's efforts to grow its footprint in the second largest economy in the world.

Source: Microsoft.

Windows 8 and 8.1 machines currently account for 12% of the world's desktop operating systems, according to Net Market Share, putting it behind Windows 7, at 49%, and even Windows XP, which still controls 26% of the market.

According to China's Central Government Procurement Center, the government banned the installation of Windows 8 on government computers as part of a notice regarding the use of energy-saving products. State-run news agency Xinhua reported that the ban was to ensure computer security after Microsoft ended support for Windows XP last month.

Those two explanations make little, if any sense -- how does keeping Windows 8/8.1 off government computers save energy or ensure security?

What's really going on here?
The ban comes at a time when tensions between the China and U.S. are running high. On May 19, the U.S. accused Chinese government officials of hacking into several companies to steal trade secrets. China called the allegations hypocritical and claimed that the U.S. engaged in the same practices.

Microsoft has also had a rocky relationship with China. In 2011, former CEO Steve Ballmer stated that revenue from China was only equivalent to 5% of U.S. sales due to piracy, although total PC sales in both countries were roughly the same. Although the Chinese government vowed to stiffen up its anti-piracy laws, it also suggested that Microsoft lower the price of Windows to reduce piracy.

But neither security issues nor piracy explains why China would suddenly ban Windows 8. The true answer, in my opinion, has to do with Windows XP.

Escaping Microsoft's clutches
Over a course of 13 years, Windows XP became the most popular operating system in the country. According to research firm Canalys, XP now accounts for 50% of China's desktop market. When Microsoft stopped supporting Windows XP last month, half of China's computers were either forced to upgrade or left defenseless against malicious attacks.

It might be simple for individuals to upgrade their home systems, but it's certainly not as easy for governments. Both the Dutch and U.K. governments have struck multimillion-dollar deals with Microsoft to extend support for XP -- indicating how difficult and costly it is to upgrade systems across government agencies.

With those government deals and the Operation Clandestine Fox patch, Microsoft has shown that it certainly has the resources to continue supporting Windows XP. It's just not willing to do so anymore, since it hopes that taking the aging system off life support will force users to upgrade.

That wouldn't be a problem if Microsoft held its ground. Instead, striking special deals with governments paints a different picture -- that Microsoft will keep supporting government computers, for the right price. China's government is now faced with two choices -- to either pay Microsoft for extended support or upgrade its systems to Windows 8. The first choice delays the inevitable, and the second one just starts the whole cycle over again. When Microsoft pulls the plug on Windows 8, China will be stuck in the same position.

A growing superpower needs its own OS
What China really wants is a government operating system that it can control. China's been down this road before -- its state-sponsored company, Red Flag Software, launched Red Flag Linux in 2001.

Red Flag Linux. Source:

China believed that Red Flag could kill two birds with one stone -- addressing the problem with pirated copies of Windows while laying out the groundwork for its own national operating system. In 2008, the government gave Internet cafes running pirated copies of Windows an ultimatum -- buy legitimate versions of Windows or install Red Flag Linux. However, the effort never gained enough traction, and it completely fell apart in February after Red Flag Software shut down due to unpaid wages.

Although Red Flag is officially dead, China's Ministry of Industry and Information Technology has been working with U.K.-based Linux vendor Canonical on releasing a follow-up distro to Red Flag known as Kylin.

Does this mean the end of Windows in China?
Despite efforts like Red Flag and Kylin, Windows will remain the dominant OS in China for the foreseeable future. Too many Chinese businesses -- including its $13.5 billion online gaming industry -- are dependent on Windows. In addition, most Linux distros require a basic knowledge of terminal and repository commands, which make it much less appealing than the "double-click to install" setup that Windows users are accustomed to.

China obviously knows that it would be unreasonable to push Microsoft out of the country. However, upgrading its own government systems to Kylin instead of Windows 8 would be a feasible goal. Linux is also a more sensible OS for government agencies, since it is generally less vulnerable to malicious hacks.

Microsoft has stated that it "will continue to provide Windows 7 to government customers," according to a statement issued to The Verge. Yet I believe that China isn't any more interested in Windows 7 than Windows 8 -- it simply wants to replace XP with an operating system of its own.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.