Surface phonon-dispersion relations for ZrB2(0001) and NbB2(0001) are measured by high-resolution electron-energy-loss spectroscopy. In addition to the acoustic surface modes, phonon modes of the graphitelike boron sheet are observed. The boron phonon modes are more complex and softer on NbB2(0001) than on ZrB2(0001). This is consistent with the metal- and boron-layer termination of ZrB2(0001) and NbB2(0001) surfaces, respectively. The phonon dispersion is analyzed by a force-constant model. By a simple force-constant model, the boron phonon modes are reproduced fairly well. The obtained force constants show that the B-B bond strength is comparable to the B-M bond. The B-B bond in NbB2 is stronger than in ZrB2.