How can I get VirtualBox to run at 1366x768?

36

9

I'm trying to run Windows 8 in VirtualBox. My laptop's display is exactly 1366x768. Windows 8 disables some of its features if the resolution is less than 1366x768, so I need to run the guest OS fullscreen.

The problem is, VirtualBox refuses to run the guest at 1366x768. When VirtualBox is "fullscreen", the guest is only 1360x768 -- six pixels too narrow. So there's a three-pixel black bar at the left and right sides of the display.

This user had the same problem, but the accepted answer is "install the Guest Additions", which I've already done; that got me to 1360, but not to 1366.

According to the VirtualBox ticket tracker, there used to be a bug where the guest's screen width would be rounded down to the nearest multiple of 8, but they claim to have fixed the bug in version 3.2.12. I'm using version 4.1.18 and seeing the same problem they claim to have fixed, so either they broke it again, they were wrong about ever having fixed it, or my problem is something else entirely.

This answer suggested giving the VM 128MB of video memory, and claimed no problems getting 1366x768 afterward. When I created the VM, its display memory was already defaulted to 128 MB. I tried increasing it to 256MB, but with no effect: the guest is still six pixels too narrow.

My host OS is Windows 7 64-bit, and I'm running VirtualBox 4.1.18.

How can I get VirtualBox to run my guest OS fullscreen at my display's native resolution of 1366x768?

Joe White

Posted 2012-06-30T19:55:21.080

Reputation: 602

Did you bother installing Guest Additions on the guest? That's one of the things it's there for. – b1nary.atr0phy – 2015-03-03T00:05:04.193

1@b1nary.atr0phy, as I said in the question: the accepted answer is "install the Guest Additions", which I've already done. – Joe White – 2015-03-03T00:19:32.123

Answers

12

After burning an entire weekend on this, I finally found the culprit: VirtualBox's 3D acceleration.

If you go into your virtual machine's Settings > Display, and uncheck "Enable 3D Acceleration", then the guest will successfully run at 1366x768.

Joe White

Posted 2012-06-30T19:55:21.080

Reputation: 602

This worked for me with Windows 10. Thanks! – Augusto Barreto – 2015-05-05T03:43:46.107

1This did not work for me, windows 10 with a server 2012 VM – Devil's Advocate – 2016-11-22T14:37:56.303

This worked for me with a Win7 guest. And so did this solution: http://superuser.com/a/586538/26903

– Stabledog – 2013-10-04T18:15:54.773

23

While the VM is running, you can also tell the guest OS to change the resolution by using:

VBoxManage controlvm "Name of VM" setvideomodehint 1366 768 32

The 32 at the end denotes the display color depth.

Der Hochstapler

Posted 2012-06-30T19:55:21.080

Reputation: 77 228

I was able to make this work, but I needed to have the virtualbox guest OS running in fullscreen mode. (Host Key (right-ctrl) - F). Then I ran the command by going to the command prompt and navigating to the virtual box folder under program files\oracle. I similarly set this under File->Preferences of the Oracle VM VirtualBox Manager. – Greg – 2015-08-12T14:10:34.207

2

@RaviDhoriyaツ This isn't work on fedora 22 kde on my laptop. But I found the solution from here https://www.youtube.com/watch?v=KCSXDjKKaQo now It works on my laptop

– Dhiren Hamal – 2015-09-02T06:26:14.443

@ANONDREN: If you could post an answer with the information from the video, that would help a lot :) – Der Hochstapler – 2015-09-02T11:18:08.540

For that you needs to issue following command: $ VBoxManage setextradata global GUI/MaxGuestResolution any $ BoxManage setextradata "Win 10" "CustomVideoMode1" "1366x786x32" Make sure that your virtualbox needs to be turn off and only after that it will works – Dhiren Hamal – 2015-09-02T11:25:11.963

@ANONDREN: I meant for you to create an actual answer on this question, not just a comment ;) – Der Hochstapler – 2015-09-02T12:04:18.983

Even with video acceleration disabled I'm getting "VBoxManage.exe: error: Code E_FAIL (0x80004005) - Unspecified error (extended info not available) VBoxManage.exe: error: Context: "LockMachine(a->session, LockType_Shared)" at line 388 of file VBoxManageControlVM.cpp" in the Win10 host in cmd – Brian says Reinstate Monica – 2018-04-23T14:55:27.680

