Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is it possible to simulate mouse and keyboard movements in a virtual machine (ie: running a macro) while still being able to work normally on my host.

Reason I ask is because I currently run these macros on my PC, but this hinders me because as long as those macros are running, I can't do anything else.

If anyone has any experience or ideas on this subject, or knows if it works with another VM software such as VirtualBox

share|improve this question
You should consider converting the macros to shell scripts. If they can't be easily done under Windows, try Linux. You can run your macros inside the VM and they won't interfere with the host. – Dec 4 '11 at 11:41
Why can't you simply put these macros inside your virtual machine environment and run them there? – Mokubai Dec 4 '11 at 18:20

1 Answer 1

up vote 0 down vote accepted

First of all, the question: "Why don't you just try it out?" springs to mind. But anyway, this is not the Superuser spirit, and I was interested to find out myself.

So I ran an AutoHotkey script

  • in a Windows Vista guest inside VirtualBox (which does not support mouse and keyboard integration)
  • in an XP mode guest with VirtualPC by Microsoft (which does support that integration)

while making sure the keyboard focus was off. The macro worked even when I took the keyboard focus away. I could watch it work in the virtual machine.

The answer to your question is therefore "yes, probably".

I am not sure this will work under all conditions, but I don't see why it should not.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.