I used to be able to do it with VMware guests (was a VMware built-in feature). I would think would be a way of capturing via X. I just did a search and found this but haven't used it myself (yet):
I just realized it's in my Fedora repositories. I just did a "yum install gtk-recordmydesktop" and it worked out of the box. I'll bet it's in the Ubuntu repos as well.