A foxhole is a three to four foot deep hole in the ground. A soldier in a foxhole can fight with only his head and shoulders exposed, or he may crouch in the bottom, unable to see anything but taking nearly full cover from most weapons. Foxholes can be dug in a few hours by infantry units, and all infantry carried entrenching tools specifically for this purpose, so they were very common in defenses. However, digging was rarely performed in battle, and even a few hours of digging is outside of the timeframe of almost all battles. Thus, digging in is not allowed in any Combat Mission game.
In CMx2, foxholes must be purchased like other fortifications, and may be setup according the same rules as other units. Foxholes are allowed in most terrain, but cannot be setup in buildings or in action spots containing linear terrain such as walls, bocage, or hedges. (Note that scenario authors can get foxholes into linear terrain by putting the foxholes there first, then the terrain.)
Unlike trenches, a foxhole unit usually only provides enough cover for a team of infantry. Foxholes also have the disadvantage of being easy to spot, even though they offer concealment to infantry in them.
As of CMBN 1.01, foxholes offer poor cover against enemy direct fire. However, they do offer good protection against artillery, particular when the infantry hides or is pinned. There are known problems with foxholes: infantry do not seem to prioritize getting into the foxholes, even when under fire.
In CMx1, foxholes are placed automatically in the locations of defending infantry units during setup, if the terrain they are in can have foxholes dug. Infantry abstractly occupy foxholes automatically when in the same square. Foxholes in open ground are poor fighting positions and should be avoided unless there is no other cover at all.