A variation of this answer worked. Specifically,
this fixes it for lubuntu 16.04:
sudo apt-get update
sudo apt-get install virtualbox-guest-x11 xorg-video-abi-20 xserver-xorg-core
if it asks you about keeping a file or installing the new one, press i to select the new one/package maintainer's version;
sudo VBoxClient --clipboard
this fixes it for lubuntu/xubuntu 18.04 - 20.04 and derived variants:
sudo apt-get update
sudo apt-get install virtualbox-guest-x11
if it asks you about keeping a file or installing the new one, press i to select the new one/package maintainer's version;
sudo VBoxClient --clipboard
Note, as raghavan said, that installing virtualbox-guest-x11 package as shown, also resolves the issue where the shared folders are not visible.
And installing this package (and rebooting the virtual machine) also resolves the guest window not autoresizing when the vm window is resized.
This also resolves the issue where paste after reboot no longer works and sudo VBoxClient --clipboard command needs to be repeated. After installing virtualbox-guest-x11, the --clipboard command does not need to be repeated after each reboot.
I have just got the same problem with Ubuntu MATE 18.10 guest.
The solution is to install two packages linux-headers and build tools:
sudo apt-get install linux-headers-generic build-essential
then reinstall VirtualBox Guest Additions from ISO and then reboot. The clipboard works after reboot.
The complete list of VirtualBox services will look like below:
$ ps ax | grep VBox
514 ? I< 0:00 [iprt-VBoxWQueue]
803 ? Sl 0:00 /usr/sbin/VBoxService --pidfile /var/run/vboxadd-service.sh
1320 ? S 0:00 /usr/bin/VBoxClient --clipboard
1321 ? Sl 0:00 /usr/bin/VBoxClient --clipboard
1330 ? S 0:00 /usr/bin/VBoxClient --display
1331 ? S 0:00 /usr/bin/VBoxClient --display
1340 ? S 0:00 /usr/bin/VBoxClient --seamless
1341 ? Sl 0:00 /usr/bin/VBoxClient --seamless
1349 ? S 0:00 /usr/bin/VBoxClient --draganddrop
1350 ? Sl 0:00 /usr/bin/VBoxClient --draganddrop
1938 pts/0 S+ 0:00 grep --color=auto VBox
Best Answer
virtualbox-guest-dkms
's version in Ubuntu 16.04.3 is5.0.40-dfsg-0ubuntu1.16.04.2
, which is the version of VirtualBox in Ubuntu's repository rather than 5.2.4. This might be causing your issue.Try the following to install the proper version of Guest Additions:
Devices
menu, chooseInsert Guest Additions CD image...
sudo apt purge virtualbox-guest-dkms
sudo /media/$USER/VBox_GAs_5.2.4/VBoxLinuxAdditions.run
Except for step 4, it's a good idea to do this every time there's a new version of VirtualBox (step 5 should be changed to the proper path, of course).