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.
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!
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
Hi! My name is Alexander and I am a Vulnerability Management specialist. You can read more about me here. Currently, the best way to follow me is my Telegram channel @avleonovcom. I update it more often than this site. If you haven’t used Telegram yet, give it a try. It’s great. You can discuss my posts or ask questions at @avleonovchat.
А всех русскоязычных я приглашаю в ещё один телеграмм канал @avleonovrus, первым делом теперь пишу туда.
Pingback: Deploying VirtualBox virtual machines with Vagrant | Alexander V. Leonov