19

I was required to develop a Windows app UI for a fixed resolution - it doesn't matter if it makes sense or not, the customer requires it. I'm using a Windows Server 2003 VirtualBox VM as the development environment; my host machine has much higher resolution.

Is there any way to select and fix the OS resolution and stop VirtualBox changing it by any kind of scaling? I can't see the requested resolution when I open Display Properties on the guest OS.

Hennes
  • 65,804
  • 7
  • 115
  • 169
Random
  • 435

7 Answers7

11

So I tried this, and might work for you. Under the Machine menu, there is an option to auto-resize the guest OS's resolution to fit the monitor you are using. I got the resolution you did by enabling this option, manually resizing the window to get the resolution I wanted, then DISABLING auto-resize. Then, it's "stuck" there and I can resize the window, move it around, resolution doesn't change. Only problem was the taskbar. While you are doing the resize, might help to minimize it to get the exact resolution

Camron B
  • 761
10

For my setup, neither CustomVideoMode1 nor setvideomodehint nor MaxGuestResolution worked. So, I looked up

vboxmanage getextradata $YOUR_VM_NAME enumerate

and changed

Key: GUI/LastGuestSizeHint, Value: 800,600

to

Key: GUI/LastGuestSizeHint, Value: 1920,1080

with

vboxmanage setextradata $YOUR_VM_NAME GUI/LastGuestSizeHint 1920,1080

6

While the VM is running, define your custom resolution using this command:

vboxmanage setextradata "[VM NAME]" CustomVideoMode1 1600x900x32

While the VM is running, execute the following command to switch to your new resolution:

vboxmanage controlvm "[VM NAME]" setvideomodehint 1600 900 32

It should switch to the new resolution immediately.

For this to work you must have VirtualBox Guest Extensions installed in the VM.

5

Try installing Guest Additions. It provides lots more features to the guest OS. From there, you can leverage the resolution you want and lock the screen in that position.

Camron B
  • 761
4

Even with Guest Additions installed, my remote Windows is not able to give me my wished 1920x1080 so I used this solution

vboxmanage startvm "mymachine";vboxmanage controlvm "mymachine" setvideomodehint 1920 1080 32
Mokubai
  • 95,412
krisofe
  • 41
3

I was having the same problem as described above nothing was working even the manual setting of screen resolution, I solved my problem with checking some things:

  1. In VirtualBox Manager GUI checked my OS version: I have chosen Windows 8.1 64 bit, but guest OS was 32 bit which, was the main problem
  2. Solution: new machine with win 8.1 32 bit OS and linked to an old virtual hard drive
  3. Setting machine custom resolution with VBoxManage command line

    VBoxManage.exe setextradata "[Virtual Machine Name]" CustomVideoMode1 1366x768x32
    
Jens Erat
  • 18,485
  • 14
  • 68
  • 80
Bastian
  • 31
2

From with Vagrant file - see the last line with LastGuestSizeHint, I had to escape the slash after GUI in order for this to work:

Vagrant.configure("2") do |config|
    config.vm.box = "codeup/Ubuntu-20.04-GUI"
    config.vm.provider "virtualbox" do |vb|
        vb.gui = true
        vb.name = "Eclipse"
        vb.memory = 2048
        vb.cpus = 2
        vb.customize ["modifyvm", :id, "--vram", 256]
        vb.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
        vb.customize ["modifyvm", :id, "--draganddrop", "bidirectional"]
        vb.customize ["setextradata", :id, "GUI\/LastGuestSizeHint", "1920,1080"]
    end