Exact same problem here, but with a Win7 guest -- and this solution also worked. So did turning off the VirtualBox 3D acceleration as advised here: http://superuser.com/a/443733/26903

– Stabledog – 2013-10-04T18:11:28.563

2This isn't working for me, please help. I'm running ArchLinux, KDE. My VM is listed in VBoxManage list runningvms But unable to change resolution from 800x600 to 1280x1024 – Ravi Dhoriya ツ – 2014-03-24T21:13:39.237

11

I had it working by doing this:

  1. Shutdown VM

  2. Navigate to C:\Program Files\Oracle\VirtualBox\

  3. Shift + Right-Click > Open command window here

  4. Run command VBoxManage.exe setextradata "Windows 8 RTM Evaluation" CustomVideoMode1 1366x768x32

  5. Start VM

  6. Launch Desktop, Right-Click > Screen Resolution

  7. Choose 1366 x 768

But, it broke...

I updated VirtualBox and installed new Guest Additions. Now it's using "VirtualBox Graphics Adapter for Windows 8" and I cannot select a wide resolution.

Zack Peterson

Posted 2012-06-30T19:55:21.080

Reputation: 1 535

3This is the one that worked for me. Modified the commands a little for bash : VBoxManage setextradata "Windows1" CustomVideoMode1 1366x768x32 – Tejas Kale – 2015-03-30T09:07:54.827

I wondered why it wasn't working for me until I noticed it's CustomViewMode{ONE} not CustomViewMode{L}.. anyways, I ended up with setvideomodehint which did the trick at runtime – quetzalcoatl – 2017-07-12T12:13:59.367

The answer should be edited to give the bash version as well. I am happy that I read Tejas comment ! Also, it did not brake... – Dominic108 – 2020-01-06T01:16:33.207

7

I solved the same problem on Fedora 22 KDE by using following command:

$ VBoxManage setextradata global GUI/MaxGuestResolution any
$ VBoxManage setextradata "Win 10" "CustomVideoMode1" "1366x786x32"

Note that your virtualbox window should be closed.

Dhiren Hamal

Posted 2012-06-30T19:55:21.080

Reputation: 171

1This is exactly what I was looking for. Thank you very much. – Demir – 2018-08-08T12:39:53.753

1This helped me on Ubuntu 18.04 64bit for Windows 8.1 VM. – Digin Dominic – 2018-08-28T04:24:40.433

It worked on Ubuntu 18.04 64-bit for Windows 7 32-bit VM – Yuri Santos – 2019-07-09T16:32:32.877

4

Make sure that your hardware supports whatever resolution you intend to use.

