TOKYO (Reuters) - Toshiba Corp 6502.T has chosen a consortium of Bain Capital and Japanese government investors as the preferred bidder for its chip business, aiming to seal a deal worth some $18 billion by next week as it scrambles for funds to cover massive losses.

But prospects for a clean early resolution to the sale of the world's No. 2 producer of NAND flash chips remain unclear as Western Digital WDC.O, Toshiba's chips business partner, has launched legal action to prevent a deal without its consent.

The consortium has offered around 2 trillion yen, a Toshiba spokesman said. Bain plans to be the biggest investor, providing 850 billion yen ($7.7 billion) in equity, three sources briefed on the matter said.

The bid was less than a rival 2.2 trillion yen offer from U.S. chipmaker Broadcom AVGO.O and its partner U.S. private equity firm Silver Lake. It was also hastily put together but has the implicit stamp of approval from the Japanese government which is keen to keep key semiconductor technology under domestic control.

Toshiba cannot afford to ignore the government because it needs its help with plans including the decommissioning of domestic nuclear power plants and as overseas nuclear power projects are currently in limbo after the bankruptcy of its U.S. nuclear unit.

Some analysts believe that talks over the hotly contested deal have become so complex that only a government-orchestrated solution is viable, but others doubt that the group will provide the necessary leadership the chip unit needs.

“There are many parties involved in this consortium,” said Atsushi Osanai, a professor at Waseda University Business School.

“It has undergone so many twists and turns during its formation process, that I’m skeptical about whether it can promptly make bold decisions. In that sense, Broadcom or Foxconn would be better suited.”

Toshiba said in a statement it took into consideration concern about technology transfers, job security for its domestic workforce and prospects of clearing regulatory reviews in its decision.

While Bain will be the biggest investor, it will obtain around half the amount in financing from South Korean chipmaker SK Hynix Inc 000660.KS, the sources said, declining to be identified due to the sensitivity of the negotiations.

A state-backed fund, the Innovation Network Corp of Japan and the Development Bank of Japan (DBJ) will each provide 300 billion yen in equity, while the core banking unit of the Mitsubishi UFJ Financial Group Inc 8306.T will provide 550 billion yen in financing.

The numbers have yet to be finalised and are still subject to change, one of the sources said.

A representative for DBJ was not immediately available to comment. All other members of the consortium as well as Toshiba declined to comment on the details of the deal.

IN A HURRY

Toshiba is rushing to clinch an agreement by June 28, the day of its annual shareholders meeting. It needs to sell the unit to cover billions of dollars in cost overruns at its Westinghouse nuclear unit and to dig itself out negative shareholders’ equity that could lead to a delisting.

Following the announcement, Western Digital, which jointly operates Toshiba’s main chip plant, reasserted in a statement that Toshiba was in breach of their joint venture contracts and said that a U.S. court hearing on its request for an injunction was scheduled for July 14.

Japan’s trade ministry, which has arranged much of the winning bid, is in talks with Western Digital, trying to persuade it to join the consortium, two separate sources familiar with the matter said.

FILE PHOTO - A logo of Toshiba Corp is seen on a printed circuit board in this photo illustration taken in Tokyo July 31, 2012. REUTERS/Yuriko Nakao/File Photo

But Western Digital is reluctant to join the group in its current form due to worries that high-level technology for NAND chips, which provide long-term data storage, could be leaked to rival SK Hynix, they added.

SK Hynix said it had joined the consortium because it sees new business opportunities with the deal. Although the South Korean chip maker is strong in DRAM chips, which help electronic devices perform multiple tasks at once, it is relatively weak in NAND.

Suitors that lost out refrained from comment on Wednesday.

A representative for Broadcom did not respond to requests for comment. Silver Lake declined to comment.

Foxconn, the world's largest contract electronics maker which also bid, did not respond to requests for comment. Formally known as Hon Hai Precision Industry 2317.TW, the Taiwanese firm's consortium includes Apple Inc AAPL.O and computing giant Dell Inc.

Toshiba’s shares ended 2 percent lower. They are down about 30 percent since problems at Westinghouse surfaced late last year but have come some way off lows as talks about the chip unit sale progressed.