What is the best way to install Guest Additions with all the resize and clipboard and file sharing features on Ubuntu 16.04?
There is a guest additions package, but this only enabled some of the features for me.
The most reliable way is probably to use the built-in installer that comes with VirtualBox.
This is for Ubuntu Desktop. For Ubuntu Server, see @ThisClark's answer.
- Make sure you have the latest version of VirtualBox.
- It might be good to first
sudo apt updateand
sudo apt upgradeand restart if needed.
- Power on virtual machine
- Click "Devices" on the VirtualBox menu at the top of the screen
- Click "Install Guest Additions CD Image..."
- Follow the on-screen prompts as needed, enter your password, etc.
- Restart the virtual machine
- Machine -> Settings -> General -> Advanced -> enable Shared Clipboard and/or Drag'n'Drop.
- Make sure View -> Auto-resize Guest Display is checked.
If you don't download the ISO, you won't get the "latest and greatest" version. If you'd like to stick with this option, please see the following notes for dependencies.
I have tested these instructions successfully under an Ubuntu 16.04 guest:
- Create Ubuntu server instance under VirtualBox (obviously).
Start VM, go to Devices -> Insert Guest Additions CD image to mount the ISO image.
From the terminal, run the following commands:
sudo -i apt install gcc make mkdir -p /media/cdrom mount /dev/cdrom /media/cdrom /media/cdrom/VBoxLinuxAdditions.run reboot
sudo usermod --append --groups vboxsf USERNAME
Host shares should now be mounted in Ubuntu guest under
/mediavia the installed VBoxService service, set to start on system boot-up.
This impacted my install.
Noted from comment:
- Log out and back in again after adding user account to vboxsf group
1) Install a package through the usual channels for your distribution. For example, you might use:
sudo apt-get install virtualbox-guest-additions-iso
2) Add in the guest additions by choosing Devices > Optical Drives > VBoxGuestAdditions.iso
When you use the above command to download the iso file. It can be found here:
This worked for VirtualBox 5.1.28 MacOS host running Ubuntu Server 16.04.3 LTS guest. All instructions are for the guest Ubuntu Server.
Note: do not use the VirtualBox GUI to "Insert Guest Additions CD Image." It did not invoke "vboxadd.sh" as did the up-to-date .iso downloaded from the virtualbox website. In addition, your guest must have internet access (use "NAT" instead of "bridged adapter" if you are having trouble with your guest OS internet).
In terminal, download the VBoxGuestAdditions.iso for your version of VirtualBox (for me it's 5.1.28).
Then create an empty directory in
/media and mount it there:
sudo mkdir /media/iso sudo mount VBoxGuestAdditions_5.1.28.iso /media/iso
Then go there and run the Linux installer:
cd /media/iso sudo ./VBoxLinuxAdditions.run
Reboot your guest OS:
You should be able to access your shared folder under
Virtual Box 5.1 wanted?
If you intend to get and use Virtual Box 5.1 (not 5.0), at the time of writing, you won't afaik get it through apt. And adding 3rd party repos can get you unintendedly the 32bit version with an obscure error version, see this answer.
Thus it's probably best to download VirtualBox itself and the Guest Additions (now renamed/part of "Extension Pack" it directly from the highest 5.1.x version you can find here:
(After abovemtioned 32bit nuisances, ) I got lucky with
The two offered extension packs are identical (same checksum), pick any:
How to install all of that? Double-click. Opens standard ".deb"-Installer, respectively virtual box, to take care of the extension pack. (Yes, windows-ish, uncool, but works!)
I had the same problem as you, I'll explain what I've done:
I read the VirtualBox User Guide corresponding to the version of VB installed.
I installed the VB from the repositories of Ubuntu; it is now(july2017) the version 5.0.40
- I download from VB www the extension pack corresponding to this version, double click and it is installed: I had access to USB devices.
It seems that the VBGuestAdditions.iso has to be installed with the installation of VM
by checking in settings->user interface ->devices ->insert GuestAdditions CD image,
but in my case it did not so I searched this ISO file in the host and in the case of the VB version this ISO file is in /usr/share/virtualbox.
Finally in the settings of the VM (the VBGuestAdditions is to be installed in the guest)
in Storage, in controller IDE I put the path to the file VBGuestAdditions.iso and it appears in the VM as a CD device and you can access it and run the VBGuestAdditions and obtain the correct resizing of screen and access to the shared folder (this last feature at least in guest win7).
I found this method was by far the easiest whilst also allowing dynamic screen resizing:
sudo apt install virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11