Solved Bhyve - how to configure Xorg in Linux guest

I've been trying hard to get a Linux, preferably Devuan, to work in graphical mode.
The installation runs fine, I can get access through VNC.
I can start the virtual machine and get to a console prompt for the username.
I've installed LxQT and slim.
Tried to start Xorg, got a bunch of errors.

Created a /etc/X11/xorg.conf file to include the driver "vesa".
The contents of the xorg.conf:
Code:
# cat /etc/X11/xorg.conf
Section "ServerLayout"
Identifier     "X.org Configured"
Screen      0  "Screen0" 0 0
InputDevice    "Mouse0" "CorePointer"
InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
ModulePath   "/usr/lib/xorg/modules"
FontPath     "/usr/share/fonts/X11/misc"
FontPath     "/usr/share/fonts/X11/cyrillic"
FontPath     "/usr/share/fonts/X11/100dpi/:unscaled"
FontPath     "/usr/share/fonts/X11/75dpi/:unscaled"
FontPath     "/usr/share/fonts/X11/Type1"
FontPath     "/usr/share/fonts/X11/100dpi"
FontPath     "/usr/share/fonts/X11/75dpi"
FontPath     "built-ins"
EndSection

Section "Module"
Load  "glx"
EndSection

Section "InputDevice"
Identifier  "Keyboard0"
Driver      "kbd"
EndSection

Section "InputDevice"
Identifier  "Mouse0"
Driver      "mouse"
Option        "Protocol" "auto"
Option        "Device" "/dev/input/mice"
Option        "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
Identifier   "Monitor0"
VendorName   "Monitor Vendor"
ModelName    "Monitor Model"
EndSection

Section "Device"
### Available Driver options are:-
### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
### <percent>: "<f>%"
### [arg]: arg optional
#Option     "SWcursor"               # [<bool>]
#Option     "kmsdev"                 # <str>
#Option     "ShadowFB"               # [<bool>]
#Option     "AccelMethod"            # <str>
#Option     "PageFlip"               # [<bool>]
#Option     "ZaphodHeads"            # <str>
#Option     "DoubleShadow"           # [<bool>]
Identifier  "Card0"
Driver      "vesa"
BusID       "PCI:0:8:0"
EndSection

Section "Screen"
Identifier "Screen0"
Device     "Card0"
Monitor    "Monitor0"
SubSection "Display"
Viewport   0 0
Depth     1
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     4
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     8
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     15
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     16
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     24
EndSubSection

