This paper is focused to investigate the effects of nonlinear sources, including viscoelastic foundation and geometrical nonlinearity along with the surface elasticity and residual surface stress effects on the primary frequency response of a harmonically excited nanoscale Bernoulli-Euler beam. Due to large surface-area-to-volume ratio, the theory of surface elasticity as well as residual surface stress effects are taken into account within the beam models. The Galerkin approach accompanied by trigonometric shape functions is utilized to reduce the governing PDEs of the system to ODEs. The multiple scales perturbation method theory is applied to compute the nonlinear frequency response of nanobeam. The effects of linear and nonlinear viscoelastic damping coefficient of the medium, crystallographic directions of [100] and [111] of anodic alumina, geometrical nonlinear term and geometrical property on the nonlinear primary frequency response of nanoscale beam are investigated. The results show that theses parameters have a significant effect on the nonlinear frequency response of nanobeams in the case of primary resonance.