Large dsDNA bacteriophages and herpesviruses encode a powerful ATP-driven DNA-translocating machine that encapsidates a viral genome into a preformed capsid shell or prohead. The key components of the packaging machine are the packaging enzyme (terminase, motor) and the portal protein that forms the unique DNA entrance vertex of prohead. The terminase complex, comprised of a recognition subunit (small terminase) and an endonuclease/translocase subunit (large terminase), cuts viral genome concatemers. The terminase-viral DNA complex docks on the portal vertex, assembling a motor complex containing five large terminase subunits. The pentameric motor processively translocates DNA until the head shell is full with one viral genome. The motor cuts the DNA again and dissociates from the full head, allowing head-finishing proteins to assemble on the portal, sealing the portal, and constructing a platform for tail attachment. A body of evidence from molecular genetics and biochemical, structural, and biophysical approaches suggests that ATP hydrolysis-driven conformational changes in the packaging motor (large terminase) power DNA motion. Various parts of the motor subunit, such as the ATPase, arginine finger, transmission domain, hinge, and DNA groove, work in concert to translocate about 2 bp of DNA per ATP hydrolyzed. Powerful single-molecule approaches are providing precise delineation of steps during each translocation event in a motor that has a speed as high as a millisecond/step. The phage packaging machine has emerged as an excellent model for understanding the molecular machines, given the mechanistic parallels between terminases, helicases, and numerous motor proteins.