EndSection
And the log in /var/log/Xorg.0.log
Code:
X.Org X Server 1.20.4
X Protocol Version 11, Revision 0
[   247.854] Build Operating System: Linux 5.10.0-6-amd64 x86_64 Debian
[   247.893] Current Operating System: Linux devuan 4.19.0-17-amd64 #1 SMP Debian 4.19
.194-3 (2021-07-18) x86_64
[   247.893] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.19.0-17-amd64 root=UUID=8
94871a7-2131-40b1-9e26-8ef0f0ff2224 ro quiet
[   247.958] Build Date: 19 April 2021  09:34:38AM
[   247.981] xorg-server 2:1.20.4-1+deb10u3 (https://www.debian.org/support)
[   248.003] Current version of pixman: 0.36.0
[   248.050]    Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
[   248.050] Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[   248.148] (==) Log file: "/var/log/Xorg.0.log", Time: Tue Sep 28 23:34:05 2021
[   248.172] (==) Using config file: "/etc/X11/xorg.conf"
[   248.195] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[   248.195] (==) ServerLayout "X.org Configured"
[   248.195] (**) |-->Screen "Screen0" (0)
[   248.195] (**) |   |-->Monitor "Monitor0"
[   248.196] (**) |   |-->Device "Card0"
[   248.196] (**) |-->Input Device "Mouse0"
[   248.196] (**) |-->Input Device "Keyboard0"
[   248.196] (==) Automatically adding devices
[   248.196] (==) Automatically enabling devices
[   248.196] (==) Automatically adding GPU devices
[   248.196] (==) Max clients allowed: 256, resource mask: 0x1fffff
[   248.196] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
[   248.196]    Entry deleted from font path.
[   248.196] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
[   248.196]    Entry deleted from font path.
[   248.196] (**) FontPath set to:
/usr/share/fonts/X11/misc,
/usr/share/fonts/X11/100dpi/:unscaled,
/usr/share/fonts/X11/75dpi/:unscaled,
/usr/share/fonts/X11/Type1,
/usr/share/fonts/X11/100dpi,
/usr/share/fonts/X11/75dpi,
built-ins,
/usr/share/fonts/X11/misc,
/usr/share/fonts/X11/100dpi/:unscaled,
/usr/share/fonts/X11/75dpi/:unscaled,
/usr/share/fonts/X11/Type1,
/usr/share/fonts/X11/100dpi,
/usr/share/fonts/X11/75dpi,
built-ins,
/usr/share/fonts/X11/misc,
/usr/share/fonts/X11/100dpi/:unscaled,
/usr/share/fonts/X11/75dpi/:unscaled,
/usr/share/fonts/X11/Type1,
/usr/share/fonts/X11/100dpi,
/usr/share/fonts/X11/75dpi,
built-ins
[   248.196] (**) ModulePath set to "/usr/lib/xorg/modules"
[   248.196] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.
[   248.196] (WW) Disabling Mouse0
[   248.196] (WW) Disabling Keyboard0
[   248.196] (II) Loader magic: 0x558b6a690e20
[   248.196] (II) Module ABI versions:
[   248.196]    X.Org ANSI C Emulation: 0.4
[   248.196]    X.Org Video Driver: 24.0
[   248.196]    X.Org XInput driver : 24.1
[   248.196]    X.Org Server Extension : 10.0
[   248.196] (++) using VT number 1

[   248.197] (II) systemd-logind: took control of session /org/freedesktop/login1/session/_33
[   248.198] (--) PCI:*(0@0:8:0) fb5d:40fb:0000:0000 rev 0, Mem @ 0xc0007000/128, 0xc1000000/16777216, BIOS @ 0x????????/131072
[   248.198] (II) "glx" will be loaded. This was enabled by default and also specified in the config file.
[   248.198] (II) LoadModule: "glx"
[   248.198] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[   248.199] (II) Module glx: vendor="X.Org Foundation"
[   248.199]    compiled for 1.20.4, module version = 1.0.0
[   248.199]    ABI class: X.Org Server Extension, version 10.0
[   248.199] (II) LoadModule: "vesa"
[   248.199] (II) Loading /usr/lib/xorg/modules/drivers/vesa_drv.so
[   248.199] (II) Module vesa: vendor="X.Org Foundation"
[   248.199]    compiled for 1.20.1, module version = 2.4.0
[   248.199]    Module class: X.Org Video Driver
[   248.199]    ABI class: X.Org Video Driver, version 24.0
[   248.199] (II) VESA: driver for VESA chipsets: vesa
[   248.199] (II) Loading sub module "vbe"
[   248.199] (II) LoadModule: "vbe"
[   248.199] (II) Loading /usr/lib/xorg/modules/libvbe.so
[   248.202] (II) Module vbe: vendor="X.Org Foundation"
[   248.202]    compiled for 1.20.4, module version = 1.1.0
[   248.202]    ABI class: X.Org Video Driver, version 24.0
[   248.202] (II) Loading sub module "int10"
[   248.202] (II) LoadModule: "int10"
[   248.202] (II) Loading /usr/lib/xorg/modules/libint10.so
[   248.203] (II) Module int10: vendor="X.Org Foundation"
[   248.203]    compiled for 1.20.4, module version = 1.0.0
[   248.203]    ABI class: X.Org Video Driver, version 24.0
[   248.203] (II) VESA(0): initializing int10
[   248.203] (EE) VESA(0): V_BIOS address 0x0 out of range
[   248.203] (II) UnloadModule: "vesa"
[   248.203] (II) UnloadSubModule: "int10"
[   248.203] (II) Unloading int10
[   248.203] (II) UnloadSubModule: "vbe"
[   248.203] (II) Unloading vbe
[   248.203] (EE) Screen(s) found, but none have a usable configuration.
[   248.203] (EE)
Fatal server error:
[   248.203] (EE) no screens found(EE)
[   248.203] (EE)
Please consult the The X.Org Foundation support
at http://wiki.x.org
for help.
[   248.203] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[   248.203] (EE)
[   248.245] (EE) Server terminated with error (1). Closing log file.

The BusID was obtained from:
Code:
lspci | grep -e VGA
00:08.0 VGA compatible controller: Device fb5d:40fb

The complete lspci command:
Code:
# lspci
00:00.0 Host bridge: Network Appliance Corporation Device 1275
00:03.0 SATA controller: Intel Corporation 82801HR/HO/HH (ICH8R/DO/DH) 6 port SATA Controller [AHCI mode]
00:04.0 SATA controller: Intel Corporation 82801HR/HO/HH (ICH8R/DO/DH) 6 port SATA Controller [AHCI mode]
00:05.0 Ethernet controller: Red Hat, Inc Virtio network device
00:06.0 Network and computing encryption device: Red Hat, Inc Virtio RNG
00:07.0 USB controller: VIA Technologies, Inc. VL805 USB 3.0 Host Controller (rev 01)
00:08.0 VGA compatible controller: Device fb5d:40fb
00:09.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller
00:1f.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]

I've also remove nomodeset from /boot/grub/grub.cfg

Someone mentioned that there can be a problem using the vesa driver with UEFI.

So. To have a VNC connection to run Linux in graphical mode UEFI is needed, but vesa can have problems with UEFI.
What should be configured to have Linux running in graphical mode?
 
Use the scfb driver when using UEFI, not sure how that's named on the Linux distribution you're using but it should have something similar.
 
Thanks SirDice, but could make it.
As per suggestions in other threads, I've installed tigervnc server at the Linux virtual machine and have a remote graphical connection through it.

As bhyve still lacks some polish in the UX, the steps were:

In the Devuan Linux vm:
Code:
# apt install tigervnc-stadalone-server
$ vncserver -depth 32 -geometry 1680x1200
enter a password, or two for a read-only session.

[check the port vncserver is running under, 5901 in my case, with
$ netstat -tulpn | grep vnc


At the FreeBSD host,
Code:
$ ssh user@linux-vm -L 5901:127.0.0.1:5901

Then connect with vncviewer or krdc, or other, pointing to
Code:
Then connect with [FILE]vncviewer[/FILE] or [FILE]krdc[/FILE], or other, pointing to 127.0.0.1:5901
 
Back
Top