If I'm not mistaken, and I certainly could be, when white smoke belches from the exhaust at startup, and not at normal operating speed and temperatures, it is usually due to deposits around the piston rings. Condensation in the fuel line can also cause it. It happens in a diesel engine when the diesel fuel goes through the engine and reaches the exhaust without having been burned at all. This typically occurs due to the engine being too cool to burn the fuel, like in the winter, but often resulting from low compression in one cylinder, problems with the fuel injection timing or a defective fuel injector, poorly sealed piston rings, burnt-out glow plugs, poor fuel quality or a clogged air filter. And of course, more extreme engine problems such as a cracked block, a cracked cylinder head, leaking valves or a blown head gasket, can also cause the problem.
But happening only at startup and then going away relatively quickly points to piston ring carbon deposits and/or condensation in the fuel line.
Products designed to flush carbon away from the pistons often cures the carbon buildup problem at the pistons. If it's really bad you might think about using a pre-flush in the oil 15 minutes before changing the oil, but using a high quality oil and changing it the recommended intervals will help prevent the white smoke. And since the oil itself contains detergents, you might want ti change the oil at half the recommended intervals for the next 3 or 4 oil changes, to give the detergents a chance to work.
Regularly using Power Service (for cleaning and for cetane boost) or Howes Meaner Kleaner (for really good cleaning) will certainly help remove deposits around valves, injectors, etc. There is also a more intense process, generally called Carbon Clean or some variant, where they use a machine to basically put hydrogen into the engine and run it for a half an hour to really clean it out. It's something that should probably be done every 30,000 miles or so to keep your engine near-pristine, but it's also in the $150-$250 range to do it. But it'll absolutely clean it out, everything from the injectors to the EGR valve.
Blue smoke is a sign of oil burning in the engine. That's never good. Engine oil isn't supposed to be getting into areas where it can be burned. There could be a faulty injector pump or lift pump, which would allow oil to mix with fuel and be burned. The valves or valve stem seals could be bad. Worn cylinders and piston rings allows oil to seep where it shouldn't. Or you could have a problem as simple as having put too much oil in the engine.
Black smoke indicates poor combustion of the diesel fuel which causes large amounts of soot to be created and expelled. It's just an imbalance in the air to fuel ratio - too much fuel to not enough air. Other times it's an injector timing or some other injector issue like faulty injectors, a faulty injector pump, a bad air filter (causing not enough oxygen to be supplied), a bad EGR valve (causing the valves to clog) or even a bad turbocharger. Increasing the cetane of the fuel helps with that, as well.
With that I'll step back and prepare to be shredded by
greasytshirt who knows infinitely more about this than I do.