Right now China/Russia are in a position where they have very little to lose and can just sit back and watch the US embarrass itself. They can't be seen as enabling NK, but beyond that they win by default in that we are distracted by it and look weak.
Russia has very little to gain or lose in this whole situation, but they benefit so long as it isn't resolved. As long as Russia holds a veto in the security council, nobody will be trying to take action on Ukraine, since they can start vetoing NK sanctions to make a point. Maybe more importantly, while the US tries to build an alliance to invade NK (possibly inevitable), Russia can sit back and call for calm and peace and de-escalation. This doesn't undo their Ukraine grab, but it creates an equivalency between Russian and US policy.
If I were China I would wait until I could horse trade. They want mineral rights in the south china sea, and Japan/SK/US (who are the primary states who can resist their island grabs) want to regime change NK. I predict they will do the minimum required by the UN and passively resist any other attempts to defuse the situation (in fact I think the more they pressure NK the more they make war inevitable. NK is now going to start starving and it's leadership may have to become hyper-aggressive) until they are paid out. Even then they will insist on concessions such as 'no US troops in the former NK'. If I were China I would participate in korean unification, but only with the condition that the US pull 100% of all military assets from the unified korea (since what can the US claim is the reason to keep them there if NK doesn't exist?), and that the US/SK/Japan concede that china owns the claimed undersea minerals.