So I've installed Ubuntu inside of Virtualbox, and I resized the window of Virtualbox to be full-size, but the Ubuntu Desktop stays the same standard size. How do I make the width of Ubuntu stretch 100% across the Virtualbox window?
-
If you don't have X (i.e. you only installed server) and don't want to install it, you need to change the resolution for grub - see those instructions here: http://askubuntu.com/q/54067/247661 – Aaron Hall Feb 12 '16 at 20:46
4 Answers
Inside the virtual machine, install the virtualbox-guest-dkms
, virtualbox-guest-utils
and virtualbox-guest-x11
packages. These "guest additions" include a video driver that will do what you ask, plus a mouse driver that interacts with the host system so you don't have to use the host key to "uncapture" the mouse; it just works when you're on the virtual machine's window.
There are 2 ways to do this:
From the VirtualBox top menu choose Devices, Install guest additions, then wait for a mock-CD ROM to appear and run the install from there, or
just type
sudo apt-get install virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11
(personal recommendation: the second (apt-get) option is very simple and quick).
-
Fantastic. I was in the process of installing the Guest Additions via the link in Virtualbox when you wrote this. However, I believe I watched as those packages were installed as well. I appreciate your help. – willbeeler Feb 15 '12 at 15:31
-
11+1 - thanks! It seems that just
sudo apt-get install virtualbox-guest-dkms
is required as that automatically installs the utils and x11 packages. – Mark Whitaker Aug 27 '13 at 10:34 -
This tip is really helpful. On 14.04 trusty fails to load screen vbox screen resolutions. Installing the applets fixes the bug and the X server behaves like XP inside virtualbox. – user43787 Feb 20 '14 at 08:01
-
1Also note you have to give enough video RAM (more than 17 MB) to have this work – Claudiu Jul 17 '14 at 19:28
-
Also note that, as of the newer versions (14.04), ubuntu supports mouse and keyboard capture without any guest additions. But display is still in question. – C-- Aug 29 '14 at 07:11
-
2Even though your answer is OLD, it still works to fix the resolution problem TODAY.... I have tried all the other options suggested by others in here and on the Internet and did not work at all... Thank you so much....... – ThN May 13 '15 at 05:44
-
Tried solution #2 with Ubuntu 14.04 running on top of OSX 10.10. The install of virtualbox-guest-x11 using
apt-get
failed with unmet dependencies. Usingaptitude
instead ofapt-get
installed the package, but removed a bunch of files so that the desktop no longer appears. – Craig S. Anderson Dec 03 '15 at 22:07 -
With 14.04 also, I ran the apt-get and already had the updates. Then went in to "System Settings"->"Displays" and selected the resolution there. Now resizing works - thanks! – michaelok Apr 05 '16 at 15:41
Shutdown your virtual box and in a terminal shell type the following command
VBoxManage setextradata global GUI/MaxGuestResolution 1366,768
the 1366,768 is just what i have set for my screen resolution on my laptop, change this to whatever your current resolution is on the machine your running. This should maximize all screens to full 100% on all guest os's

- 1,302
-
-
I tried everything else, no luck. But this answer worked perfect. Nice answer :) TX :) – antmw1361 Dec 11 '14 at 11:18
-
Just to add value to this answer, if you are using Vagrant, instead of the using the setextradata VBoxManage command, you can indirectly call it from the Vagrant file like so (see the second vb.customize):
– George Smith Oct 08 '22 at 06:04config.vm.provider "virtualbox" do |vb| vb.gui = true vb.customize ["setextradata", :id, "GUI\/LastGuestSizeHint", "1920,1080"] end
Once you have installed the VirtualBox Extension Pack (scroll until you see the Extension Pack section) use host+G or the menu option under View > Auto-resize Guest Display.
NOTE: The Extension Pack version must match the version of VirtualBox.

- 1,452
- 17
- 18
Using Ubuntu inside VirtualBox on Win7 you need to reboot Ubuntu after the virtualbox-guest-dkms
install before resizing would work.

- 13,227
- 26
- 81
- 128

- 171
- 3
-
1Actually, the guest additions installer itself ask the user to reboot, no matter what host is involved. Without rebooting the screen won't re-size. – Luís de Sousa Feb 18 '14 at 19:21
-
6I wasn't asked to reboot after installing guest additions via apt-get. Couldn't resize to full screen until I rebooted the guest system. +1 (host: Win 7; guest: Ubuntu 14.04 LTS) – km1 Jul 02 '14 at 19:40
-
2
-