Previous electrostatic particle-in-cell (PIG) simulations have pointed out that electron phase-space holes (electron holes) can be formed during the nonlinear evolution of the electron two-stream instability. The parallel cuts of the parallel and perpendicular electric field have bipolar and unipolar structures in these electron holes, respectively. In this study, two-dimensional (2D) electromagnetic PIG simulations are performed in the x - y plane to investigate the evolution of the electron two-stream instability, with the emphasis on the magnetic structures associated with these electron holes in different plasma conditions. In the simulations, the background magnetic field (B-o = B-o(e(x)) over right arrow) is along the x direction. In weakly magnetized plasma (Omega(e) < omega(pe), where Omega(e) and omega(pe) are the electron gyrofrequency and electron plasma frequency, respectively), several 2D electron holes are formed. In these 2D electron holes, the parallel cut of the fluctuating magnetic field delta B-x and delta B-z has unipolar structures, while the fluctuating magnetic field delta B-y has bipolar structures. In strongly magnetized plasma (Omega(e) > omega(pe)), several quasi-1D electron holes are formed. The electrostatic whistler waves with streaked structures of E-y are excited. The fluctuating magnetic field delta B-x and delta B-z also have streaked structures. The fluctuating magnetic field delta B-x and delta B-y are produced by the current in the z direction due to the electric field drift of the trapped electrons, while the fluctuating magnetic field delta B-z can be explained by the Lorentz transformation of a moving quasielectrostatic structure. The influences of the initial temperature anisotropy on the magnetic structures of the electron holes are also analyzed. The electromagnetic whistler waves are found to be excited in weakly magnetized plasma. However, they do not have any significant effects on the electrostatic structures of the electron holes.