general/other MacOS Parallels Desktop install FreeBSD 13 guest, "gop list" wrong detection in bootloader

Hi guys, I'm trying to switch my daily OS from Linux to FreeBSD, for development purpose (Rust, NodeJS, etc). So the best try for me is running in VM.

Everything is fine so far, except the one that always is a problem for many newbies: the BSD X resolution (my Linux guest X resolution is fine without any problem).

So, here is what I've done so far, before coming here to ask questions:

- Read https://docs.freebsd.org/en/books/handbook/x11/#x-config

- man loader and man loader.conf

- Check wiki about GOP (Graphics output protocol) and VBE (VESA BIOS Extensions)

- Of course, spent a few hours of research on this forum


Then here are the things I figured out:

- x11-drivers/xf86-video-scfb driver should be used in Parallels Desktop virtual environment, as I use vm.bios.efi=1 boot flag for the FreeBSD guest

- But the scfb(4) max resolution is limited by the efi_max_resolution settings in the /boot/loader.conf


So, here is the question:

gop list in boot loader can't show any resolutions that are higher than 1920x1200 (screenshot attached), that's why efi_max_resolution=2560x1600 doesn't work at all.

But if I remove the vm.bios.efi=1 boot flag and boot the VM again, I can get up to 5K resolution prints out. Of course, I still can't get 4K or 5K resolution works even if I change to using `VESA` drive. but let's solve problems one by one: The gop list problem first:)

Based on what I've learned so far, GOP basically has the same functions as VESA: Query the modes and set the modes. And the mode (resolution) info should come from the video driver (no matter x11-drivers/xf86-video-scfb or x11-drivers/xf86-video-vesa).

But why gop list can't get the same list as vbe list???

Could anyone help me with this, please? (if you know more please tell more, I prefer to know how it works in the detail, many thanks)
 

Attachments

  • gop-command.png
    gop-command.png
    75.5 KB · Views: 120
  • vbe-command.png
    vbe-command.png
    163.2 KB · Views: 118
This post is one of about a dozen I reviewed while trying to figure out how to get the resolution higher than 1440x1050 on my FreeBSD guest. It took me forever, but I've now got 1920x1200–the highest supported mode, since Parallels won't port their drivers.

Here's what ended up working for me (Parallels for Mac Pro 18, FreeBSD 13.2 RELEASE, macOS 13.4):

1. Forget about scfb. If you look at the Xorg logs, the vesa driver always takes over because it is able to probe the monitor for its modes and capabilities, etc. using DDC. This entire issue boils down to:
  • Matching the ModeLines the vesa driver obtains from your virtual monitor with ones supported by the driver;
  • Creating an Xorg configuration that has the physical size of your real monitor, a virtual size, and matching ModeLines;
  • Having the right loader configuration.
2. The contents of /boot/loader.conf:

Code:
screen.textmode=0
screen.height=1080
screen.width=1920
screen.depth=24
load_vesa="YES"
vbe_max_resolution="1920x1080"

This man page is an excellent source of information on the loader config. Essentially what the above does is: enables vbe from within the loader, and immediately sets the console resolution--before the boot menu. It will go as large as your physical monitor is; I tried "5k" for vbe_max_resolution and it resized to 5k on my iMac Pro. However, the console output itself is constrained to about 1080p-ish, so there's no reason to go much higher than that before the graphical level is even reached during boot-up.

3. Find out the PCI bus ID of your virtual display:

pciconf -lv | grep -B3 display should give you something like this:

[ryan@pricey /usr/local/etc/X11/xorg.conf.d]$ pciconf -lv | grep -B3 display
vgapci0@pci0:1:0:0: class=0x030000 rev=0x00 hdr=0x00 vendor=0x1ab8 device=0x4005 subvendor=0x1ab8 subdevice=0x0400
vendor = 'Parallels, Inc.'
device = 'Accelerated Virtual Video Adapter'
class = display

Make note of the part in bold, so you can use it in the Xorg config.

4. Run the X server with your current configuration, then switch tty or exit the server and do cat /var/log/Xorg.0.log | less. Scroll down until you find a section that looks like this:

(II) VESA(0): Printing DDC gathered Modelines:
(... a bunch of ModeLine output here)

Stop there, and make note of the highest resolution (just the X/Y) down to the lowest one you'd accept (I ended up with four).

Now, for each of the resolutions you took note of, run: gtf X Y 60 where 60 is the refresh rate you want. The output will be ModeLines that you can directly copy/paste into your Xorg config file. Copy all of those lines and save them aside.

5. Xorg configuration. I broke mine up into several different .conf files in /usr/local/etc/X11/xorg.conf.d, but I'm going to combine them into one here, since it won't make a difference. Just save the following as a `.conf` file in that directory and it should Just Work (TM):

Code:
Section "Device"
        Identifier  "Card0"
        Driver      "vesa"
        BusID       "PCI:1:0:0" # the value from earlier, but just the last 3 digits
EndSection

Section "InputDevice"
    Identifier  "Mouse0"
    Driver      "evdev"
EndSection

Section "InputDevice"
    Identifier  "Keyboard0"
    Driver      "evdev"
EndSection

Section "Screen"
    Identifier  "Screen0"
    Device      "Card0"
    Monitor     "Monitor0"
    SubSection  "Display"
        Depth   30             # the real depth of the host's monitor.
        Virtual 1920 1200 # the target highest target resolution.
        Visual  "TrueColor" # this has to be in quotes. link to the docs to follow.
    EndSubSection
EndSection

Section "Monitor"
    Identifier  "Monitor0"
    VendorName  "Parallels, Inc."
    DisplaySize 584 330 # the real size, in millimeters, of your physical monitor.

    Option  "Primary"   "true"
    Option    "Position"  "0 0"

    # the ModeLines you saved earlier. *NOTE: take off the '.60_00' in the first string*
    Modeline "1280x1024"  108.88  1280 1360 1496 1712  1024 1025 1028 1060  -HSync +Vsync
    Modeline "1600x1200"  160.96  1600 1704 1880 2160  1200 1201 1204 1242  -HSync +Vsync
    Modeline "1680x1050"  147.14  1680 1784 1968 2256  1050 1051 1054 1087  -HSync +Vsync
    Modeline "1920x1200"  193.16  1920 2048 2256 2592  1200 1201 1204 1242  -HSync +Vsync
EndSection

Section "ServerLayout"
    Identifier      "Layout0"
    Screen          "Screen0"   0 0
    InputDevice     "Mouse0"    "CorePointer"
    InputDevice     "Keyboard0" "CoreKeyboard"
EndSection

Section "ServerFlags"
    Option "DefaultServerLayout"   "Layout0"
EndSection

This page is how I learned how to create this file, and what's absolutely required (if you get one thing wrong it won't work at all--ask me how I know).

Now the next time you run the X server, the vesa driver will match up those ModeLines to the ones it supports, and you will be able to switch to those modes.

I am using KDE plasma and sddm, so I had to log in, go to settings, and then change the display resolution from there, but I'm pretty sure that's just a wrapper around xrandr, so you could use that too if you don't have a GUI for changing the resolution.

Anyhow, I hope this helps someone in the future from enduring the tedious process I did to get this working.

Godspeed!
 
Back
Top