How to Change the Resolution of a Linux Virtual Machine in Virtualbox

Last update: 04/10/2024
VirtualBox in full screen for Windows 10

When we create a new virtual machine in VirtualBox and install an operating system, VirtualBox sets a default screen resolution of 800 × 600 (4:3). However, while working in a virtual machine, we often need a screen resolution of our choice. Therefore, there are two ways to change the resolution of a virtual machine in VirtualBox: by changing the display settings of the Linux operating system and by installing the VirtualBox Guest Addition Image.

How to change the resolution of a Linux virtual machine in Virtualbox

We will be using Ubuntu 20.10 operating system installed on VirtualBox and will try the two methods provided above to change the screen resolution.

You might also be interested in: How to Change Screen Resolution on Windows, Mac, and Phones

Method 1: Change display settings

The easiest and quickest way to have a screen resolution of your choice is to change it from the display settings of the Linux operating system. Here are the steps to follow:

  • Step 1: First, go to the operating system settings.
  • Step 2: On Ubuntu or any other Linux based operating system, open the application menu.

Changing the resolution of a Virtual Machine

  • Step 3: seeks "setting» and open the settings by pressing the icon Configuration in the search results that will appear.
  • Step 4: Scroll down through the left menu bar and click on Screen settings.

Changing the resolution of a Virtual Machine

  • Step 5: en screen settings, click the resolution drop-down menu.
  • Step 6: From the drop-down menu, simply choose the resolution you want.

Changing the resolution of a Virtual Machine

  • Step 7: After choosing the appropriate resolution of your choice, a button labeled "Apply", which is green and is located in the upper right corner of the window.

Changing the resolution of a Virtual Machine

  • Step 8: click the button Apply and confirm the resolution change by clicking the « buttonSave Changes» that appeared in the pop-up box.

Changing the resolution of a Virtual Machine

That’s it. You have switched to the screen resolution of your own choice by changing the display settings of the Linux operating system. The limitation of this method is that we have a limited number of options available to change the screen resolution.

For example, you might want the screen resolution to be exactly the same as your laptop's screen size, but that resolution isn't available. In such a scenario, installing VirtualBox Guest Addition is helpful.

Installing VirtualBox Guest Addition Image

To install an additional guest image on your virtual machine, follow the procedure below:

Step 1: Open the operating system terminal and run the command provided below to install some packages necessary to have Guest Addition Image:

For Ubuntu or Debian based operating systems:

$ sudo apt install build-essential dkms linux-headers-$ (uname -r)

Installing VirtualBox Guest Addition Image

For CentOS or RHEL based operating systems:

$ sudo dnf install epel-release

$ sudo dnf install gcc perl dkms make kernel-devel kernel-headers bzip2

Installing VirtualBox Guest Addition Image

After installing the required packages, insert the Guest Addition CD image.

Step 2: Click the " Devices " option in the menu bar corresponding to the virtual machine and select " Insert Guest Addition CD Image " from the " Devices " menu:

Installing VirtualBox Guest Addition Image

Step 3: The installation will complete shortly. Once it's finished, you'll be prompted to restart your system. Restart your computer, and if the guest image was inserted and installed correctly, the screen size will automatically resize to match the window size. However, if this doesn't work, the guest image wasn't inserted correctly. You'll need to insert it manually.

  How to Increase Internet Speed ​​in Windows

Manually insert the guest addition CD image

These are the steps to follow:

Step 1: First, create a new directory /mnt/cdrom:

$ sudo mkdir -p /mnt/cdrom

Manually insert the guest addition CD image

Step 2: After creating, mount the image in /mnt/cdrom:

$sudo mount /dev/cdrom/mnt/cdrom

Manually insert the guest addition CD image

Step 3: Change the directory to /mnt/cdrom and run the script " VBoxLinuxAddition.run ":

$ cd /mnt/cdrom

Manually insert the guest addition CD image

$ sudo sh . /VBoxLinuxAdditions.run –nox11

Manually insert the guest addition CD image

Step 4: Once the script has finished running, restart your system using the command mentioned below:

$ sudo shutdown -r now

Manually insert the guest addition CD image

Step 5: After restarting the machine, the screen size will adjust accordingly. However, it will now work perfectly fine. You can now easily switch to full screen and work with ease in your Linux virtual machine.

You might also want to know: How to Change the Monitor Refresh Rate

How to make VirtualBox full screen for Windows 10

If security is a concern for you, running Windows 10 as a virtual machine (VM) in VirtualBox is a good idea. You can disable the internet connection or configure a virtual network adapter for the respective virtual machine in Host-only mode to allow network communication only between the host and guest systems, and deny the Windows 10 guest connection to external networks , including the internet.

VirtualBox is installed on the host operating system running on a physical machine, and the guest operating system is the operating system running in a virtual machine. If you try to maximize the VirtualBox VM window immediately after installing Windows 10 in a VirtualBox VM, the guest operating system's user interface size will not increase.

VirtualBox in full screen for Windows 10

Check the amount of video memory you have in the virtual machine settings. It is recommended that you set 128 MB of video memory, as when using a higher resolution video mode, more video memory is required. You can also enable 2D and 3D acceleration.

VirtualBox in full screen for Windows 10

If you go to the display settings in Windows 10 (right-click on the desktop, select Display settings from the context menu ), you can increase the resolution of the guest operating system, but you still cannot enable full-screen mode.

For example, in our case, the monitor resolution is 1920x1080 and the maximum resolution in Windows 10 guest configuration is 1600x1200 (the available resolution setting of the guest OS is not for widescreen displays).

If you try to enter full-screen mode by clicking View > Fullscreen Mode in the VM window or by pressing the VirtualBox host key and F combination ( Right Ctrl + F in this case), the guest operating system screen will not stretch to the size of your screen and the resolution will not be increased.

