The decision will disappoint investors such as Neil Woodford, a top shareholder and a critic of the drugmaker's current structure, who wanted to see an outsider appointed to overhaul the company.
However, Walmsley had always been tipped as a strong internal candidate, along with pharmaceuticals boss Abbas Hussain and manufacturing head Roger Connor.
Her appointment is likely to be seen as a signal that GSK will retain the consumer business as a core part of its operations.
"Under Andrews leadership, GSK has successfully developed into a company with market-leading positions in pharmaceuticals, vaccines and consumer healthcare," chairman Philip Hampton said in a company statement. "These provide excellent platforms for sustainable, long-term growth, and we are confident Emma will successfully build on these strengths."
Shares in GSK fell around 1 percent in early trading.
At the helm since 2008, Witty has struggled with flagging sales and profits, although the picture is now improving.
Some investors and analysts have questioned his focus on a consumer health business that ranges from headache pills to toothpaste. Other drugmakers have enjoyed better share price performance in recent years by riding a wave of innovation in disease areas such as cancer.
GSK has chosen to largely sit out a wave of acquisitions in the pharmaceuticals industry, which has seen rivals spending billions of dollars on promising experimental medicines.
Analysts believe that a change of CEO might lead to more deal-making at GSK but the appointment of an insider suggests an evolution of the current strategy is more likely than major change.
A $20 billion asset swap with Novartis, completed last year, which involved the exchange of cancer drugs for the Swiss groups consumer health products and vaccines, was a centerpiece of Witty's time in charge.
The deal crystallized the company's idea of reducing exposure to premium-priced pharmaceuticals and increasing sales of over-the-counter products, as well as selling more lower-priced medicines in emerging markets.
Walmsley has been intimately involved in that strategy as head of consumer and, like Hampton, she sees the breadth of GSK's portfolio as a key strength.
"We have momentum in the group and as the demand for medical innovation and trusted healthcare products continues to rise, we have the opportunity and the potential to create meaningful benefits for patients, consumers and our shareholders," she said in the statement.