How do you auto-type the contents of the clipboard from the host into a guest Virtual Box instance?
In the case where clipboard sharing is not possible, because there is just a console and no GUI.
Can do that with AutoHotKey on a windows host.
I wrote this script which sends the contents of the clipboard once you press Win
+v
.
Save it as sendClipboard.ahk
:
; win + v
#v::
SendRaw %clipboard%
if you've installed AutoHotKey, you can execute it by double-clicking the file. a "H" icon will appear in the system tray notification area.
Now you will be able to use Win
+v
to send the clipboard contents as text to the active window.
NOTE: don't forget to press your HOST key, usually the right Ctrl
, in order to return the focus to your host os, before using Win
+v
.
WARNING The script is basic and does not try to protect you from inserting eg. a big image data from the clipboard as text... so it requires you to understand and know what you are doing to make use of it.
If you cannot install Guest additions to share the clipboard, you need to create a script on the host OS that stores the clipboard text in a file in a shared folder. On the guest OS you need to create a script that reads any new file in the shared folder and types the content of the textfile.
old, false answer (may still be useful to others)
In order to enable sharing the clipboard between your guest OS and your host OS, you have to install Guest additions (How do I enable the shared clipboard in VirtualBox?).
Then you need to run a script on your guest OS that listens for clipboard changes. If you use Windows, you can accomplish something like that using AutoHotkey. The script will type the content of the clipboard as text when the content of the clipboard changes.
For Mac you would also have to use a macro program like Keyboard Maestro or iKey. And for Linux some obscure command line tool that requires an software engineering degree to understand.