114

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.

  • 3
    Have you tried just re-installing the Guest Additions in the Virtual Machine? If not, check the answer from Pisu below. You didn't mention how you originally installed VirtualBox (external package from VirtualBox's website, or the virtualbox-ose package from the Ubuntu repositories) Also, what version you are on (both Ubuntu and VirtualBox). This info may help us help you. – Jayson Rowe Sep 30 '11 at 1:58

15 Answers 15

126

If your guest OS is ubuntu then running following two commands in ubuntu terminal should help:

$ killall VBoxClient
$ VBoxClient-all
  • 2
    Worked for me on Ubuntu 14.04 running on a Windows7 host. Thanks! – Paul Sep 10 '15 at 6:56
  • 7
    Couldn't find a VBoxClient-all binary on my system. Just kill-ing and restarting VBoxClient --clipboard seems to have worked for me. – decimus phostle Mar 13 '17 at 16:56
  • 2
    @decimusphostle In my Ubuntu 16.04 it is located in /usr/bin/VBoxClient-all . Actually it is not a binary but a script which executes the following commands: /usr/bin/VBoxClient --clipboard /usr/bin/VBoxClient --checkhostversion /usr/bin/VBoxClient --display /usr/bin/VBoxClient --seamless /usr/bin/VBoxClient --draganddrop – Dmitry Mar 13 '17 at 17:28
  • 4
    Worked on Ubuntu 16.04 – qwertzguy Oct 19 '17 at 16:53
  • 2
    fyi, on 17.10 Ubuntu Server (with desktop apps installed), I have no VBoxClient-all: poking around the install code, it's referenced in virtualbox.org/browser/vbox/trunk/src/VBox/Additions/linux/… - also noticed there used to be a reference to it in Makefile.kmk github.com/mdaniel/virtualbox-org-svn-vbox-trunk/blob/… - still not sure what the story is – Ben Creasy Feb 11 '18 at 5:36
33

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".

  • Unbelievable, it works great though :) Also on my Windows 2008R2 x64 virtual OS. Thanks for sharing! – Koen Zomers Apr 6 '12 at 14:00
  • Thank you! Works for Windows 7 x64, VirtualBox 4.3.16.0. – Sergey Brunov Oct 6 '14 at 20:59
  • It didn't work for me, my host is Win7 and VirtualBox is running Win7. It seems like it is supported only with linux? – zadane Oct 5 '16 at 14:40
  • This didn't work for host/guest win10 – andy Jan 9 '17 at 11:30
  • Still on W81, works. – Harald Aug 2 '17 at 14:22
23

In the Oracle virtual box setting go to

Settings > General > Advance

There is a an option Drag n Drop. Select the direction you want to copy the text.

  • Thanks, that helped. I would have had to search for a long time to find that one. – WitchCraft Apr 23 '14 at 20:11
  • 7
    @amjad, Nope, it's already selected. Still not working, you need to restart the vboxtray as the other answers suggested. – Pacerier Sep 2 '15 at 4:59
  • 2
    Drag'n'Drop? Are you sure? Shared Clipboard should be option for guest-host copy/paste, but the trick is that it stopped working for some reason. – Traxo Aug 8 '18 at 17:15
  • 1
    If it was not enabled, then restarting wouldn't fix the issue for the original question. But this might help some people for whom it NEVER works. – Dobes Vandermeer Aug 15 '18 at 17:10
19

For me, Windows 7 host and Ubuntu 16.04 guest, I had to install VirtualBox guest additions.

  1. Start the virtual machine
  2. Click Devices menu
  3. Select Insert Guest Additions CD image
  4. Change to the directory where your CD-ROM drive is mounted (typically /media/<user>/VBOXADDITIONS_x.x.x/)
  5. Install it sudo sh ./VBoxLinuxAdditions.run
  6. Reboot the virtual machine!

I found the complete steps in this link

  • Thanks. I don't need need to install that "Guest Additions CD". This solves my problem. – Johnny Wong May 10 '17 at 7:59
  • 2
    I had to reboot, then it worked. – Robert Brooker Jul 9 '17 at 9:13
  • It seems this requirement depends on the guest you install, but after installing Guest Additions on a new VM, and restarting it, my clipboard settings where then respected. – BuvinJ Aug 17 '17 at 13:47
  • Worked for me on Ubuntu 18.04.1 LTS. – Jake Reece Dec 27 '18 at 19:50
15

Restart the VBox clipboard module:

pkill 'VBoxClient --clipboard' -f & sleep 1 && VBoxClient --clipboard

  • Thanks. I was having a problem pasting from guest to host (but not from host to guest) and this solved it for me. – Kimberly W Jun 15 '15 at 14:52
  • Should we run this command from guest or host? – Black Jun 1 '17 at 11:48
  • @Black Guest OS. – DBedrenko Jun 1 '17 at 16:30
  • 1
    This does fix the problem when manually run, but the issue comes up every time I restart the machine. I've tried running the command when the machine starts automatically, but doesn't work (I'm assuming the vbox service hasn't initialized yet when the command is run.) -- Anyone else know of an easier solution than manually pasting this in each time I want to copy/paste to my host? – Zachary Schuessler Aug 14 '17 at 18:17