Boot your Linux guest in VirtualBox and press c in the GRUB menu (it's a blue screen in Debian) and then in the grub> prompt use the vbeinfo command to check the supported resolutions by your hardware. It's in the format of 1366x768x32.

Press Esc to exit grub> prompt and proceed. Then:

  1. login to the system as root
  2. vim /etc/default/grub
  3. edit, using one of the modes supported:

    GRUB_GFXMODE=1366x768x24
    GRUB_GFXPAYLOAD_LINUX=keep
    
  4. update your Grub configuration (the command in Debian is update-grub, and in OpenSUSE is grub2-mkconfig -o /boot/grub2/grub.cfg)

  5. log out
  6. in Windows (or whatever the host OS) run this command:

    C:\>...\vboxmanage setextradata "your_guest_os_name" "CustomVideoMode1" "1366x768x32"
    
  7. reboot your guest OS

alix

Posted 2012-06-30T19:55:21.080

Reputation: 41

worked flawlessly for my debian vm on a win7 host. thanks! – danmcb – 2018-08-03T08:25:04.173

2

My issue was running Windows XP (in VB) in Ubuntu 14.04. Running that since it is the only way to connect remotely into work. ANyway, max res was 1024X800 until I did the follwoing:

  1. Under the Oracle VM VirtualBox Manager, Select the File Menu
  2. Select the Preferences option
  3. Select Display from the left hand side options
  4. Change the Maximum Guest Screen Size to HINT (From Automatic or None)
  5. Set your max pixel width and height (mine is 1440X900)
  6. CLick on OK
  7. Start up your Virtual Session

ray

Posted 2012-06-30T19:55:21.080

Reputation: 21

1

If you're using a Mac OS on your Virtual Machine, it's not possible to set the screen resolution of 1366x768.

Here are some resolutions you can use:

  • 640×480
  • 800×600
  • 1280×1024
  • 1440×900
  • 1900×1200

To set it on VirtualBox from Windows:

VBoxManage.exe setextradata "Your OS name" CustomVideoMode1 800x600

also, to set it from a Linux OS:

VBoxManage setextradata "MacOS Mojave" VBoxInternal2/EfiGraphicsResolution 800x600

Lucas Bittencourt

Posted 2012-06-30T19:55:21.080

Reputation: 11

1

I solved my problem this way:

  1. Start your virtual OS (Windows 8), while it's already running
  2. From the menu select Device
  3. Install the Guest Additions
  4. Continue until the installation finishes.
  5. Restart VirtualBox

Arash.Zandi

Posted 2012-06-30T19:55:21.080

Reputation: 111

1Yes, this question is obsolete. Just installing guest additions works. Well, I also had to go make sure that VirtualBox Manager -> Tools -> Preferences -> Display -> Maximum Guest Screen Size : Automatic is selected. Also, one should not have the physical CD/DVD mounted, because you cannot have the virtual CD for Guest additions and the physical CD at the same time. – Dominic108 – 2020-01-07T10:19:42.320

0

GO to Settings -> Display -> Scale factor (All monitors). Increase it. It will maximize the screen of os running in VM window

Prashant Kajale

Posted 2012-06-30T19:55:21.080

Reputation: 1

0

To set screen size to 1366x768 in fullscreen do this.

Steps (in command prompt):

  1. cd "C:\Program Files\Oracle\Virtualbox"
  2. StepVBoxManage setextradata “macOS name” VBoxInternal2/EfiGraphicsResolution 1366x768

Change macOS name to the name of your virtual OS

malenmon

Posted 2012-06-30T19:55:21.080

Reputation: 1

0

I figured out how the guy from Indonesia did it and managed to make it work , but on Win XP guest OS . Should probably work for Win 8 just as well .

  1. You must have the VB guest additions installed on host OS

  2. Start the VM and from the mini toolbar , right click on CD/DVD and select "Choose a virtual CD/DVD file" .

  3. When prompted , browse to VB installation folder and select the VBoxGuestAdditions.ISO

  4. Setup will start running on your guest OS and will install the VB guest additions

  5. Restart and it works even with 3d video acceleration enabled .

Mike

Posted 2012-06-30T19:55:21.080

Reputation: 1

0

I recently experienced the same problem. Fortunately, for me I was able to fix my resolution issues by using this link: https://www.youtube.com/watch?v=KCSXDjKKaQo . I followed the instructions step by step and now everything is functioning perfectly. The guy on the video is using a MAC to access the terminal which would make the changes to the screen resolution. I'm using Windows 7 to access Command Prompt (CMD). Interestly enough, the commands work on both Terminal and CMD.

As a FYI make sure to use "1366 768 32" exactly how Oliver's posting described

Hopefully this helps.

Computer Guy

Posted 2012-06-30T19:55:21.080

Reputation: 9

Thank you very much. I followed the given solution and now it works on fedora 22 kde laptop. – Dhiren Hamal – 2015-09-02T06:35:00.673

1Please include the instructions in your answer in case the youtube video is removed. – Devil's Advocate – 2016-11-22T14:42:03.897

0

Follow these instructions and you will solve your problem:

  • I am running VirtualBox 4.3.32
  • Installed OS is Windows 7

Now with the virtual machine turned off do the following:

  1. Go to the following folder of your PC: C:\Program Files\Oracle\VirtualBox
  2. Press Shift + right-click and choose "Open command prompt here".
  3. Type the following: VBoxManage.exe setextradata windows7 CustomVideoMode1 1366x768x32
  4. Replace windows7 with the name of the VirtualBox.
  5. Press Enter.
  6. Start virtual machine.
  7. Right-click on the virtual machine desktop and choose Screen Resolution.
  8. In the Resolution list you will find the option 1366 x 768.
  9. Choose 1366 x 768 and click OK.

GeorgeP

Posted 2012-06-30T19:55:21.080

Reputation: 1