Clutch or transmission problem

1.9L TDI w/hydraulic clutch and 5 speed manual transmission. Problem occured suddenly rather than gradually so must be a failure rather than wear. With engine running and clutch depressed, cannot get transmission into or out of any gear. With engine off, transmission will shift thru all gears smoothly. If put into gear with engine off and engine is then started car operates normally when clutch is let out but can't shift to next gear unless engine is shut off with clutch depressed while car is rolling, shift to next gear is then smooth, engine restarted and clutch let out and operation is normal in that gear. Works this way for all gears. Cannot move shift lever if engine is running but everything smooth as silk if engine is off. Any ideas?