Basal stem rot disease caused by the white‐rot fungus Ganoderma boninense is a major threat to the oil palm industry, and hence, the ability to detect infections at an early stage of development is desired. In this study, a headspace solid‐phase microextraction (HS‐SPME) method coupled with gas chromatography–mass spectrometry (GC‐MS) was employed to analyse the volatile organic compounds (VOCs) released from G. boninense cultures and infected oil palm wood. We examined VOCs released from three types of samples: G. boninense mycelium, oil palm wood and oil palm wood colonized by G. boninense. This preliminary study led to the tentative identification of 57 VOCs, including alcohols, alkanes, volatile acids, ketones, aldehydes, esters, sesquiterpenes and polycyclic aromatic hydrocarbon groups. Aliphatic compounds with eight‐carbon atoms, such as 1‐octen‐3‐ol, 3‐octanone, 1‐octanol and (E)‐2‐octenal, were the most abundant constituents of the Ganoderma samples, whereas furfural and hexanal were the major compounds detected in the oil palm wood samples. Chemometric analyses using cluster heat maps and principal component analyses were used to discriminate between the VOC profiles. The results indicated that the novel method described here could be used to detect Ganoderma disease and, more generally, for chemoecological studies of plant–pathogen interactions.