• Home
  • Blog
  • Linux
  • Fixing the screen resolution of a linux VirtualBox guest (installing VirtualBox Guest Additions)

Fixing the screen resolution of a linux VirtualBox guest (installing VirtualBox Guest Additions)

Today I created a Linux development environment in my Windows 7 notebook, running a Lubuntu 14.04 with VirtualBox. System installed, first boot OK, then I noticed that the only screen resolution available was merely 800x600 pixels. The way to solve this was installing the VirtualBox Guest Additions, and I will go through this process step by step, bringing up few issues that I came across, and other Lubuntu users may experience too.

First of all, notice in the screenshot below that the desktop does not fill the whole VirtualBox window. Installing the VirtualBox Guest Additions solved that.

To do so, in the VirtualBox window, with the system already running and logged, open the "Device" menu and select "Insert Guest Additions CD image".

 A virtual CD disk will be "inserted" in the guest machine, and you will be asked to open it.

Now, you want to run the VBoxLinuxAdditions.run file as administrator. To do that, first open a terminal pointing to the CD directory: right-click the VBOXADDITIONS_X.X.XX_XXXXX mount and select Open in Terminal, as indicated:

In my first attempt, I tryed to run the installation file as administrator using the command

sudo sh ./VBoxLinuxAdditions.run

In some other Linux distros that already come with gcc and make already installed, you can stop on this step. However, I recommend to carefully check the console messages and see if you get the same errors that I faced (see next steps).

After my first attempt, for instance, everything looks fine... but check out the highlighted messages in the middle of the process:

Well, looks like I supposed to have the gcc installed before install the Guest Additions. So, I executed the command

su apt-get update
su apt-get install gcc

And tried to install the Guest Additions again with

sudo sh ./VBoxLinuxAdditions.run

And then, I got the following error (or warning, whatever, I want everything running smoothly):

The make package is necessary as well. So, let's go for it:

su apt-get install make

And run the Guest Additions installation again:

sudo sh ./VBoxLinuxAdditions.run

Now, everything looks fine! Reboot the system and you are done!