In virtual box, how can I change the screen resolution from the command line? (Or if there's one for any type of computer, that might work too).

link|improve this question
1  
Do you want to do this from the host or guest command line? – CarlF Oct 11 '09 at 3:52
2  
maybe its me, but whats the OS? – Jakub Dec 21 '09 at 15:38
A thorough answer can be found here on SO: stackoverflow.com/questions/10725867/… – Dogbert May 23 at 19:57
feedback

4 Answers

If you wish to change it from within the guest:

In Windows: there are a couple tools that allow you to do this easily from the command line, notably Display Changer.

In Linux: Use xrandr -q to list available display modes, then xrandr -s # where # is the number of the display mode you wish to use. xrandr -q will display these number options next to each display option.

link|improve this answer
the 10k x 8k resolution i tried to set with display changer did have no effect on virtualbox ose 4.0.4 – cweiske Sep 7 '11 at 20:42
feedback

You can quickly "hint" the window to a specific size with the following command:

VBoxManage controlvm <uuid>|<name> setvideomodehint <xres> <yres> <bpp>

For example, if you have a guest called "Windows XP Pro", and you wish to set the resolution to 1024x600 at 32 bits per pixel (aka 32 bit) you would use the following command:

VBoxManage controlvm "Windows XP Pro" setvideomodehint 1024 600 32

There are some prerequisites for this however:

  1. This only works if you've launched the Guest OS from a windowed environment on the Host OS (ie. Windows / X Windows / Mac OS Desktop).

  2. Guest Additions must be installed in the Guest OS.

Hope this helps ;)


Jason Gaunt

link|improve this answer
VirtualBox OSE 4.0.4 doesn't let you change the resolution to larger than normal display size with that. – cweiske Sep 7 '11 at 20:45
feedback

Look inside the documentation provided with VirtualBox. The VBoxManage program gives you the ability to modify VMs from the command line. You can't do this while the machine is running, however. To do that you'll need to find a way to script the resolution change for the operating system you are virtualizing.

link|improve this answer
please note that in some cases you will have to install "guest additions" in order to properly use VBoxManage, see may question regarding a similar issue: superuser.com/questions/30924/… – Uwe Honekamp Aug 29 '09 at 8:12
feedback

$ VBoxManage setextradata "WinXP" "CustomVideoMode1" "1440x900x16"
Where "WinXP" is your virtual machine name. This solution is somewhat close to truth :)

link|improve this answer
does not work here on VirtualBox OSE 4.0.4 – cweiske Sep 7 '11 at 20:42
feedback

Your Answer

 
or
required, but never shown