9

In Ubuntu you may need to install virtualbox-guest-x11

sudo apt-get install virtualbox-guest-x11

and then start virutal box client

VBoxClient-all
  • 5
    I tried it but I get VBoxClient-all: command not found – Black Jun 1 '17 at 11:49
  • 2
    I tried VBoxClient --clipboard worked for me – Dee Nov 15 '17 at 1:17
  • +1 I had to do this on Lubuntu – addison Jan 23 at 19:48
4

How to fix shared clipboard in VirtualBox (Windows Guest)

  1. In VirtualBox Windows Guest, Open Task Manager
  2. Go to Processes Tab, highlight VBoxTray.exe and select End Process
  3. Go to Applications Tab and select New Task
  4. Browse to the VirtualBox Guest Additions installation folder and select VBoxTray.exe and select OK.

The bidirectional shared clipboard should work afterwards.

4

In Ubuntu 16.10 I had to run following command to get it to work:

service virtualbox-guest-utils start

In addition to this, set the Shared Clipboard setting to Bidirectional in General/Advanced Virtual box settings.

3

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.

1

I use a Mac Host OS, and Ubuntu Guest (with lubuntu desktop).

Dmitry's answer got me so close! But VBoxClient wasn't running when I looked for it with ps, and trying VBoxClient-all failed:

$ VBoxClient-all
Failed to connect to the VirtualBox kernel service
Failed to connect to the VirtualBox kernel service
Failed to connect to the VirtualBox kernel service
Failed to connect to the VirtualBox kernel service
Failed to connect to the VirtualBox kernel service

Then I found https://www.virtualbox.org/ticket/9332

Turns out, VirtualBox additions didn't launch automatically for some reason. Starting vboxadd manually allowed me to then run the VBoxClient with the clipboard enabled.

arin@arin-VirtualBox:~$ sudo /etc/init.d/vboxadd start
Starting the VirtualBox Guest Additions ...done.
arin@arin-VirtualBox:~$ ps -ef | grep -i vbox
arin      2687 22537  0 10:53 pts/1    00:00:00 grep --color=auto -i vbox
arin@arin-VirtualBox:~$ sudo /usr/bin/VBoxClient --clipboard
arin@arin-VirtualBox:~$ ps -ef | grep -i VBox
root      2693 22100  0 10:53 ?        00:00:00 /usr/bin/VBoxClient --clipboard
arin      2698 22537  0 10:53 pts/1    00:00:00 grep --color=auto -i VBox

And now copy/paste works!

1

On Ubuntu 18.04 running on VirtualBox 5.2.22 , I did the following:

  1. On VirtualBox Manager, right click Ubuntu VM->Settings->General tab on left->Advanced tab on right. Now choose Shared Clipboard as : Bidirectional

  2. On Ubuntu, on the terminal run the following commands:

    sudo apt install virtualbox-guest-x11

Now I had to restart Ubuntu to run the below command run successfully:

VBoxClient --clipboard

After this, the bi-directional copy started working.

0

My configuration is Windows host, Xubuntu guest. I guess it doesn't hurt to restart everything, but this is the client that matters. (VBoxClient-all is merely a script that runs /usr/bin/VBoxClient --clipboard and others.)

$ ps -fe|grep -i clip
tbc       1400     1  0 Jan18 ?        00:00:00 /usr/bin/VBoxClient --clipboard
$
$ p=1400;kill -int $p;ps -fp $p
$ /usr/bin/VBoxClient --clipboard
$ ps -fe|grep -i clip
tbc      30555  1281  0 13:01 ?        00:00:00 /usr/bin/VBoxClient --clipboard
$ pstree -sp 30555
init(1)---lightdm(1094)---lightdm(1261)---init(1281)---VBoxClient(30555)---{VBoxClient}(30556)
$

Note it runs in the background by default. It was owned by init(1), but when I invoked it, it got adopted through a tree I'm not familiar with.

0

I was using VirtualBox 4.3.12. Once I upgraded to 5.0 the latest, the bugs were fixed.

No combination of reinstalling Vbox additions helped.

Solution: always try upgrading to the latest https://www.virtualbox.org/wiki/Downloads

0

Login to your guest machine and open the CD drive where "VirtualBox Guest Additions" should be inserted.

Open this CD drive and execute the file "VBoxWindowsAdditions.exe".

After the installation you have to restart, then it should work!

-1

I had similar problems with VirtualBox 5.1.14. The computer was running Opensuse Leap 42.2 and a Windows 7 Pro (64Bit) was installed on the VM. Restarting Vboxtray.exe solved the issue once but finally deactivating the indexing service of Windows fixed it permanently.

  • Your solution is for Windows based VirtualBox while it seems the question is about a Linux based VirtualBox – Mostafa Ahangarha Feb 19 '17 at 6:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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