share
Ask UbuntuHigher screen resolution in VirtualBox?
[+189] [30] pelms
[2010-08-28 02:18:32]
[ virtualbox resolution ]
[ https://askubuntu.com/questions/3205/higher-screen-resolution-in-virtualbox ]

I've just installed Ubuntu 10.04 into VirtualBox on Windows 7.

Unfortunately the only options showing for screen resolution are 640x480 and 800x600 and the monitor is showing as 'Unknown'.

How would I go about upping the resolution to 1280x1024 (I'm on a 1600x1200 monitor)?

Update
I tried mounting the VirtualBox 'Guest Additions' ISO (from the VBox 'Devices' menu) and doing sudo sh ./VBoxLinuxAdditions-x86.run from the mounted drive, which gave 2 new listed resolutions after a reboot (1024x768 and the 16:9 version of that resolution). These worked when I selected them but disappeared when I switched back to another resolution. I tried rebooting and running VBoxLinuxAdditions-x86.run again but onlu the 2 low res options listed this time.
I think I'm going to reinstall...

Seems to be a VBox problem rather than an Ubuntu problem as after reinstalling 10.4 overwriting the original virtual partition, sudo sh ./VBoxLinuxAdditions-x86.run now has no affect at all.

What graphics card? It may be an issue with Virtual Box in Windows 7 and/or your graphics card. It works for me on Windows XP with a Radeon HD 5750. - George Marian
If you do not use X with VBox (like me), you can use Putty to SSH. The Putty window can be sized. - user8290
[+140] [2010-08-28 02:25:28] maco

You need to install the VBox guest utilities to add support for the virtualised graphics hardware.

sudo apt-get install virtualbox-guest-utils virtualbox-guest-x11 virtualbox-guest-dkms

Previously you might have needed the "ose" versions:

sudo apt-get install virtualbox-ose-guest-utils virtualbox-ose-guest-x11 virtualbox-ose-guest-dkms

(5) No luck with that I'm afraid. I still only have the 2 low res options in Monitor Preferences :¬( - pelms
(1) even after reboot? - maco
Yep. Even tried this straight after a fresh install of 10.4 (after the updates) - pelms
(2) I think the ose tools are only useful if you're running the OSE edition of Virtualbox.. For the closed source version you should use the most recent ones that can be installed as the OP indicated. - Matti Pastell
(2) @MattiPastell I think your comment is outdated, as Oracle has merged the OSE and non-OSE versions of Virtualbox; as of version 4.0, the non-OSE components are added separately with an extension pack. See the VirtualBox website for more info - David LeBauer
After installing the guest utils I had to restart the guest OS and after that I was able to choose View > Auto-Resize Guest Display - isapir
Worked for me with ubuntu 16.4. - BugShotGG
(1) please note that for versions of Ubuntu that use the Wayland server, and no longer use X11, virtualbox-guest-x11 is not useful. - juandesant
Worked like a charm for me. I executed that command inside my guest Ubuntu OS, then restarted and Auto-resize Guest Display became available, then I had to go into Ubuntu settings to change the screen display resolution. - Johnny Oshika
1
[+55] [2010-08-28 09:20:51] Siamore

Edit: http://www.linuxformat.com/forums/viewtopic.php?p=103289

  1. Start Virtual Box and log into Ubuntu.

  2. Hit your host key(right Ctrl by default)so you can get your mouse pointer outside the virtual machine.

  3. Go to top of virtual window, click on devices then select Install Guest Additions You will see a window pop up inside Ubuntu showing you that there are some new files mounted in a virtual CDROM drive. One of those files should be VBoxLinuxAdditions.run

You must run the file with some admin permissions so do that this way...

  1. Click inside the Ubuntu screen again then go to Applications > Accessories then Terminal. The terminal window is where you will run the file from, but first we must navigate to the correct directory.

  2. Type cd /media/cdrom0 (then hit enter, there is a space after cd!)

  3. Next type dir (You should seeVBoxLinuxAdditions.run among the files displayed)

  4. Finally type sudo sh ./VBoxLinuxAdditions.run (yes, that is a full stop before the slash!)

After you hit enter and it has done its stuff, the files are now accessible from Ubuntu.

  1. You now need to reboot the virtual machine or press Ctrl+Alt+Backspace.

  2. Log onto the Ubuntu desktop and go to System > Preferences then Screen Resolution. You should now have more options than the three low resolution options you had at the beginning of the day!

If the resolution you want is not one of the newly listed ones displayed then follow these steps:

  1. Open the terminal window (Applications > Accessories then Terminal)

  2. Type sudo gedit /etc/X11/xorg.conf (case sensitive)

  3. It will ask you for a password which is the same as the one you log in with(see sudo [1]).

  4. The text editor loads and you should see a lot of text in the window. First make a backup of this file by going to File then Save as and change the filename to xorgbak.conf

  5. You now need to hunt through the text until you see the display resolutions listed. The ones you will be concerned about will be listed under bit depth 24 or bit depth 16 (as these depths are the ones that give you a large array of colors.)

  6. The idea here is to have your favorite screen resolution included in this list. Do this by either inserting it before the other listed resolutions in the exact same manner or typing it over one of the others. (you will only need to do this for the ones under bit depth 24 and 16)

  7. You must now do a "save as" but be careful here as this time we need to call the file xorg.conf again. If you just hit save here you would have overwritten the backup file you created which is not what we want.

  8. Once you have completed the previous step, you are done. Hit Ctrl+Alt+Backspace to restart your Virtual Box instance, log in and enjoy your new screen resolution options!

[1] https://en.wikipedia.org/wiki/Sudo

(4) Even if this answer might factually be correct (which I don't know), it is hardly readable and therfore will not help that much. Consider using formatting, links and so on. - Bananeweizen
Thanks Siamore. At what point do you press 'F8'? It doesn't do anything once Ubuntu has launched. - pelms
(1) Why keep marking the guy down..? How many points do you need to be able to edit the post? - pelms
@pelms no need to press F8 it should work automatically - Siamore
This does not work for me, no matter how many times I try. - Nick Heiner
@Rosarch iv'e updated the answer with a quick search result from google - Siamore
no able to find xorg.conf. - Sumit Ramteke
@sumitramteke check the answers on this question askubuntu.com/questions/73589/… - Siamore
@Siamore: thanks for the help just after reinstalling guest addtion, I clicked on Adjust window button and everything starts working properly. - Sumit Ramteke
(1) After the CD was mounted, Ubuntu asked me if I want to run it automatically. I did so, and everything was working afterwards - no need to change permissions and do things from the terminal. Thanks! - Uooo
(2) There is NO operation "Install Guest Additions" in devices. You mean "Insert Guest Additions CD" I think. You have to choose the iso by rightclick on the cd image in the right bottom corner, find BY HAND the iso in the virtualBox folder and turn it on. - Gangnus
@Gangnus that is one way, but I remember both options to be present. - Siamore
@Siamore I am afraid in the recent version 4.3 the whole system is different and your algorithm doesn't work :-( - Gangnus
fyi I know this is a Ubuntu Q&A site, but Windows appliances can have their screen sizes fixed in exactly the same way as above... in fact, much more simply - just click on the .exe in step 4 (instead of the .run file) and the rest takes care of itself. - Fuzzy Analysis
2
[+25] [2012-04-29 13:04:44] ben_nuttall

Devices > Install Guest Additions, let it run then log out.

When you've been returned to the login screen you'll see it's the full size of your monitor. Log in and you're good to go.


its as easy as u made it out to be - joshweir
(3) In version 5.1, there's no option Devices > Install Guest Additions - Josh Noe
nothing happens on Install Guest Additions - ses
nice solution.Because of this I don't have to worry from 7 years far away ;) - Menuka Ishan
3
[+19] [2012-12-29 22:38:55] XtremlyGeeky

I had the same problem and then found out that if you launch the virtual machine > click "view" on the toolbar > click "auto-resize guest display, then your virtual machine will have the same screen resolution as your own screen.


(2) I've been trying to fix that for a while. Can't believe I was missing something so obvious. Thanks man - rcbevans
(32) The auto-resize guest option is greyed out. - Ron Smith
4
[+9] [2010-09-28 12:21:32] Axel

Once the Vbox Additions has been instaled (and reboot the guest os), press Host + H, then maximise the window, thats sould do the trick..
If not, maybe you are using an old version of vbox (therefore, the Vbox Additions might has an incompatibility..)


(1) At least in the latest version of Virtual Box (4.2.16), it is [Host] + [F]. In my case, I just need to press this two times (activating & deactivating) for having Ubuntu displayed in the maximum resolution. - ComFreek
5
[+7] [2014-04-25 23:32:21] anon

Try increasing the amount of RAM allocated to the Virtual Box. Worked for me.

To do this, stop the VM, then in VirtualBox go to the Settings for the VM. Go to the Display section. You can increase the Video Memory there. Mine was 1MB; I increased it to 32MB and that allowed me to use my 24" monitor fully.


Can you provide instructions on how to do this? Please edit them into your answer. - Seth
I have added instructions to the answer, based on my own hard-won experience. - Bennett McElwee
6
[+7] [2014-06-30 11:31:46] Gangnus
  • Settings > Video > Video Memory = 128 MB, Enable 3D acceleration = true.
  • Install GuestAdditions
  • On Host machine, in cmd/bash, run

    VBoxManage setextradata global GUI/MaxGuestResolution any
    
  • create /etc/X11/xorg.conf file with content:

    Section "Device"
      Identifier      "Configured Video Device" 
    EndSection
    Section "Monitor" 
      Identifier      "Configured Monitor"
    EndSection 
    Section "Screen"  
      Identifier      "Default Screen" 
      Monitor         "Configured Monitor"
      Device          "Configured Video Device" 
      SubSection "Display"
        Modes "1920x1080" 
      EndSubSection
    EndSection
    
  • For running VM:

    Host Key Right Ctrl at default + Home = view full screen.

I have tried to exclude every step except GuestAdditions installation. You need every one of them.


What would be the file path in elementary OS Freya? - fleamour
@fleamour If your system is different from Ubuntu, I think, you should place it as a separate question and on the different site, sorry. This answer took about 6 hours. I can't even guess, how much will it take on another OS. - Gangnus
Enable 3D acceleration = true made my mouse's arrow to become invisible. - Dinei
These positions (memory, acceleration) could depend on the HW you use. - Gangnus
7
[+4] [2016-09-01 09:29:28] Agustí Sánchez

Apart from installing the Guest Additions plugin, note that the maximun display size may be capped in VirtualBox general preferences panel:

enter image description here

Also, check autoResize option and VirtualBox will automatically set the display size as you resize or maximize the window.


(1) Setting the maximum to "Hint" and then chosing reasonable values for width and height made the desktop open up in that size after a reboot. (Make sure the video memory is not too small). - MattBianco
8
[+3] [2010-09-01 15:20:51] user142

I can tell you how I do this with Mac OS X as the host system. Maybe it will work on Windows too.

  • I start ubuntu in VirtualBox
  • I open up the terminal on Mac OS X
  • and execute "VBoxManage controlvm [name] setvideomodehint 1280 1024 24" (replace [name] with the name of your ubuntu vm)

And then what do you do? Do you see the change immediately? Do you restart the VM? Do you have to click something? Is Guest Additions required first? - Volomike
I'm sorry I can't remember anymore (it's been a while) :-) - user142
Yes, the change happens immediately. - Ejoso
9
[+3] [2010-12-10 05:45:45] aneeshep

I had the same problem and was able to fix it by using the xrandr utility. I followed this article to fix the issue.

http://www.ubuntugeek.com/how-change-display-resolution-settings-using-xrandr.html

Sometimes this may help you. Give it a try.


10
[+3] [2013-01-20 07:14:31] hto

I was able to fix this problem by shutting down my VirtualBox virtual machines, quitting VirtualBox, and running this command in a Terminal:

VBoxManage setextradata global GUI/MaxGuestResolution any

Then start VirtualBox back up and the problem should be fixed!


11
[+3] [2016-01-03 14:07:36] waghso

Following command worked for me
Open Terminal and type:
sudo apt-get install dkms

Source: http://www.virtualbox.org/manual/ch04.html [1]
Restart VirtualBox

[1] http://www.virtualbox.org/manual/ch04.html#idp46608644044608

12
[+2] [2010-08-28 20:21:14] Alexey Nedilko

What driver is specified in ur xorg.conf? AFAIK, after installing guest additions the 'vboxvideo' should be used:

Section "Device"
    Identifier   "Configured Video Device"
    Driver     "vboxvideo"
EndSection

13
[+2] [2014-02-25 13:22:00] mnrl

After installing guest additions: Go to settings > Display Increase video memory and enable 2D and 3D video acceleration.


14
[+2] [2014-05-12 21:18:39] baudrunner

It is probable that your brand new install of a linux distro on your Virtualbox is still fresh and that much more needs to be done to set up your environment, not the least of which is to enable the X Window system if all that you are seeing are display settings for 4:3 aspect ratio and entering 'startx' at the command prompt does nothing.

..at your terminal prompt, enter the following:

sudo apt-get install dkms
sudo apt-get update
sudo apt-get install linux-headers-`uname -r`
sudo apt-get install --reinstall xorg
startx

If you had set your virtual machine to fullscreen mode prior to entering 'startx', then the screen will automatically adjust to 16:9 aspect ratio, with tool and task bars in their proper places.


15
[+2] [2017-04-13 12:57:42] Jan Vavra

I did this setting and all was OK:

Additional drivers


(3) Please add the relevant details here - Anwar
16
[+1] [2014-09-08 00:02:08] Steven Rice

This may have already been resolved but I had this issue and fixed it very simply, I just updated VirtualBox to the latest version then re-installed the guest additions.


17
[+1] [2014-10-23 02:08:20] user341448

VirtualBox 4.3.12 was preventing the above solutions from working on my Windows system. 4.3.18 was released somewhen around 2014/10/10 (2014 Oct 10), all of the above works since installing that.

The "VBoxManage setextradata global GUI/MaxGuestResolution any" command appeared to work previously, that is to say it didn't throw any errors.

Installing guest additions had previously complained that the header files were not installed, however they absolutely WERE (& have been left untouched) as evidenced by the fact that installing guest additions under 4.3.18 upgrade does not throw the error when building the shared folders module.


18
[+1] [2016-08-29 18:19:46] Josh Beam

Here is a 2016 updated answer that worked for me.

To start, I'm on Mac 10.11 (El Capitan), and my VirtualBox is 5.0.26. I'm running Ubuntu 14.04 LTS in this example (I need to upgrade my Ubuntu eventually).

  1. Start your VM
  2. Select "Devices -> Insert Guest Additions CD image..." (no, you don't actually need a CD, this is virtual)
  3. This will open a window asking for your root password
  4. A terminal window will open. If it asks about re-installing over a previous version of guest additions, type "yes" and hit return
  5. Restart your VM
  6. Once the VM is up and running again, go to "View -> Virtual Screen 1 -> [whichever resolution you want]".

My options were all the way from 640x480 to 1920x1200. Once I selected a new resolution, I did not have to restart the VM again, it automatically scaled.


19
[+1] [2018-03-06 04:03:42] zeko868

If none of the answers helps you fixing the issue (like it was situation with me), then verify on your Host OS that in "Screen resolution" window (Control Panel > Appearance and Personalization > Display) whether the displays are aligned and not like in picture from the following link:

Preview of settings on Host OS that caused me issue with maximum resolution on Guest OS [1]

If someone is confused because of the value of shown Display field, the reason is that I don't use Windows 7 as my Host OS, so I've used it on VirtualBox in order to simulate problem.

If you would like to use different resolution on each monitor and/or you are not sure how to align displays in previous window, clicking on "Detect" button should do things properly for you. You probably wouldn't suspect that that causes problem because, if you use Windows 7 (or any newer versions of Windows) as Host OS, it will successfully render image on your monitors, even when the set positioning is distorted as shown.

I've been struggling with this problem on many tested Guest OSs like Ubuntu, Windows XP and Windows 7 (so the issue in my case wasn't related to Ubuntu nor Linux at all) and after properly configuring that setting, I was able to choose larger desired resolution in my Guest OS (of course, you should previously install VBox Guest Additions as it is stated in several answers).

[1] https://i.sstatic.net/PB0pa.png

20
[+1] [2018-10-03 21:21:18] Frantisek Hallo

My problem/solution was actually strange, I had a another laptop/monitor with a lower resolution set up in Windows as a main display. Therefore no matter what, even if I had a max option in View/Virtual Screen 1920x1200, this time it was not checked. I am using i3 GUI , gnome behaved even more strangely. Once I configured my 4k 3840x2160 in Windows as a main monitor, VirtualBox adapted correctly. (Maybe I combine it with a lot of solution here at stackexchange and other websites.) ,but setting up the 4k display as a main display in Windows was basically a solution for me.

Note: Also previously I configured linux ubuntu resolution via command line by a process of these commands - How to set a custom resolution? [1]

otherwise a one-liner resolution appliance command line and few easy steps

eval $(cvt 2220 1250 60 |sed 's/Modeline/xrandr --newmode /g'|sed -n '1!p') what this one liner does: (1st/3 part generates dimensions, 2nd/3part uses output and replaces with xrand to create logical display, 3/3part it has on the first line comment so it starts at 2nd line)

as a proper result resolution might be afterwards reevaluated and adjusted, therefore find out the created resolution by xrand command appended in the end of output,

1) assign the resolution to a specific display -

xrandr --addmode VGA-1 "2224x1250_60.00"

2) output the desired resolution on the display

xrandr --output VGA-1 --mode "2224x1250_60.00"

[1] https://askubuntu.com/questions/377937/how-to-set-a-custom-resolution

21
[+1] [2019-01-03 11:49:22] Ersel Er

Because my reputation is not enough to add a comment for @maco's answer [1], I'm writing this as an answer.

I'm using Ubuntu 16.04 and I installed the VBox utilities as @maco's answer [2] however when I locked the screen I could not used my keyboard and mouse anymore. There is a bug report [3] about that. I found the solution here [4] and totally it took me 2-3 hrs.

I hope it helps for whom having the same issue :)

[1] https://askubuntu.com/a/3206/910043
[2] https://askubuntu.com/a/3206/910043
[3] https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1630245
[4] https://askubuntu.com/questions/908918/updated-from-16-04-to-16-10-the-keyboard-and-mouse-no-longer-works-after-gettin

22
[+1] [2019-08-04 00:50:39] Nigel Yong

The scale factor in the virtual machine settings did the trick for me. I set it from 100% to 200%.

enter image description here

Note: I have a Huawei Matebook X Pro.


(1) I don't understand why the only correct answer didn't have any upvotes - Positive Navid
(1) @NavidVafaei I was late to the party haha. - Nigel Yong
23
[+1] [2021-04-25 01:41:13] Ed'ka

It took me quite a while to finally make it work (I think it was installation of VirtualBox Guest Additions [1] and VirtualBox Extension Pack [2] which did the trick for me eventually) but before I managed to make it work I was just using Remote Desktop to connect from my Linux host to Windows guest. I used Remmina [3] (RDP protocol) and by just selecting Use client resolution option I got my host system native resolution straight away.
I still like this approach actually: you can start VM in a headless mode and it just feels... lighter, but the drawback of this method is that the video throughput via RDP connection, at least in my case, is substantially lower than when using native VirtualBox window, though it is noticeable only when you try to do GPU-intensive things like playing HD videos, I don't see much of a difference otherwise. I did try to improve Host <-> Guest network connection performance using dedicated Host Only network [4] with virtio [5] network adapter but I guess the bottleneck is probably somewhere in FreeRDP [6] implementation.

Still Remote Desktop could be a quick solution for someone who is struggling to make it work and needs native host resolution in Guest VM.

[1] https://www.virtualbox.org/manual/ch04.html
[2] https://www.virtualbox.org/wiki/Downloads#VirtualBox6.1.20OracleVMVirtualBoxExtensionPack
[3] https://remmina.org/
[4] https://www.virtualbox.org/manual/ch06.html#network_hostonly
[5] https://www.virtualbox.org/manual/ch06.html#network_performance
[6] https://www.freerdp.com/

24
[+1] [2021-05-28 03:28:24] jrasor

Running Mint 20.1. Got a VM to resize with bigger resolution. Here’s how:

1. Ran VirtualBox. Got the Oracle VM VirtualBox Manger. 
2. Made a new VM “Virtual Mate”. Type: Linux. Version: Ubuntu 64 bit. 
3. Gave it 8192 GB memory. 
4. Virtual hard disk. VDI. Dynamically allocated. 20 GB. 
5. Settings – Display – gave it 128 MB. 3D acceleration for the VMSVGA. 
6. Settings - Storage – attached the Mate iso.
7. Ran it. Immediate installation, erase and install. Done. 
8. Restarted. To “Remove the installation media”, just hit Enter. Logged in.
9. Closed the VM window, and saved this machine state. 
10. Ran it. Devices – inserted guest additions CD – did the autorun. 
11. It wanted the restart; did that. Logged in. 
12. Resized with resolution change worked. 

It won’t resize until you’ve logged in.


This might also apply to Ubuntu, but Linux Mint is not in itself on-topic here. - Artur Meinild
25
[+1] [2021-07-26 23:46:25] Matthew Kirkley

The issue for me was virtual box additions were not installed. I thought I install them however it actually failed because GCC and Perl and Make were not installed. Before you install the virtual box additions run the following (in ubuntu)

sudo apt-get install gcc make perl

Then install guest additions like described in previous posts


26
[0] [2021-05-22 11:17:24] shay

All I had to do was go into the guest OS's display settings and change it to maximum resolution. (Make sure in the VirtualBox settings that you don't have it set to a maximum width of about 600px).

