VirtualBox GuestAdditions for Linux Guest OS

I often work with VirtualBox virtual machines and need to install GuestAdditions to use GUI applications comfortably. So, I decided to collect here some configuration scripts.

VirtualBox GuestAdditions

CentOS 8

See the section about VirtualBox in “CentOS 8 with IceWM Desktop Environment”

CentOS 7

In the configuration a new VirtualBox machine I add 2 network adapters:

  • Host Only Network
  • NAT

Installing clean CentOS (CentOS-7-x86_64-DVD-1611)

Activating network connections using `nmtui` and set the activation automatically

Getting the address via `ip addr`: 192.168.56.103

Installing OpenSSH (as root):

yum install openssh-server
systemctl restart sshd.service

Going to the host using ssh (basically to be able to copy-past commands):

ssh vmuser@192.168.56.103

Installing Desktop Environment:

su -
yum -y groups install "GNOME Desktop"

Installing dependencies for GuestAdditions:

su -
yum update
yum install gcc kernel-devel kernel-headers dkms make bzip2 perl
reboot

Checking that Desktop Environment installed successfully:

startx

Adding iso with GuestAdditions in VirtualBox interface: “Devices -> Insert Guest Additions CD Image”

Installing the GuestAdditions:

su -
mkdir /media/VirtualBoxGuestAdditions
mount -r /dev/cdrom /media/VirtualBoxGuestAdditions
KERN_DIR=/usr/src/kernels/`uname -r`
cd /media/VirtualBoxGuestAdditions
./VBoxLinuxAdditions.run
reboot

It works!

full screen Centos7

Ubuntu 16.04

In the configuration a new VirtualBox machine I add 2 network adapters:

  • Host Only Network
  • NAT

Installing clean Ubuntu 16.04 LTS

Getting the address via `ip addr`: 192.168.56.103

Installing OpenSSH (as root):

sudo su
apt-get install openssh-server
systemctl restart sshd.service

Going to the host using ssh (basically to be able to copy-past commands):

ssh vmuser@192.168.56.103

Installing dependencies for GuestAdditions:

sudo apt-get purge libappstream3
sudo apt-get update
sudo apt-get install gcc linux-headers-generic dkms make bzip2 perl
reboot

Same ad for Debian 9 it will be:

Installing the GuestAdditions:

sudo su
mkdir /media/VirtualBoxGuestAdditions
mount -r /dev/cdrom /media/VirtualBoxGuestAdditions
KERN_DIR=/lib/modules/`uname -r`/build/
cd /media/VirtualBoxGuestAdditions
./VBoxLinuxAdditions.run
reboot

It works!

Debian 9

The same as for Ubuntu, but the dependencies:

sudo apt-get install gcc linux-headers-$(uname -r) dkms make bzip2 perl
reboot

One thought on “VirtualBox GuestAdditions for Linux Guest OS

  1. Pingback: Deploying VirtualBox virtual machines with Vagrant | Alexander V. Leonov

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.