Ubuntu – Shared clipboard is not working and can’t use sudo commands on host-machine

18.04clipboardvirtualbox

I just created a virtual machine using ubuntu 18.04 on a kubuntu host machine. I tried to use the bidirectional shared clipboard option after installing guest additions on the guest machine. On the host machine I can't use sudo commands, which is the actual reason for me to use a virtual machine.

I already tried the solutions suggested in the first 3 answers of this post VirtualBox 4.12 Shared clipboard not working in Ubuntu14.04 except that i changed the commands in the third answer for the commands suggested in the comments, because someone said that the commands in the answer killed his ubuntu installation. None of the solutions worked.

Does anyone have any other solution?

The output of vboxmanage list extpacks on host:

Extension Packs: 1
Pack no. 0:
VNC Version: 5.1.38
Revision: 122592
Edition:
Description: VNC plugin module
VRDE Module: VBoxVNC
Usable: true
Why unusable:

Output of VBoxClient -V on guest machine:

5.1.38r122592

Best Answer

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
Related Question