You haven't said which VFD you have, but if it is anything like mine it has a digital display of speed and a manual speed control on the front, neither of which will be accessible if it's inside the box. More importantly you must ensure good air flow through the VFD to avoid overheating. Correct air management is critical for power electronics.

Mine is on the wall behind one end of the machine near where the drag chain ends, partly because I can see it properly and set the speed and partly because I should have bought six metres of screened 4-core cable instead of five.

Kit