VirtualBox

Opened 12 years ago

Last modified 9 years ago

#10860 reopened enhancement

Full resolution not exposed to Linux guest

Reported by: dsvensson Owned by:
Component: GUI Version: VirtualBox 4.1.20
Keywords: retina hidpi Cc:
Guest type: Linux Host type: Mac OS X

Description

When using VirtualBox on a MacBook Pro Retina, only half the resolution is exposed to, at least, Linux guests. This causes the fonts to be blurry in the guest OS.

To verify this, install Linux, and go to fullscreen, type xrandr and notice the resolution is set to 1440x900.

To compare with VMWare, full Retina mode is supported: http://www.vmware.com/products/fusion/features.html#approved

This exposes the current full resolution to the guest, which in the default host retina mode would mean the guest sees 2880x1800 resolution and has to deal with it on its own accordingly.

Attachments (5)

VBox.log (58.5 KB ) - added by tdy 10 years ago.
VBox_log_fullscreen_on_2560x1600mbp.log (61.7 KB ) - added by GabrielCox 10 years ago.
VB 4.3.4 Win XP Guest Full Screen @ 1280x800 on 2560x1600 Mac
rmbp13_vbox.log (113.6 KB ) - added by chrisb 10 years ago.
VBox.2.log (69.9 KB ) - added by pippijn 10 years ago.
VirtualBox VM 4.3.10 r93012
VBox.3.log (87.9 KB ) - added by user1024 9 years ago.
VBox 4.3.18, Fedora 20

Download all attachments as: .zip

Change History (43)

comment:1 by dsvensson, 12 years ago

The VirtualBox version is actually the 4.2 beta but it couldn't be selected.

comment:2 by Frank Mehnert, 12 years ago

Right, and the RC page asked to report Beta / RC bugs in the forum!

comment:3 by Frank Mehnert, 12 years ago

Resolution: duplicate
Status: newclosed

And actually this problem was already reported before, see #10848.

comment:4 by dsvensson, 12 years ago

I've seen #10848 but that only describes the host UI issues which have been fixed (at least the hidpi-flag in Info.plist) in the 4.2 beta. This issue is about exposing the 1-1 resolution to the guest OS.

And as for beta/rc bugs in the forum, this issue applies to the latest released version as well.

Last edited 12 years ago by dsvensson (previous) (diff)

comment:5 by dsvensson, 12 years ago

Resolution: duplicate
Status: closedreopened

comment:6 by tdy, 11 years ago

Any update on this? I'm still getting 1440x900 res in Linux with the guest additions installed.

comment:7 by Frank Mehnert, 10 years ago

Resolution: fixed
Status: reopenedclosed

If this is still a problem with VBox 4.3.2, please reopen this ticket. In that case, please attach a VBox.log file of a VM session running on VBox 4.3.2 with 4.3.2 Guest Additions installed.

by tdy, 10 years ago

Attachment: VBox.log added

comment:8 by tdy, 10 years ago

Resolution: fixed
Status: closedreopened

VBox.log is attached for VBox 4.3.2 with 4.3.2 Guest Additions installed, vboxguest/vboxsf/vboxvideo modules loaded, and VBoxClient-all executed.

The highest exposed resolution from xrandr is still 1440x900.

Last edited 10 years ago by tdy (previous) (diff)

comment:9 by stevenleeg, 10 years ago

Same issue for me, I'm only able to set the resolution to 1440x900 on the 15" Retina MBP.

comment:10 by demmeln, 10 years ago

It would be great to see if this is being worked on, or what exactly the issue is.

comment:11 by Frank Mehnert, 10 years ago

I would like to see more VBox.log files from VM sessions where this problem manifests. So far we are unable to reproduce it.

comment:12 by GabrielCox, 10 years ago

Same here VBox 4.3.4 on a 13" Macbook Pro Retina with 2560x1600 resolution.
Guest (Win 7 w/128MB VRAM) shows up as 1280x800 when full screen.
Info.plist has the following key set: <key>NSHighResolutionCapable</key> <true/>
Additional Log Attached.

