It is as simple as the compounds that you want to separate and identify being soluble in the solvent. Generally low boiling solvents, such as hexane or methanol, are used as they move rapidly through the column. In many analyses, the MS detector is turned off for some time after the injection to allow the solvent to move through the column. The detector can then be turned on.
The solvent used in GCMS are mostly a-polar solvents since polar solvents can cause disturb the chromatography, like fronting, tailing and peak splitting. Generally, a solvent is chosen with a much lower boiling than the compounds. If the boiling points are to close distortion of the chromatography will happen. Typical solvents are hexane and iso-octane. More polar solvents like acetonitril and toluene can be used, but you probably need to invest more time in the development of the injection method with these solvents. Another influence is also the sample pre-treatment, e.g. in what solvent will your extract end up after the last step of the preparation procedure.
A key Factor to consider in GCMS is the space of the liner, you need to select a solvent that for the given volume will vaporize but not expand too far and contaminate the exterior of the injector port and septa etc. The link below is a good calculator for deciding if your solvent/injection volume is a risk.
If you contaminate the injector it can be a lot of work to clean and purge this
Guillaume is right that hexane is a good solvent but if you wish multiple injections then you will risk evaporation of the sample, iso-octane, nonane and dodecane are more stable but you need to be sure your compounds of interest will dissolve.
The Gas Chromatography/Mass Spectrometry (GC/MS) instrument separates chemical mixtures (the GC component) and identifies the components at a molecular level (the MS component). It is one of the most accurate tools for analyzing environmental samples. The GC works on the principle that a mixture will separate into individual substances when heated. The heated gases are carried through a column with an inert gas (such as helium). As the separated substances emerge from the column opening, they flow into the MS. Mass spectrometry identifies compounds by the mass of the analyte molecule.
Many more factors are concerned at the time of solvent selection for GCMS analysis.Column,liner,target compound,matrix of sample , also the GC configuration will take different role for solvent extraction game. So, there no thumb rule for GCMS solvent, as per my work experience.
GC-MS is a destructive type instrument we can use both polar (except water) and non-polar solvents, GC-MS Headspace analysis for residual solvents I used to inject the mixer of these solvents and validated the method of analysis which I used for the same. In head space injection converting the liquid to vapors then injecting, but in liquid injection may come some issues related peak tailing, overlapping and fronting. I agree with Shilpa Mondal
Note that Hexane is recommanded as solvent solubilizing for use in gas chromatography cg-ms, because it can produce good recoveries of low levels of semi-volatiles and often gives cleaner extracts. Peak shapes can be better than for dichloromethane with a splitless injector for some early/medium eluting compounds as you can use the 'solvent trapping effect' at a higher initial column oven temperature. In addition, alkanes in general are very stable and do not react with anything that is likely to be in a sample for GC analysis.