The solid solution phases have a large influence on the thermal conductivity of alloys, but the physics behind this effect is complicated. Existing works mainly utilize experimental methods to study the thermal conductivity of alloys. However, due to the coexistence of multi-phase and insufficient understanding of the microscopic property variations in different alloy systems, it remains unclear how different solute atoms can affect the thermal transport of solid solutions. In this work, we employ first-principles simulations based on the Korringa–Kohn–Rostoker coherent potential approximation method and the Boltzmann transport equation to calculate the thermal conductivity of 38 binary magnesium solid solutions with dilute solute atom concentration. Solute atoms can greatly reduce the thermal conductivity of magnesium. Phonon contribution is found to be less than 10 %. The machine learning feature screening methods are further applied to identify the key properties that influence their thermal conductivity the most. Different from the commonly used Linde's law, which states that the resistivity is proportional to the square of valence difference, the machine learning screening indicates that thermal conductivity is predominantly influenced by six features in total. Among them, the variance of the density of states of s + p, d + f orbitals at Fermi level is highly correlated to the electronic thermal conductivity of magnesium alloys. These correlations underscore the role of virtual bond states formed in magnesium alloys due to the presence of solute atoms. The developed method and uncovered physical mechanism can potentially be applied to other solid solution systems, which is an important step to achieve predictive design of high thermal conductivity metallic alloy.