Data Centers

How to install VirtualBox Guest Additions on a GUI-less Ubuntu server host

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.

virtualizationistock-494206787pixelparticle.jpg
Image: iStock/pixelparticle

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

  1. Start VirtualBox.
  2. Start the host in question.
  3. Once the host has booted, click Devices | Insert Guest Additions CD Image.
  4. Log in to your guest server.
  5. Mount the CD-ROM with the command sudo mount /dev/cdrom /media/cdrom.
  6. Change into the mounted directory with the command cd /media/cdrom.
  7. Install the necessary dependencies with the command sudo apt-get install -y dkms build-essential linux-headers-generic linux-headers-$(uname -r).
  8. Change to the root user with the command sudo su.
  9. Install the Guest Additions package with the command ./VBoxLinuxAdditions.run.
  10. 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.

Figure A

Figure A

Vboxguest is present and working.

You can issue the command modinfo vboxguest to view the details about the module (Figure B).

Figure B

Figure B

Viewing details for the vboxguest module.

Congrats! You have successfully installed the VirtualBox Guest Additions package on a GUI-less Linux host.

Also see

About Jack Wallen

Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website jackwallen.com.

Editor's Picks

Free Newsletters, In your Inbox