Another option that could work is to mount a small junction box at the machine that just has wiring terminal blocks for all the machine controls and then run a cable to the larger panel with the VFD that you mount in a convenient place further away. The motor wires would be run in a flexible conduit from your VFD panel directly to the motor. I have my lathe set up that way, I removed the panel on the back of the lathe since it was placed up against a wall and mounted a small junction box on the side of the stand for all the controls that then is wired into my VFD panel that is mounted about 6 feet away from the machine.
The VFD cabinet needs to be a minimum size for cooling air flow of the VFD. If you look in VFD manuals, they give minimum distances away from the walls in all directions. Machine tools are used intermittently, so unless you live in a hot area, you shouldn't need a cooling fan in the enclosure for one small VFD. I have a metal 24x24 enclosure with my mill and lathe VFDs as well as a 24v power supply and have never had a heating issue, but my shop is in the basement and never gets above 70F.
The VFD cabinet needs to be a minimum size for cooling air flow of the VFD. If you look in VFD manuals, they give minimum distances away from the walls in all directions. Machine tools are used intermittently, so unless you live in a hot area, you shouldn't need a cooling fan in the enclosure for one small VFD. I have a metal 24x24 enclosure with my mill and lathe VFDs as well as a 24v power supply and have never had a heating issue, but my shop is in the basement and never gets above 70F.