I used put some electronic circuits together in a plastic box, with a DC power jack attached to the box for a 24V dc supply to my circuit. Everything works fine. However i now plan to put all the circuitry into a metal chassis. I have heard that every metal chassis need to be grounded to the earth for safety reason. I searched online for more info but mostly are AC to the metal chassis box, which i knew it is just connecting the metal box to the 3rd prong. But for my case, can someone please tell how to ground the metal chassis with DC voltage input? I attach some images for understanding. I tried to make something like a mini PC with metal box shown in figure. Are those mini PC's metal box grounded as well?
You don’t need to ground the chassis. Your body is not conductive enough to be harmed by 24 VDC.
Depend on why you want to use the ground. The main use of the ground connector is for safety and usually is connect to the metal chassis if there is a risk that the main power can accidentally touch the metal chassis. Usually if the main power arrive directly to the metal chassis, the use of the gorund is reccomanded (and usually mandatory for normative); if the power of your circuit is galvanically isolated from your circuit yuo could avoid to connect the the ground.
However some times, the ground connector is used also for guaranteer electromagnetic compatibility but this is a different and more complicated argument.
I suggest you to understand very well how work the ground connector, to inform about power supply that you want to use and than choose the best solution: the safety in these cases is fundamental.