Last edited 10 years ago by GabrielCox (previous) (diff)

by GabrielCox, 10 years ago

VB 4.3.4 Win XP Guest Full Screen @ 1280x800 on 2560x1600 Mac

comment:13 by GabrielCox, 10 years ago

Correction on last attachment labeled VBox_log_fullscreen_on_2560x1600mbp.log: The Guest OS is Win7-64, not WinXP

by chrisb, 10 years ago

Attachment: rmbp13_vbox.log added

comment:14 by chrisb, 10 years ago

rmbp13_vbox.log shows a 13" MBPR with Virtualbox reporting a fullscreen max resolution of 1280x800 - possible guilty line:

01:05:03.646244 VMMDev::SetVideoModeHint: got a video mode hint (1280x800x0)@(0x0),(1;0) at 0

It ought to be easy to reproduce - this is a completely clean install of debian-7.4.0-amd64-xfce-CD-1.iso with guest additions installed following the instructions.

comment:15 by Armada651, 10 years ago

@frank I think you may be misunderstanding the issue because you should have no trouble reproducing it.

On Mac OS X retina displays 1 pixel is normally scaled up to 4 pixels for application which do not support high dpi. Qt has a nice article explaining the problem: https://blog.qt.digia.com/blog/2013/04/25/retina-display-support-for-mac-os-ios-and-x11/

VirtualBox already supports high-dpi for much of the UI, but not for the guest display. It seems it uses the device-indepedent pixels (1px = 4px) instead of the physical pixels (1px = 1px). This results in much lower image quality as everything is scaled by a factor of 4.

by pippijn, 10 years ago

Attachment: VBox.2.log added

VirtualBox VM 4.3.10 r93012

comment:16 by pippijn, 10 years ago

I can confirm this happens on the latest VirtualBox 4.3.10 r93012. I attached another VBox.log.

comment:17 by pippijn, 10 years ago

Update: it also still doesn't work on 4.3.14.

comment:18 by ejan, 9 years ago

Same issue in the latest release: 4.3.18. Is this issue being worked on at all?

by user1024, 9 years ago

Attachment: VBox.3.log added

VBox 4.3.18, Fedora 20

comment:19 by user1024, 9 years ago

Same issue. The VirtualBox guest sees the MacBook's resolution (in my case) as 1280x800 when it is actually 2500x1600.

Steps to notice/reproduce on MacBook Pro Retina 13", as mentioned in the original bug:

  • Install any Linux version with graphics (e.g. Fedora or Ubuntu). Install Guest Additions.
  • Start the VM and log in.
  • Go to View->Switch to Fullscreen if not there already. You can also try maximizing the window and going to View -> Auto-resize Guest Display.
  • in a terminal, run xrandr.

