The VirtualBox Guest Additions gives a performance boost and extra features to your hosts. Follow these steps to install this package on a GUI-less Ubuntu server guest.
Virtual machines (VMs) have become a staple of the data center...and with good reason. With VMs, you can spin up as many servers as your host hardware will allow. But even when you have some pretty beefy hardware, you want to get as much performance out of those VMs as possible—that's why you should always consider performance when creating a new VM.
One way to gain more performance, as well as features such as folder sharing between guest and host, is to install the VirtualBox Guest Additions. For a host that includes a GUI, it's as simple as starting the host, clicking Devices | Insert Guest Additions CD image, and then following the steps. Unfortunately, installing this package on a GUI-less Linux server isn't as straightforward. Here are the steps to install this package on a Ubuntu server with no GUI.
Installing the Guest Additions on a GUI-less server
- Start VirtualBox.
- Start the host in question.
- Once the host has booted, click Devices | Insert Guest Additions CD Image.
- Log in to your guest server.
- Mount the CD-ROM with the command sudo mount /dev/cdrom /media/cdrom.
- Change into the mounted directory with the command cd /media/cdrom.
- Install the necessary dependencies with the command sudo apt-get install -y dkms build-essential linux-headers-generic linux-headers-$(uname -r).
- Change to the root user with the command sudo su.
- Install the Guest Additions package with the command ./VBoxLinuxAdditions.run.
- Allow the installation to complete.
You will see an error stating that the installer couldn't find the X.Org or XFree86 Window System—that's okay, because it doesn't exist on this host.
Reboot your machine, and the Guest Additions will be working. You should see a bit of a performance increase, as well as the extra features (shared clipboard, shared folders, and more) awarded by this installation.
SEE: Quick glossary: Virtualization (Tech Pro Research)
Verifying the loaded module
If you want to verify the Guest Additions installation was successful, issue the command lsmod | grep -io vboxguest. You should see an output similar to what's shown in Figure A.
You can issue the command modinfo vboxguest to view the details about the module (Figure B).
Congrats! You have successfully installed the VirtualBox Guest Additions package on a GUI-less Linux host.
- How to install phpVirtualBox for cloud-based VirtualBox management (TechRepublic)
- How to install Virtualmin for a web-based VirtualBox dashboard (TechRepublic)
- How to add new drives to a VirtualBox virtual machine (TechRepublic)
- How to run VirtualBox virtual machines from the command line (TechRepublic)
- Microsoft joining the Linux Foundation comes down to one word: Cloud (TechRepublic)
- Nothing good is free: How Linux and open source companies make money (ZDNet)