I installed Ubuntu 18.04 LTS inside VirtualBox 5.1.26. I installed guest additions, enabled clipboard sharing and rebooted the guest VM. However, clipboard sharing doesn't work. How can it be fixed?
-
Note that clipboard sharing works with Ubuntu **Desktop** only. If you are on Ubuntu **Server**, then abandon your quest, VirtualBox doesn't support clipboard sharing on the Server variant of the OS. – Mahn Jan 13 '23 at 18:36
9 Answers
The problem is with the virtualbox-guest-x11 package missing.
Execute the below commands:
sudo apt-get update
sudo apt-get install virtualbox-guest-x11
If it asks you about keeping a file or installing the new one, select the new one.
sudo VBoxClient --clipboard
This should enable clipboard sharing. Make sure that Clipboard Sharing is set to Bidirectional under VM Settings in VirtualBox as seen here:
- 2,861
- 1
- 18
- 29
- 1,241
- 1
- 6
- 3
-
2
-
2This solution worked for me (Host: Ubuntu 15.10, guest: Ubuntu 18.10). I needed to run all 3 commands and to say YES for the answer about maintain or replace a file. Thanks – user2342558 May 09 '19 at 08:39
-
3After I use aptitude to install virtualbox-guest-x11, it freezes my ubuntu 18.04 64bits. Now I need to reinstall ubuntu 18.04. – sam May 13 '19 at 07:56
-
For me `sudo apt-get install virtualbox-guest-x11-hwe` worked for my Ubuntu 18 guest running on a Windows 10 host. I found this by running `VBoxClient` at the terminal prompt, and get `Command VBoxClient not found, but can be installed with: sudo apt install virtualbox-guest-x11-hwe` – sez Dec 05 '19 at 22:37
-
This worked for me. I had an older version of VirtualBox (5.2.6) and the latest Ubuntu 18.04 guest additions I had to install virtualbox-guest-x11 manually and also xorg-video-abi-23 and xserver-xorg-core. – Achraf JEDAY Feb 04 '20 at 16:27
-
2This isn't working on my setup: Both host and guest are running Xubuntu 18.04, VirtualBox version is 6.1.2 r135662 (Qt5.9.5). I have installed the packages and the binary from the GuestAdditions CD image, rebooted, run `sudo VBoxClient --clipboard` but still no clipboard sharing. – FriendFX Feb 11 '20 at 02:19
-
1
-
On Ubuntu 19 answer is working, on Ubuntu 18 it freezes everything. – Hannes Schneidermayer Feb 25 '20 at 19:54
-
-
-
Do **not** install `virtualbox-guest-x11` if you are running Ubuntu **Server**, or it will effectively turn it into Ubuntu **Desktop**. – Mahn Jan 13 '23 at 18:39
The problem is old version of VirtualBox that has the old guest additions version. Updating VirtualBox to 5.2.8 helps in this case. After updating VirtualBox, the guest additions must be updated in the following way:
- Do
sudo apt install linux-headers-$(uname -r) build-essential dkmsif not done already. - Select Devices -> Insert Guest Additions CD Image... from VirtualBox VM menu
- Follow the instructions
- Eject the CD from Ubuntu after installation is done
- Reboot the Ubuntu guest VM
- Select Devices -> Shared Clipboard -> Bidirectional from VirtualBox VM menu to ensure clipboard sharing is enabled
Now shared clipboard should work.
- 1,876
- 4
- 14
- 17
-
even after doing this my shared clipboard doesn't seem to work. Do you have any other suggestion ? – Tanishq Vyas Sep 22 '20 at 14:56
NOTE: The following solution worked with the following setup:
- Windows 10 (v. 1909)
- Virtualbox 6.01
- Ubuntu 18.04 (with all software updates installed)
I honestly would try THIS solution before any of the other solution, because as of Dec 15th 2019, this solution is the only one that didn't completely fail. I had the same problem that sam had (the 3rd comment in juhist's answer). After following juhist's answer my ubuntu virtualbox was completely frozen after rebooting (keyboard and mouse wouldn't work after ubuntu logged in). Luckily I made a snapshot before I executed the solution, so I rolled it back and did this instead:
BEFORE YOU BEGIN:
Shut Down your Ubuntu Virtualbox, and make a Snapshot! That way if anything goes wrong, you can restore your working image.
STEP 1:
After making a snapshot, start your Ubuntu virtualbox back up, open up the terminal, and execute the following:
sudo apt update
sudo apt install build-essential dkms linux-headers-$(uname -r)
FYI: $(uname -r) prints the running Kernel version.
STEP 2:
From the virtual machine menu, click Devices -> “Insert Guest Additions CD Image”
This should mount a virtual CD/DVD drive inside the Ubuntu guest machine. When that happens, you should get a prompt to run the software. Click Run to begin the installation.
If you get an error saying the guest system has no CD-ROM, stop the virtual machine, open the virtual machine settings and from the “Storage” tab, add a new CD-ROM device to the machine by clicking on the plus sign (Adds optical device). Once done reboot the virtual machine.
STEP 3:
Restart the guest machine and you’re set.
Still Have problems? I got most of my instructions from the following two pages. These pages have additional steps to try if the above didn't work for you.
- 199
- 1
- 4
-
Did you try my answer or Swapnil Goad's answer? sam's comment is not a comment to my answer, and I see your answer is very similar to mine. – juhist Dec 16 '19 at 09:55
-
I tried Swapnil's. It didn't work. For some reason, when I saw your answer below the most voted on answer, I just saw you mention "Updating VirtualBox to 5.2.8" and since I was using 6.01, I didn't want to try yet another "answer" that may have been outdated. I had tried for two hours at that point until I came across the pages I posted in my answer. I'll upvote yours now that I see it's basically the same thing. That said...I do like my formatting better ;-) – Doomd Dec 16 '19 at 10:11
-
This isn't working on my setup: Both host and guest are running Xubuntu 18.04, VirtualBox version is 6.1.2 r135662 (Qt5.9.5). I have installed the packages and the binary from the GuestAdditions CD image, rebooted, but no clipboard sharing. – FriendFX Feb 11 '20 at 02:18
-
Had to downgrade to 6.1.2, do this procedure as well as https://unix.stackexchange.com/a/349763/145930 to make it work – Barmaley Apr 02 '20 at 01:13
-
The second page you posted help fix the issue. Thanks! https://linuxize.com/post/how-to-install-virtualbox-guest-additions-in-ubuntu/ – Revnic Robert-Nick May 16 '22 at 20:52
-
1it was this answer + "reboot" command to restart + this answer https://superuser.com/a/1537087/1140220 that got it working for me – Conor Aug 27 '22 at 12:50
Each time you install Guest Additions in version 6.1.4 shared clipboard is broken. There is a trick to problem workaround:
sudo apt-get remove virtualbox-guest-x11
sudo apt-get install virtualbox-guest-x11
sudo /usr/bin/VBoxClient --clipboard
- 51
- 1
- 1
Clipboard functionality in version 6.1.4 of GuestAdditions is bugged and won't work.
Download and use the different one - for me version 6.1.2 worked fine.
- 131
- 4
-
1
-
@MMM if you want to investigate the cause, you can check [ticket #19336](https://www.virtualbox.org/ticket/19336) related to this issue – komidawi Mar 23 '20 at 19:15
-
This is the only solution that worked, downgrading to 6.1.2 .. thanks! – hesham_EE Apr 07 '20 at 03:38
-
do I have to downgrade the whole of virtualbox or is is OK to install just the old guest additions? – Andy Apr 07 '20 at 07:49
-
@Andy I used latest VirtualBox and old guest additions and it worked fine – komidawi Apr 08 '20 at 09:26
-
I can confirm the answer from Komidawi.
If you have GuestAdditions version 6.1.4. It just won't work. You'll have to either use version 6.1.2 or download the latest test build (6.1.5)
Install, restart, and it will work.
- 31
- 1
If it doesn't work after installing Guest Additions, just remove the Virtual Optical Disk from the Virtual Drive.
Go to VM. Settings > Storage > Click on the disk icon (next to a file with the name ending in .iso) > Click on the disk shape in the right pane > select the option "Remove Disk From Virtual Drive".
- 101
Ok I tried everything here and nothing worked, turns out in my VM (Version 6.0.20 r137117) with Ubuntu 20.04 Guest and Windows 10 Host Setup shared clipboard would only ever work if BOTH shared clipboard AND drag&drop is set to bidirectional. if Drag&Drop is disabled it would never work.
- 1
First open settings-general-advanced- set the shared clipboard to bidirectional.
Then turn on the virtual machine, then from the menu bar, devices-insert guest additions as CD image and follow the instructions.
- 1