VirtualBox in full screen for Windows 10

To solve the problem

To resolve this issue and enable full-screen VirtualBox , you need to install VirtualBox Guest Additions on the guest operating system. Follow the steps below:

  • Step 1: In the VM window, go to Devices and then go a Insert Guest Additions CD Image to insert the ISO disk into the VM's virtual CD drive.

VirtualBox in full screen for Windows 10

  • Step 2: In the Windows guest system, open Windows Explorer, go to the virtual CD drive (drive D: in this case) and run the file VBoxWindowsAdditions-amd64.exe to install VirtualBox Guest Additions on the Windows 10 guest.

VirtualBox in full screen for Windows 10

  • Step 3: The Guest Additions installation process is pretty straightforward. After the installation is complete, reboot the VM.
  • Step 4: Once VirtualBox Guest Additions is installed, you may see a different set of resolution settings in the Windows 10 guest.In the VM Window menu, go to View and make sure that the option Change automatically the screen size guest is enabled.
  • Step 5: Move the pointer just over the corner of the VM window. Then, press the left mouse button and resize the VM window. The resolution of the Windows 10 guest UI is automatically changed. You can now maximize the size of the Windows 10 guest virtual machine window.

VirtualBox in full screen for Windows 10

  • Step 6: After performing the settings explained above, you can enable full-screen mode for your Windows 10 virtual machine by clicking on View > Screen Mode happens in the virtual machine window. Alternatively, you can press the combination of the VirtualBox host key and F.Right Control or the default host key in VirtualBox. So, you need to press Right Ctrl + F to enter full screen mode for a Windows 10 virtual machine.

How to make VirtualBox full screen for Mac OS X guests

After installing macOS in VirtualBox, the default screen resolution of the guest operating system is 1024x768. macOS display settings can be found in System Preferences > Display . You cannot increase the screen resolution in the display options; only 1024x768 is available in these settings.

  Remove ads on Wuolah and study without distractions

VirtualBox in full screen

Before you can increase the screen resolution for your macOS, go to VM Settings > Display and make sure the video memory amount is 128 MB and the Enable 3D Acceleration checkbox is selected (similar to the process explained earlier for the Windows virtual machine). Now let's configure the screen resolution for the macOS guest:

Step 1: Shut down your macOS VM.

Step 2: Open the command prompt on your host machine. In our example, Windows 10 is used as the host machine, therefore, we need to run CMD as administrator.

Step 3: Go to the VirtualBox directory; the default VirtualBox installation path is C :\ Program Files\oracle\virtualbox

cd «c:\Program Files\oracle\virtualbox»

Step 4: Set the required resolution using VBoxManage, a command- line configuration tool for VirtualBox. The defined resolution can be less than or equal to the resolution of your physical monitor connected to your host machine. In our case, the monitor has a FullHD resolution (1920x1080). Let's run the command on the host operating system to set the required resolution.

VBoxManage setextradata “macOSMojave10-14” VBoxInternal2 / EfiGraphicsResolution 1920×1080

If you are using Linux or macOS on a host machine, the configuration principle is similar: run VBoxManage with similar parameters.

Step 5: Power on the VM. You should now notice that the virtual machine's display resolution in the virtual machine window is higher right after powering on the virtual machine (during virtual machine boot ). When a virtual machine starts, you'll see its resolution in the macOS guest display settings. There's still only one resolution setting listed, but it's now 1920×1080 instead of the 1024×768 seen previously.

VirtualBox in full screen

Step 6 : Press the host key and F key combination. In this case, this is the right Ctrl + F key combination. Alternatively, you can click View in the VM window and select Fullscreen Mode.

VirtualBox in full screen

Your macOS guest running in VirtualBox is now running in full-screen mode. One advantage of this method is its ease of use. A disadvantage is that you must shut down the virtual machine to change the screen resolution in VirtualBox. Since the release of VirtualBox v.6.0.0, VirtualBox Guest Additions have been provided for macOS guest operating systems , whereas earlier versions of VirtualBox did not include macOS Guest Additions.

  Android Auto Not Working. Causes, Solutions, Alternatives

Unfortunately, the current version of macOS Guest Additions does not contain macOS graphics drivers to change the VM screen resolution automatically when stretching or maximizing the guest VM window. Only basic functionality is available at this time, which means that you cannot use the same method to change the screen resolution as for Windows and Linux guest operating systems running in VirtualBox after installing Guest Additions.

Final thoughts

This post has covered the basic concepts and professional-level methods to install the Guest Addition CD image to change the resolution of a Virtual Machine in VirtualBox Linux simply and manually from the terminal. Also, we have learned how to change the screen resolution size by changing the display settings of the operating system.

Using full-screen mode for a virtual machine is convenient and allows you to appreciate the advantages of hardware virtualization . This feature gives you the opportunity to use the guest operating system in a virtual machine in the same way you would use it on a host machine for high-resolution applications, large workspaces, and more.

Check out: How to Change Primary and Secondary Monitors in Windows 7 and 10

There is a method to use VBoxManage, the VirtualBox command-line management tool, to change the resolution manually. This method can be used for all available operating systems: Windows, macOS, and Linux. The disadvantage of this method is that you need to shut down the virtual machine to change the screen resolution of the guest operating system.

Use this method only if it is impossible to install VirtualBox Guest Additions on a guest operating system. Real-time automatic resolution switching when resizing a VM window or entering a full-screen mode is possible for Windows and Linux guests after installing Guest Additions.

This is a second method that is available. Unfortunately, the current version of VirtualBox Guest Additions for macOS (v.6.0.8) does not contain special display drivers to change the resolution and enter a full-screen mode in macOS guests automatically.