The self-assembly of symmetric diblock copolymers confined in the channels of variously shaped cross sections (regular triangles, squares, and ellipses) is investigated using a simulated annealing technique. In the bulk, the studied symmetric diblock copolymers form a lamellar structure with period LL. The geometry and surface property of the confining channels have a large effect on the self-assembled structures and the orientation of the lamellar structures. Stacked perpendicular lamellae with period LL are observed for neutral surfaces regardless of the channel shape and size, but each lamella is in the shape of the corresponding channel's cross section. In the case of triangle-shaped cross sections, stacked parallel lamellae are the majority morphologies for weakly selective surfaces, while morphologies including a triangular-prism-shaped B-cylinder and multiple tridentate lamellae are obtained for strongly selective surfaces. In the cases of square-shaped and ellipse-shaped cross sections, concentric lamellae are the signature morphology for strongly selective surfaces, whereas for weakly selective surfaces, stacked parallel lamellae, and several types of folding lamellae are obtained in the case of square-shaped cross sections, and stacked parallel lamellae are the majority morphologies in the case of ellipse-shaped cross sections when the length of the minor axis is commensurate with the bulk lamellar period. The mean-square end-to-end distance, the average contact number between different species and the surface concentration of the A-monomers are computed to elucidate the mechanisms of the formation of the different morphologies. It is found that the resulting morphology is a consequence of competition among the chain stretching, interfacial energy, and surface energy. Our results suggest that the self-assembled morphology and the orientation of lamellae can be manipulated by the shape, the size, and the surface property of the confining channels.