Long-distance transmission between spatially separated microwave cavities is a crucial area of quantum information science and technology. In this work, we present a method for achieving long-distance transmission of arbitrary quantum states between two microwave cavities, by using a hybrid system that comprises two microwave cavities, two nitrogen-vacancy center ensembles (NV ensembles), two optical cavities, and an optical fiber. Each NV ensemble serves as a quantum transducer, dispersively coupling with a microwave cavity and an optical cavity, which enables the conversion of quantum states between a microwave cavity and an optical cavity. The optical fiber acts as a connector between the two optical cavities. Numerical simulations demonstrate that our method allows for the transfer of an arbitrary photonic qubit state between two spatially separated microwave cavities with high fidelity. Furthermore, the method exhibits robustness against environmental decay, parameter fluctuations, and additive white Gaussian noise. Our approach offers a promising way for achieving long-distance transmission of quantum states between two spatially separated microwave cavities, which may have practical applications in networked large-scale quantum information processing and quantum communication.