First: Do NOT unhook all the bare wires. They go to ONE of the strips (the ground one, which is also hooked to the box case), while the white wires go to the other one (the neutral one, which is insulated from the case). You need the ground to keep the housings of your three-wire appliances from being hot if there is an internal fault.
If your wiring was done to code there will be a "bond" between the neutral and ground in the MAIN panel only. (If you have any subpanels they will NOT be bonded, but will run the neutral and ground back to the main panel for the single house bond.)
Remove the bond in the main panel. Make sure the ground remains connected to the GROUND connections (green/bare/case/conduit) and that the NEUTRAL (white) is floating. Use an ohmmeter to be sure there isn't a second ground somewhere.
Then hook:
- Red and black to "hot" on your inverter.
- White to "netural" on your inverter. (Note that white will now also be "hot" on the house outlets, lamp shells, etc.)
- MAYBE hook inverter ground to green/bare ground:
Check your inverter with an ohm meter when it is powered down and unhooked from anything. You should find that the ground pin on the plug is connected to the case of the inverter and to the ground screw you should find there, and both sides of the battery are isolated from that.
- If this is the case, you can connect the building ground EITHER to the ground pin OR to the green ground screw on the inverter. Separately ground whichever side of the battery is convenient for your DC system.
- If one side of the inverter's battery input is connected to the case/ground screw/ground pin, DON'T connect the house ground to the inverter but be sure that side of the battery is the ground side.
If there is continuity to the battery side, recheck what you think the inverter's internal connection is using the voltage range of your multimeter with the inverter connected to the batteries, powered up, and still disconnected from the panel. The inverter's ground output should be at the same voltage (AC and DC scale both) as the one you your ohm meter previously said it was bonded to. (Don't do this test if there was no continuity: Stray capacitance will make the box and ground connections rise to some AC voltage when the inverter is running and the ground connection is floating.)
Remember the golden rule of grounding: The ground must be connected as a tree. NO LOOPS. No double paths. Everything that is supposed to be grounded must have exactly ONE path to ground.
In a cheap inverter you have a high voltage power supply - run from the battery - with one side grounded. The inverter switches BOTH the "hot" and "neutral" outputs, alternately, between the ground and the hot side of this internal DC power supply to provide an AC output. (With "MSM" it also spends two parts of the cycle with both grounded, in between giving each a hot pulse.) This is why bonding the neutral to ground lets the magic smoke out: For part of the cycle the "hot" wire is at ground and the "neutral" wire is connected, through a transistor, to the high voltage output of the inverter's internal voltage converter. Bonding neutral to ground causes the poor transistor to try to short out the power supply and discharge the capacitors through itself.