The problem of calculating the ac losses in a superconductor strip with a transport current placed inside superconducting environments is studied analytically in the frame of the critical state model. Exact results obtained by the method of images for the commonly employed flat ground plates are used to derive power losses and, consequently, the nonlinear resistance depending on the ac frequency, current amplitude and the distance to the ground plates. The resistance is strongly reduced when the distance between the strip and the shields becomes small.