What happens when you trash your .Xauthority?

Wow! Seriously creepy little fight with my system just now. In a moment of madness, I mounted my FreeBSD host system’s home directory as the home directory in an Ubuntu VM, thinking that I could conveniently use all the same app settings between the two. Not a bit of it! This was last week, and I somehow managed to get through several days of programming without coming to my senses. I did spot some problems which I was expect and just worked around them, like the binaries being in different places on each system; vlc couldn’t play anything because the Ubuntu machine uses alsa, which of course is linux-only. It wasn’t until today though that I was taught my lesson that this is seriously dangerous: my host’s .Xauthority was overwritten when I ran startx (rather than kdm) in the guest, which meant I suddenly had to stop what I was doing and scrabble to a VT in the host before the host Xserver suddenly stopped accepting keystrokes (which it shortly did…). I then treaded very gingerly indeed, sending controls to the guest and gradually disentangling the systems so I could kill the host X without losing any data and boot the VM up again without damaging anything. Not an experiment to do again! I’ve symlinked the appropriate dotfiles in my guest home directory now to the ones I want them to follow, after carefully checking that there aren’t any locks or sockets in the directories I’m linking! This one isn’t going to bite me again. I count myself lucky nothing got lost. The silly things you do without thinking…