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