View image here


27
[0] [2022-07-10 12:40:44] noobzilla

Setup: I am using an Ubuntu VM in VirtualBox on a Windows host

VirtualBox has a feature called "Scaled Mode" (View > Scaled Mode) - When enabled, it allows you to simply drag and resize the window. However, this does not change the resolution of the window (you will find the icons and text to be a little blurry). To actually change the resolution you must install the GuestAdditions software.

You can read about GuestAdditions in the official VirtualBox docs: https://www.virtualbox.org/manual/ch04.html

From the above documentation: The Oracle VM VirtualBox Guest Additions for Linux are provided on the same virtual CD-ROM file as the Guest Additions for Windows. See Section 4.2.1.1, “Installing the Windows Guest Additions”.

TIP: I followed all of the steps above, but found that the window was not resizing when I dragged it. I then clicked on the CDROM icon (GuestAdditions was still mounted) and just right clicked the autorun.sh file and selected "Run as program" - This seemed to do the trick in terms of actually installing it. Rebooted again and this time I was able to drag the window and found that it would actually change the resolution.


28
[0] [2023-06-29 02:07:26] Adam

Version 7.0.0 of VirtualBox, along with the Guest Additions Extension Pack should do the trick, just run this command:

sudo apt-get install virtualbox-guest-utils virtualbox-guest-x11

and then click Devices > Install Guest Additions CD Image and reboot.

https://www.virtualbox.org/wiki/Download_Old_Builds_7_0


29
[0] [2023-08-29 15:53:43] funder7

I'm on Pop!Os with Wayland and VirtualBox 7.0.10.

In order to enable screen resolution, I've installed the following packages:

sudo apt-get install virtualbox-guest-utils virtualbox-guest-x11

Now download the right guest additions iso for your vbox version:

(mine) https://download.virtualbox.org/virtualbox/7.0.10/

Start the VirtualBox image, and from the "Devices" menu select insert image of guest additions cd iso.

It will reboot after the setup is completed.

You should be able to select a new resolution in the "Visualize" > "Virtual screen 1" menu (translation may be different, anyway it can be accessed from the monitor icon in the bottom right corner, where all vbox interfaces are displayed).


30