Inboard diesel engine stalls after few minutes of operation. It restarts right away only to stall again.
Your fuel lines are clogged somewhere. Secure the boat (drop anchor, sail back in if a sailboat, radio for tow etc.). Debug the fuel system. Most diesel inboard engine have at least two pumps and one filter. Start working your way backwards, start from bleeding the high pressure fuel pump. Turn the engine ignition on so that the electric pump will start. This should prime the fuel lines. Locate the priming bolt on the high pressure pump on the engine itself. Loosen it just a little. If the system works all the way to that point, you will see fuel coming out. Tighten back and turn everything off. Your problem is with the injectors. Start cursing and call your favorite marine mechanics, this is out of most people's league.
If no fuel comes out, you are in luck, sort of speak. Start back tracking, tighten the bleeding bolt you just loosen and locate the fuel filter. This too has a bleeding bolt. With the electric pump still going loosen this one and look for fuel coming out. If fuel comes out, the clog is in the hose connecting the fuel filter with the high pressure pump. Remove it and either clean it or replace it. If nothing comes out, tighten the bleeding bolt and move to the electrical fuel pump. Locate the electric fuel pump and loosen the line that goes to the engine. If fuels comes out, that line is clogged. Remove and clean or replace. If no fuels come out (and you can hear the pump running) the clog is on the pick up line from the tank to the electric pump. Remove the hose and try to unclog it or replace it. Note that if you get this far, chances are your fuel tank is full of debriefs and mud. The mud is actually made by bacteria living the suspended water in your diesel. I recommend either cleaning the fuel tank (if you can access it and you can access the inside really well) or replace it with a plastic one so you can keep and eye on think over time. In my case it was the latter so I replaced the whole aluminum tank with a modern polycarbonate tank.