Output for me says the current resolution is 1178x735. (In the past I've gotten more usually 1280x800).

I attached a VBox.log with Fedora 20 where I followed the above steps, except I was already in fullscreen mode from bootup. I also had my VirtualBox Display Preferences set to Hint, Width=2500, Height=1600. You can see in the log that VBox thinks it's switching to the native fullscreen resolution, which it thinks is only 1200x800 or thereabouts.

comment:20 by user1024, 9 years ago

Has anyone tried rebuilding from source after changing the Info.plist files to enable high-dpi mode, as in the link posted above by Armada?

comment:21 by pt__, 9 years ago

This is very easy to reproduce.

You need a Retina MacBook Pro running e.g. OS X Yosemite. Do not plug into an external monitor -- use only the built in LCD. Go to "System Preferences -> Displays" and choose "Best for display".

Start a virtual machine (e.g. Ubuntu 14.10) and set it to full screen. Look carefully at some text in the guest. It is scaled at 2x (and therefore slightly blurry).

The issue is explained in comment 15.

The developer guidelines for fixing this are probably somewhere in here:

https://developer.apple.com/library/mac/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/CapturingScreenContents/CapturingScreenContents.html#//apple_ref/doc/uid/TP40012302-CH10-SW1

Last edited 9 years ago by pt__ (previous) (diff)

comment:22 by Klaus Espenlaub, 9 years ago

Type: defectenhancement

Sorry, but you're essentially complaining that VirtualBox follows Apple's guidelines (with the mentioned "Best for display" setting the logical screen resolution is half of the physical screen resolution in both directions). It assumes that the guest OS has no HiDPI support, which is true for the vast majority of the candidates. If it would do 1:1 pixel representation then everything would be displaying many VMs in an unusably tiny way.

VirtualBox really listens to the OSX settings. If you want to try: pick "Scaled / More Space", then you'll get a much smaller VM window (simulating full HD resolution). For my eyes the default font size in a Windows 7 VM is already too small. 1:1 pixels are not offered by Apple, you need 3rd party tools to do that, and then everything becomes super tiny.

What you're asking for is a new feature: allowing customizable, additional scaling.

comment:23 by pt__, 9 years ago

Sure, let's say it is a feature.

I don't think the current behaviour is "correct" though. I would say it is *very* bad behaviour to not have an option. Windows, Ubuntu and OS X *all* provide HiDPI support. It is not possible to make use of this support using VirtualBox (without making OS X unusable, which is obviously not a real fix). VMWare and Parallels both provide support for this (obviously). Until then, I would say that VirtualBox simply does not have support for HiDPI. The only real option for VirtualBox on OS X is to have blurry guests *or* 1:1 tiny pixels on OS X (i.e. make OS X unusable, despite OS X having good support for HiDPI) and normal (HiDPI) guests (as you said).

Since many popular guest OS's support HiDPI, I would say that VirtualBox is *not* following the Apple guidelines -- the scaling approach is a last resort when there is no better option, but there clearly is a better option for the majority of guest OS's.

in reply to:  22 comment:24 by user1024, 9 years ago

Replying to klaus:

What you're asking for is a new feature: allowing customizable, additional scaling.

Happy to call it a feature request rather than bug fix, but a very important one on this platform in my opinion. The blurry experience is not ideal. As originally stated other VM applications have this feature, so it would be really nice to add.

Thanks for the attention to the issue.

comment:25 by iamthealex, 9 years ago

I will start out by saying that VirtualBox is a wonderful piece of s/w. Thank you. However, I believe it can be made even better by taking full advantage of a MacBook Pro retina display like VMWare does.

I see lots of technical back and forth in this ticket, and I don't care if it's a feature request or a bug report or whether or not VirtualBox is following the spec properly or not. I just want the same resolution in my Linux guest as I see on my MacBookPro Host which has a retina display. For example, a shell on my MBP has much better resolution than a shell on my VirtualBox Linux guest.

comment:26 by SpacemanSpiff, 9 years ago

I have recently upgraded my VBox installation, but it has not fixed the low-resolution problem with my Retina MBP.

Here are the details of what I've tried:

Host: Early 2013 MBP Retina; OSX 10.9.5 (Mavericks); VBox 4.3.20.96996

Guest: Windows 7 Ultimate (fully updated); VBox Guest Additions 4.3.20.96996;

I have played around with various installation and host configurations, with no success. This includes: Simple upgrade of VBox (from 4.2.x to 4.3.19) w/ Guest Additions Installation on host. Complete removal of VBox via AppCleaner, then install 4.3.20 & import Win7 guest. Install VBox Guest Additions 4.3.20 with & without 3D support. Win7 with & without Aero mode active. Guest in Windowed/Scaled/FullScreen/Seamless Mode.

I should note that I am trying to avoid installing a resolution switcher, or accessing the guest via RDP.

Other than what is listed here, I haven't specialized my VBox installation in any way. Nothing seems to get me past 1440x900.

Is there some other procedure or configuration that I have missed?

-thanks

Last edited 9 years ago by SpacemanSpiff (previous) (diff)

comment:27 by MJD, 9 years ago

I have the exact same experience that SpacemanSpiff has. My system specs are exactly the same too. I am trying to avoid installing a resolution switcher as a separate application should not be required to utilize a VM in fullscreen at full resolution or with HiDPI.

I also share the same opinion as iamthealex.

So my question is:

Has the Guest HiDPI Support "feature" been added to the road map? Will it be available in the next release?

This has my vote! +1

Thanks!

comment:28 by pt__, 9 years ago

This issue is still present. VirtualBox is blurry on retina displays.

comment:29 by pt__, 9 years ago

Actually, it looks like the code to support this is already in trunk. Could a developer review this code (using (only) their built-in Retina display)? And perhaps step through it with a debugger.

In particular, could you check whether the "dBackingScaleFactor" value is > 1.0? And whether the if statements take the expected branches? (looks a bit contradictory)

// http://www.virtualbox.org/svn/vbox/trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp
// ..

void UIFrameBuffer::eraseImageRect(QPainter &painter, const QRect &rect,
                                   bool fUseUnscaledHiDPIOutput,
                                   HiDPIOptimizationType hiDPIOptimizationType,
                                   double dBackingScaleFactor)
{
    /* Prepare sub-pixmap: */
    QPixmap subPixmap = QPixmap(rect.width(), rect.height());

    /* If HiDPI 'backing-scale-factor' defined: */
    if (dBackingScaleFactor > 1.0)
    {
        /* Should we
         * perform logical HiDPI scaling and optimize it for performance? */
        if (!fUseUnscaledHiDPIOutput && hiDPIOptimizationType == HiDPIOptimizationType_Performance)
        {
            /* Adjust sub-pixmap: */
            subPixmap = QPixmap(rect.width() * dBackingScaleFactor,
                                rect.height() * dBackingScaleFactor);
        }

#ifdef Q_WS_MAC
# ifdef VBOX_GUI_WITH_HIDPI
        /* Should we
         * do not perform logical HiDPI scaling or
         * perform logical HiDPI scaling and optimize it for performance? */
        if (fUseUnscaledHiDPIOutput || hiDPIOptimizationType == HiDPIOptimizationType_Performance)
        {
            /* Mark sub-pixmap as HiDPI: */
            subPixmap.setDevicePixelRatio(dBackingScaleFactor);
        }
# endif /* VBOX_GUI_WITH_HIDPI */
#endif /* Q_WS_MAC */
    }

    /* Which point we should draw corresponding sub-pixmap? */
    QPointF paintPoint = rect.topLeft();

    /* Take the backing-scale-factor into account: */
    if (fUseUnscaledHiDPIOutput && dBackingScaleFactor > 1.0)
        paintPoint /= dBackingScaleFactor;

    /* Draw sub-pixmap: */
    painter.drawPixmap(paintPoint, subPixmap);
}

comment:30 by samuelparks, 9 years ago

+1 - would love to see this supported soon

comment:31 by df, 9 years ago

eta for this? i'm about to switch to vmware...

comment:32 by stianstrips, 9 years ago

I would also like to see this feature implemented. Having access to the raw hardware, in this case full screen resolution is a good thing. Need not be default setting.

comment:33 by socalstudent, 9 years ago

+1 - This would be an excellent feature to support. Might the above trunk code make its way into the VirtualBox 5 release or future betas?

comment:34 by greatpatton, 9 years ago

This is really needed as Virtualbox VM on a Mac are graphically awful.

comment:35 by Jzee, 9 years ago

Waiting for the same to see....:)

comment:36 by tmancill, 9 years ago

another +1, the graphics really are gross right now...

comment:37 by Frank Mehnert, 9 years ago

The current VirtualBox 5.0 RC1 code contains the code mentioned in comment 29. So everyone is welcome to test 5.0 RC1 and share their findings in our Beta Forum.

comment:38 by andreasfrom, 9 years ago

VirtualBox 5.0 RC2 with "Use Unscaled HiDPI Output" on, reports an incorrect resolution to the Linux guest. My MacBook has a resolution of 2560x1600, but the Linux guest sees 2880x1800. Manually setting the Linux resolution to 2560x1600, my native resolution, means the guest doesn't fill the whole screen.

Edit: Realised too late, that I shouldn't have posted here (sorry). Link to the Beta Forum: https://forums.virtualbox.org/viewtopic.php?f=15&t=68658

Last edited 9 years ago by andreasfrom (previous) (diff)
Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use