Copy and paste between your host and guest Linux system requires Guest Additions

VirtualBox does not let you copy text on your host computer and paste it into your Linux virtual machine (or the reverse) until you install Guest Additions — a set of drivers and tools that make the virtual machine behave more like a real computer on your network. Without Guest Additions, the clipboard is isolated: what you copy stays on your host, and your Linux guest cannot see it.

The process takes about 10 minutes and involves downloading a single file inside your Linux virtual machine, then running an installer. Once it finishes, you will be able to copy text, file paths, or commands on your host and paste them directly into your Linux terminal or text editor, and copy from Linux back to your host.

Key Takeaways

  • Guest Additions is a VirtualBox package that must be installed inside your Linux virtual machine to enable clipboard sharing.
  • You insert the Guest Additions ISO file through the VirtualBox menu, then run the installer from inside your Linux guest.
  • After installation completes, you must restart your Linux virtual machine for copy and paste to work.
  • If the installer fails, your Linux system may be missing build tools — installing gcc and make will usually fix it.

Insert the Guest Additions ISO into your virtual machine

Start by opening VirtualBox and selecting your Linux virtual machine from the list on the left. Make sure the machine is running — you cannot insert Guest Additions into a powered-off guest. Click the Devices menu at the top of the VirtualBox window, then select Insert Guest Additions CD Image.

VirtualBox will mount a virtual CD drive inside your Linux machine. You should see a dialog box appear on your Linux desktop asking what you want to do with the disc. If nothing appears, open your file manager and look for a disc icon or a folder named VBox_GAs (the version number may differ). Double-click it to open the disc contents.

Run the Guest Additions installer from the terminal

Inside the mounted disc, you will see several files. The one you need is called VBoxLinuxAdditions.run. Right-click on it and select Open in Terminal, or open a terminal window and navigate to the disc folder. Type the following command and press Enter:

sudo bash VBoxLinuxAdditions.run

The installer will ask for your password (the one you use to log into your Linux account). Type it and press Enter. The installer will then download and compile the necessary drivers. This step takes a few minutes — you will see text scrolling in the terminal as it works. Do not close the terminal or interrupt the process.

Restart your Linux virtual machine

Once the installer finishes, it will print a message saying the installation was successful (or it may ask you to restart). Close the terminal and restart your Linux machine. You can do this by clicking the power icon in the top-right corner of your desktop, or by typing sudo reboot in the terminal and pressing Enter.

After your Linux machine restarts and you log back in, copy and paste should work immediately. Test it by copying some text on your host computer, then clicking inside a text editor or terminal in your Linux guest and pasting with Ctrl+V.

What to do if the installer fails or hangs

If the installer stops with an error message, the most common cause is that your Linux system is missing the build tools needed to compile the Guest Additions drivers. The error message usually mentions gcc or make. To fix this, open a terminal in your Linux guest and run the appropriate command for your distribution:

On Ubuntu or Debian, type: sudo apt update && sudo apt install build-essential linux-headers-$(uname -r)

On Fedora or Red Hat, type: sudo dnf install gcc kernel-devel kernel-headers

On Arch Linux, type: sudo pacman -S base-devel linux-headers

After the installation finishes, go back to the mounted Guest Additions disc and run the installer again. This time it should complete without errors.

Enable bidirectional clipboard sharing in VirtualBox settings

By default, VirtualBox allows copy and paste to work in both directions once Guest Additions is installed. However, if you find that pasting works one way but not the other, you can check the setting manually. Power off your Linux virtual machine completely, then right-click on it in the VirtualBox list and select Settings.

Click the General tab, then select Advanced. Look for the Shared Clipboard option and make sure it is set to Bidirectional. If it is set to Disabled or Host to Guest Only, change it to Bidirectional. Click OK to save, then start your Linux machine again.

Troubleshoot if copy and paste still does not work

If you have installed Guest Additions, restarted your machine, and enabled bidirectional clipboard in settings, but copy and paste still does not work, the Guest Additions installation may not have completed properly. Open a terminal in your Linux guest and type: lsmod | grep vboxguest

If this command returns a line containing vboxguest, the drivers are loaded and the problem is likely a permission issue. If it returns nothing, the drivers did not load. Try running the installer again by mounting the Guest Additions disc and repeating the steps above. If the installer still fails, check the error message carefully — it usually tells you exactly what is missing.

Frequently Asked Questions

Do I need to install Guest Additions every time I start my virtual machine?

No. Once you install Guest Additions and restart your Linux machine, it stays installed. Copy and paste will work every time you start the machine from that point forward, unless you delete the Guest Additions files or reinstall Linux.

Can I copy and paste files between my host and Linux guest, or only text?

Guest Additions enables text and clipboard content to be shared. For copying entire files or folders between your host and Linux guest, you will need to set up a shared folder through the VirtualBox Devices menu instead. Shared folders work independently of the clipboard.

What if the disc does not mount or I do not see the VBox_GAs folder?

Make sure your Linux virtual machine is powered on and you are logged in. Click the Devices menu again and select Insert Guest Additions CD Image a second time. If the disc still does not appear, try opening your file manager and looking for a disc icon in the sidebar. You may also need to manually mount it by opening a terminal and typing sudo mount /dev/cdrom /mnt.

Will enabling copy and paste slow down my virtual machine?

No. Guest Additions improves performance by adding proper graphics drivers and other optimizations. Copy and paste is a minor feature that has no measurable impact on speed.

Can I use copy and paste if my Linux guest does not have a graphical desktop?

Yes. Guest Additions works on command-line-only Linux systems. Install it the same way, but instead of looking for a desktop dialog, open a terminal and navigate to the mounted disc folder to run the installer.