[SOLVED!] How to set default screen size

Discussions related to using VirtualBox on Windows hosts.
Post Reply
rsail
Posts: 22
Joined: 23. Oct 2020, 01:11

[SOLVED!] How to set default screen size

Post by rsail »

I am running windows 10 pro as the host and creating a linux mint guest. I have two monitors. Is there a way to set the default screen sizes on each monitor when I start up?
Last edited by rsail on 10. Mar 2021, 19:45, edited 1 time in total.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: How to set default screen size

Post by mpack »

The guest OS chooses the display size, not the monitor (i.e. not VirtualBox). Usually the guest will choose whatever size was used last.

If yours is constantly reverting to some unwanted default then have you actually installed the OS? Obviously a live CD variant of the OS will always use defaults.
rsail
Posts: 22
Joined: 23. Oct 2020, 01:11

unable to set default resolution

Post by rsail »

I have a two monitor setup on a windows 10 host. My vb guest is linux mint 20.1. I am running vb 6.1.18 with guest additions installed. I added these two lines to the bottom of .profile on the guest:

xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
xrandr --addmode Virtual1 1920x1080_60.00

When I startup the guest I can see the monitor size change to 1920x1080 but then it reverts back to 800x600. You can see this on the bottom of the log file. How can I get the first monitor to default to 1920x1080? I thought this specific problem was suppose to be fixed in the current vb release.

here's a link to my vb log file:

https://termbin.com/mxwr
rsail
Posts: 22
Joined: 23. Oct 2020, 01:11

Re: How to set default screen size

Post by rsail »

I believe you are incorrect. Virtualbox seems to be setting the startup resolution, hence the hint
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: How to set default screen size

Post by scottgus1 »

I merged your other topic about the settings inside the VM, since the subject is all the same. Please post your zipped log here.

Start the VM from full normal shutdown, not save-state. Run until you see the problem happen, then shut down the VM from within the VM's OS if possible. If not possible, close the Virtualbox window for the VM with the Power Off option set.

Right-click the VM in the main Virtualbox window's VM list, choose Show Log. Save the far left tab's log and the hardening log next to it, zip them, and post the zip file, using the forum's Upload Attachment tab.
rsail
Posts: 22
Joined: 23. Oct 2020, 01:11

Re: How to set default screen size

Post by rsail »

was finally able to solve this with help from the linux forum:
fth0 wrote:
Use the following command to add the missing line to the "Mint 20 VM.vbox" file:
CODE: SELECT ALL

VBoxManage setextradata "Mint 20 VM" "GUI/LastGuestSizeHint"
Then start the VM, change the display resolution, and shut down the Linux guest OS. Afterwards, the resolution will probably be remembered. You can verify this with (note the get/set difference ;)):
CODE: SELECT ALL

VBoxManage getextradata "Mint 20 VM" "GUI/LastGuestSizeHint"
Doing as they suggested and setting "GUI/LastGuestSizeHint" solved the problem and now the virtual Mint retains 1440x900 across reboots. Just thought I'd share the fix here in case anybody finds this thread and goes, "Yeah - I'm having that problem too!"
although when I did this I had to edit the vbox file directly. Be sure to change "Mint 20 VM" to the name of your *.vbox file
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: [SOLVED!] How to set default screen size

Post by scottgus1 »

Glad you found a solution!

My thought was that the Guest Additions weren't installed, and the log would show if they were or not.

Thanks for letting us know what worked for you!
Post Reply