It was not immediately known if the unidentifed attacker was a student at the university.
The university said the shooting began at 7.15am [1115 GMT] at West Ambler Johnston, a residence hall that houses 895 people.
December 1989 - Marc Lepine shot dead 14 women in Montreal's Ecole Polytechnique.
March 1996 - Thomas Hamilton killed 16 children and their teacher at a school in Dunblane in Scotland.
March 1997 - Mohammad Ahman al-Naziri killed six children and two staff during attacks on two schools in Sanaa, Yemen.
April 1999 - Two students killed 12 students and a teacher at Coulmbine High School in the United States.
February 2002 - A former student thrown out of trade school shot dead three people in Freising, Germany
April 2002 - Eighteen people died when a former student opened fire at a high school in Erfurt, Germany after being expelled.
The attack continued two hours later at Norris Hall, an engineering building at the opposite side of the university campus.
Wendell Flinchum, Virginia Tech police chief, said one student was killed in a dorm and the others were killed in a classroom.
Police said that over the past two weeks there had been bomb threats on the campus, which is attended by over 25,000 full-time students.
They said they have not established links between the bomb alerts and the shootings.
Aimee Kanode, a first year student, said the first shooting happened on the fourth floor of West Ambler Johnston dormitory, one floor above her room.
Kanode said her resident assistant notified her and other students at 8am local time [1200 GMT] to remain in the building.
"They had us under lockdown," Kanode said. "They temporarily lifted the lockdown, the gunman shot again."
It was the second time in less than a year that the Virginia Tech campus has been closed because of a shooting.
In August 2006, opening day classes were cancelled and the campus closed when an escaped prisoner allegedly killed a hospital guard off campus and fled to the Tech area.
"Today the university was struck with a tragedy that we consider of monumental proportions," Charles Steger, president of Virginia Tech, said.
"The university is shocked and indeed horrified."
Dana Parino, a spokeswoman for George Bush, the US president, said Bush offered his prayers to the victims and the people of Virginia.
"The president believes that there is a right for people to bear arms, but that all laws must be followed," she said.
The shooting is one of the worst at a university campus in the US since Charles Whitman killed 15 people at the University of Texas site in Austin in 1966.