but anyway... forget it
ok ok!!... I get your point, to be honest.
1. I log in as (say) userX.
2. I turn to root by entering "sudo -s".
3. I enter "startx" in order to open the windows environment.
This has the effect that some configuration files in the userX directory saved as root (owner) which is acceptable because of "sudo -s".
4.Log off windows environment.
5. Press CTRL+D to exit the root session. So, I suppose that you see the "$" prompt.
6. Enter startx again.... to enter to windows as userX. Ooooops! Problem. The configuration file are not available for write acces to userX because of step 3. The are root now!
Try to write down the files that are referenced in every error message and then change to root again (don't even thing to ask how!) and using "chown <filename> userX userX" change the file owner back to the original. I hope that this will fix most of your "Cannot Access..." or "Cannot Write..." problems.
sudo stands for super user do