Sometimes while using VirtualBox, I have tried copying text from the virtual machine to the host machine but failed. Whenever that happens, I fix it by rebooting the virtual machine. Is there a solution to this because I don't want to keep rebooting again and again.
Note: It is always possible for me to copy text from the host to the virtual machine.
If your guest OS is ubuntu then running following two commands in ubuntu terminal should help:
On a Windows XP guest, I can kill "VBoxTray.exe" using the Task Manager (Ctrl+Alt+Del), then restart it from "Program Files/VirtualBox Guest Additions".
In the Oracle virtual box setting go to
There is a an option Drag n Drop. Select the direction you want to copy the text.
Install VBoxClient (requirement for next step):
sudo apt install virtualbox-guest-x11
Restart the VBox clipboard module:
pkill 'VBoxClient --clipboard' -f & sleep 1 && VBoxClient --clipboard
For me, Windows 7 host and Ubuntu 16.04 guest, I had to install VirtualBox guest additions.
/media/<user>/VBOXADDITIONS_x.x.x/
)sudo sh ./VBoxLinuxAdditions.run
I found the complete steps in this link
In Ubuntu you may need to install
virtualbox-guest-x11
and then start virutal box client
On Ubuntu 18.04 running on VirtualBox 5.2.22, I did the following:
On VirtualBox Manager, right click Ubuntu VM -> Settings -> General tab on left -> Advanced tab on right`.
Now choose Shared Clipboard as : Bidirectional
On Ubuntu, on the terminal run the following commands:
Now I had to restart Ubuntu to run the below command run successfully:
After this, the bi-directional copy started working.
How to fix shared clipboard in VirtualBox (Windows Guest)
The bidirectional shared clipboard should work afterwards.
In Ubuntu 16.10 I had to run following command to get it to work:
In addition to this, set the Shared Clipboard setting to Bidirectional in General/Advanced Virtual box settings.
If needed, upgrade VirtualBox to latest version, currently 4.1.2, they solved many issues. Then reinstall Guest Additions on the VM, as copy-paste is managed by guest additions drivers.