Fix VirtualBox Shared Clipboard Not Working Both Ways
Shared clipboard stops working after host or guest updates. The fix is reinstalling Guest Additions with full support for bidirectional clipboard.
You're running a virtual machine in VirtualBox 7.0.x, and copy-paste worked fine for weeks. Then yesterday you updated the guest OS from Ubuntu 22.04 to 24.04, or maybe you upgraded VirtualBox itself from 6.1 to 7.0. Now the clipboard only works in one direction — you can copy from guest to host, but not from host to guest. Or it doesn't work at all. The little clipboard icon in the VM toolbar is set to "Bidirectional," but it lies.
Why This Happens
What's happening here is that the VirtualBox Guest Additions driver that handles clipboard sync gets baked into a specific kernel version. When you update the guest's kernel — which happens with every Ubuntu point release (22.04 → 22.04.3, or 22.04 → 24.04) — the old driver binary is still there but can't load against the new kernel. So the system falls back to a fallback mode: one direction works, the other doesn't, or both fail silently.
VirtualBox's clipboard system works through a kernel module called vboxguest and a user-space service called VBoxClient. The kernel module handles the low-level clipboard data transfer. If it doesn't load, VBoxClient can't talk to it. And the service on the guest side only starts if the kernel module is present. That's your root cause right there.
The Fix: Reinstall Guest Additions Properly
Skip the lazy route of just clicking "Insert Guest Additions CD image" and hoping it works. The real fix is to rebuild the kernel module against your current kernel. Here are the steps that work on Windows hosts and Linux guests (Ubuntu/Debian). For macOS hosts the steps are the same — the guest doesn't care about your host OS.
- Unmount the old Guest Additions ISO — Go to Devices > Optical Drives > Remove disk from virtual drive. If it's already ejected, skip this.
- Install kernel headers and build tools on the guest. On Ubuntu/Debian:
The key issudo apt update sudo apt install build-essential linux-headers-$(uname -r)linux-headers-$(uname -r)— this matches your exact running kernel. Without it the Guest Additions installer will fail silently or use a cached header that doesn't match. - Download the latest Guest Additions ISO from inside the guest. Don't use the one packaged with VirtualBox — it's often outdated. On the guest, run:
Replace the version with the one you see in VirtualBox Help > About. Reason step 3 works: the installer on the ISO checks your kernel version at install time and compiles the module fresh. The pre-compiled one from the older ISO won't match.cd /tmp wget https://download.virtualbox.org/virtualbox/7.0.20/VBoxGuestAdditions_7.0.20.iso - Mount and run the installer.
Thesudo mount -o loop /tmp/VBoxGuestAdditions_7.0.20.iso /mnt cd /mnt sudo ./VBoxLinuxAdditions.run --nox11--nox11flag skips the GUI installer — it's faster and avoids X11 dependency issues on headless servers. This matters on Ubuntu Server or minimal installs. - Reboot the guest. Not just restart the service — full reboot. The kernel module loads at boot time. A service restart won't trigger module loading.
- Test both directions. Copy text from host, paste into guest terminal with Ctrl+Shift+V (or right-click). Then copy something in the guest and paste into a host text editor. If both work you're done.
If It Still Doesn't Work
Three things to check if the fix above fails:
| Symptom | What to Check |
|---|---|
| Clipboard icon still shows "Disabled" grayed out | The VM settings might be locked. Shut down the VM completely (not saved state), go to Settings > General > Advanced, and set Shared Clipboard to Bidirectional. Start fresh. |
| Guest Additions installer gave errors about missing X11 headers | On minimal Ubuntu (server edition) you need the X11 dev packages: sudo apt install xserver-xorg-dev libx11-dev. Without these, the clipboard VBoxClient component fails to compile. The kernel module works, but the user-space service crashes. |
| Copy works only once, then stops | This is a known bug in VirtualBox 7.0.12 through 7.0.18. Update to 7.0.20 or later. The clipboard daemon has a memory leak that kills the connection after first transfer. No amount of reinstalling fixes that — it's a VirtualBox bug they patched in the 7.0.20 release notes. |
One last thing: if you're using Windows as the guest (host is Linux or macOS), the procedure is different — you run the VBoxWindowsAdditions.exe installer as Administrator and reboot. But the same principle applies: use the ISO that matches your VirtualBox version, not an old one.
Pro tip: After reinstalling Guest Additions, run
lsmod | grep vboxin the guest terminal. If you seevboxguestandvboxsf, the kernel module loaded. If not, the installer failed. Check the log at/var/log/vboxadd-setup.logfor the exact error — it'll show you what kernel header is missing.
Was this solution helpful?