Sharing clipboard and folders between guest and host systems is essential to fully utilizing your virtual machine for development, running tools or simply testing out an Ubuntu distribution. Instructions below might be valid for other Linux distributions, but was only tested with Ubuntu 17.10 and VirtualBox 5.2.16.
Install Guest Additions
VirtualBox Guest Additions are required for sharing to work.
- Devices → Insert Guest Additions CD image… (from the VirtualBox menu)
- Choose Run from the prompt window, or execute
sudo ./VboxLinuxAdditions.run
in the root of inserted media - Follow instructions in the terminal
Enable clipboard sharing
Devices → Shared Clipboard → Bidirectional (from the VirtualBox menu)
Share folders with host
- Add the user to the
vboxsf
group:sudo adduser [username] vboxsf
(see [2]) - Share the folder through the VirtualBox menu: Devices → Shared Folders → Shared Folders Settings…
- Reboot the machine
- Folder should appear on desktop and in
/media
Troubleshooting
If you have installed VirtualBox Guest Additions on your Ubuntu virtual machine, you might have encountered the following error:
VBoxClient (seamless): failed to start. Stage: Setting guest IRQ filter mask Error: VERR_INTERNAL_ERROR
This indicates that the Guest Additions were not installed properly. To fix the error, run the following commands:
sudo apt-get install gcc make perl # see [1]
# Devices → Insert Guest Additions CD image... (from the VirtualBox menu)
sudo ./VboxLinuxAdditions.run # In the root of inserted media
sudo reboot