Bypass transition in a boundary layer subjected to freestream turbulence and distributed surface roughness is studied numerically. The distributed surface roughness is reproduced with an immersed boundary technique, and the freestream turbulence is artificially generated by a superposition of eigenmodes of the Orr–Sommerfeld and Squire equations. Both an undisturbed laminar inflow and a disturbed inflow with freestream turbulence are studied. In either case a parametric study on the effects of the roughness size and density is carried out. The simulations reveal that the presence of roughness induces streaks in the laminar flow. When the freestream is turbulent, both roughness height and density show an impact on the onset of transition. The superposition of surface roughness and freestream turbulence causes amplified streaks. As a result, the streak instability occurs earlier within the boundary layer. The results show good qualitative and quantitative agreement to both experimental and numerical studies available in the literature.