The present study focused on the role of roasting pretreatment in improving the flavor of WOs. In total, 71 volatile compounds were detected, 35 odorants were perceived, and 17 aroma-active compounds were identified in WOs by using headspace-solid phase microextraction-gas chromatography-mass spectrometry (HS-SPME-GC-MS) and aroma extract dilution analysis of gas chromatography-olfactometry (AEDA/GC-O). The results indicate that extended roasting pretreatment is effective in generating aldehydes and pyrazine aroma-active compounds in WOs. The correlation between the aroma-active compounds and chemical composition was identified by Pearson correlation analysis. The branched-chain aldehyde, 3-methylbutanal, is a Maillard reaction product with ribose as a precursor. Pyrazine aroma-active compounds were also related to ribose, with absolute correlation coefficients of 0.85 to 0.96; among pyrazine compounds, 2-ethyl-5-methylpyrazine showed strong correlation with isoleucine and arginine, while 2-methylpyrazine and 2,3,5-trimethylpyrazine showed strong correlation with glycine, lysine, and histidine. The determination of the effect of roasting on aroma-active compound alteration and the study of aroma precursors will be helpful for walnut oils' flavor quality control, which directly enable their industrial application.