From nobody Sat Dec 03 15:49:46 2022 X-Original-To: freebsd-virtualization@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NPZ5Y5F2Nz4jhWG; Sat, 3 Dec 2022 15:50:25 +0000 (UTC) (envelope-from marietto2008@gmail.com) Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NPZ5X6WxCz3r8R; Sat, 3 Dec 2022 15:50:24 +0000 (UTC) (envelope-from marietto2008@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=Nv2dOyQA; spf=pass (mx1.freebsd.org: domain of marietto2008@gmail.com designates 2a00:1450:4864:20::534 as permitted sender) smtp.mailfrom=marietto2008@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-ed1-x534.google.com with SMTP id d14so5215992edj.11; Sat, 03 Dec 2022 07:50:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=lFqUQWco0ipAdIQ8BXFbnfngQQ8dhXJpHuhHvMzk0O0=; b=Nv2dOyQAiZsJ0pxXJoraVYGOZ22j1Gvqpml7Vf0TnEHzOZoAwAQgUGk17w8oknwx75 wpVgTa2MH/m1K2nV65GwJsBuylPr/1yehu00VodUnQ47u7gSZXGTfyElviv7pnQyNQzq Kbv1Q1hPj9lPbTNyGOd0dji4aAOjtKzJBXTTrs88yviVHdg3NJKAbhpdAO74Jnzzw3Sn LwLyHeIZg5Eu28rffyRRjV4KafS6UxUeVZCPXG97Wc+Rr2S79iRLomFMeR5zFCrpwfwX y0GWb/sQ5d4sXhTWhWE+vsNna4G7W4lHJ3eigXvs1Y+ON9Mg2trO+fQMNSTboQdkv2f6 teWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=lFqUQWco0ipAdIQ8BXFbnfngQQ8dhXJpHuhHvMzk0O0=; b=vl15HnXiS7sfsfB8pyTYLlh1O3R2N9ZCnOXyQfdO7LYDsOgwZalWaPLwT5jR0b+hrA kVBSuIC06omCE9KDqy6ItRFIPnClF66rq2G5M3dW+rEFZyq/j2DWZe8YO9vCgzJ/n2HL 1bjmGc4cHvKpWbbsc6fWmcrDesrJmOVWoYe9lE2nWbp83wH8KMURfD5DBXEp0oyANnYS RJ46Bd7YCMzciZJTC7WcaqrCM7YyJmCiaMEX9Dd43jYWbY0wCQ988xzpWgTSiUoWfumu QiXGh2sw/VttFL7Ot11FZRjWGYFkJgCjJZBb3/crxPBAK0nS03uiHgMBaTqmcJEZnLxx MYYg== X-Gm-Message-State: ANoB5plK8gyWGUMzKmW/mQhp+HPryM3OM7MJ2FgjSOTGa30ArC+NuMVL 9B+vg1H8QmbR6EMwyaBmjaqsiHDFGTsdNZzMd/pX72BQ4VnUcA== X-Google-Smtp-Source: AA0mqf67mmWXG47JHj/DXMug92/gtdy3se0PgctfMZkFzGdEoLQ/q2X0V+qiDKVmTZwi5XpCmelo5J+KNqoMh459LpM= X-Received: by 2002:a05:6402:5483:b0:468:d5a9:cb4b with SMTP id fg3-20020a056402548300b00468d5a9cb4bmr53240050edb.409.1670082622496; Sat, 03 Dec 2022 07:50:22 -0800 (PST) List-Id: Discussion List-Archive: https://lists.freebsd.org/archives/freebsd-virtualization List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-virtualization@freebsd.org X-BeenThere: freebsd-virtualization@freebsd.org MIME-Version: 1.0 From: Mario Marietto Date: Sat, 3 Dec 2022 16:49:46 +0100 Message-ID: Subject: How to use the framebuffer as primary video device instead of the nvidia passed-through graphic card in a bhyve/linux vm To: freebsd-x11+help@freebsd.org, FreeBSD virtualization , hackers@freebsd.org Content-Type: multipart/alternative; boundary="00000000000075a67d05eeee695a" X-Spamd-Result: default: False [-0.43 / 15.00]; URI_COUNT_ODD(1.00)[9]; HTTP_TO_IP(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_SPAM_SHORT(0.57)[0.571]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::534:from]; FROM_HAS_DN(0.00)[]; TAGGED_RCPT(0.00)[help]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; DKIM_TRACE(0.00)[gmail.com:+]; MID_RHS_MATCH_FROMTLD(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; MLMMJ_DEST(0.00)[freebsd-x11@freebsd.org,freebsd-virtualization@freebsd.org,hackers@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Queue-Id: 4NPZ5X6WxCz3r8R X-Spamd-Bar: / X-ThisMailContainsUnwantedMimeParts: N --00000000000075a67d05eeee695a Content-Type: text/plain; charset="UTF-8" Hello to everyone. what Im trying to do is to set the framebuffer video adapter as primary graphic card on my bhyve-ubuntu vm instead of the nvidia RTX 2080 ti card that I have passed through. What I want to do really is to use both the graphic adapters,but the primary should be the framebuffer and the secondary the nvidia. I tried different Xorg configurations,but what I've got is that Xorg failed to display some errors. So,the controller that you see below should be used as primary inside the ubuntu vm : 00:1d.0 VGA compatible controller: Device fb5d:40fb while the ones you see below as secondary : 08:00.0 VGA compatible controller: NVIDIA Corporation TU102 [GeForce RTX 2080 Ti] (rev a1) 08:00.1 Audio device: NVIDIA Corporation TU102 High Definition Audio Controller (rev a1) 08:00.2 USB controller: NVIDIA Corporation TU102 USB 3.1 Host Controller (rev a1) 08:00.3 Serial bus controller: NVIDIA Corporation TU102 USB Type-C UCSI Controller (rev a1) The script that I use to launch the vm is the following : #!/bin/sh setxkbmap it vms="$(ls /dev/vmm/*)" vncs="$(ps ax | awk '/vncviewer [0]/{print $6}')" for vm in $vms; do session="${vm##*/}" echo "bhyve session = $session" echo "vnc session = $vncs" if ! printf '%s\n' "${vncs}" | grep "${session}"; then printf 'VNC session not found,destroying ghost vms\n' bhyvectl --vm=$session --destroy else printf 'Found VNC session %s\n' "${session},no ghost vms found,not destroying them" fi done vmdisk1=`geom disk list | awk '/^Geom name: /{d=$NF} /^ *ident: (2015020204055E)/ && d{print d}'` echo "TOSHIBA External USB 3.0 1.8 TB ; $vmdisk1" mount -t ufs /dev/$vmdisk1'p2' /mnt/$vmdisk1'p2' bhyve -S -c sockets=1,cores=2,threads=2 -m 4G -w -H -A \ -s 0,hostbridge \ -s 2,virtio-blk,/mnt/$vmdisk1'p2'/bhyve/img/Linux/ubuntu2210.img,bootindex=1 \ -s 3,virtio-blk,/dev/$vmdisk4 \ -s 4,virtio-blk,/dev/$vmdisk2 \ -s 8:0,passthru,2/0/0 \ -s 8:1,passthru,2/0/1 \ -s 8:2,passthru,2/0/2 \ -s 8:3,passthru,2/0/3 \ -s 10,virtio-net,tap19 \ -s 11,virtio-9p,sharename=/ \ -s 29,fbuf,tcp=0.0.0.0:5919,w=1600,h=950,wait \ -s 30,xhci,tablet \ -s 31,lpc \ -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CODE.fd \ vm0:19 < /dev/null & sleep 2 && vncviewer 0:19 For sure ,on /boot/loader.conf I've added : /boot/loader.conf pptdevs="2/0/0 2/0/1 2/0/2 2/0/3" As I said before,I tried two xorg conf files to achieve the goal. On the first one I tried to add only the framebuffer,like this : 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 "vnc" 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" Identifier "Card0" Driver "modesetting" BusID "PCI:0:29: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 but it didn't work. This is the log file that shows the errors reported : https://pastebin.ubuntu.com/p/Gv7wgsDR4K/ I have also removed the xorg.conf file,but it didn't work either. This is the log file that shows the errors reported : https://pastebin.ubuntu.com/p/wNcfQTByQm/ Can someone give me some suggestions that can help me to understand where the mistake is,please,thanks. -- Mario. --00000000000075a67d05eeee695a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello to everyone.

what Im trying to do is to set the framebuffer video adapter as primary=20 graphic card on my bhyve-ubuntu vm instead of the nvidia RTX 2080 ti=20 card that I have passed through. What I want to do really is to use both the graphic adapters,but the primary should be the framebuffer and the=20 secondary the nvidia. I tried different Xorg configurations,but what I'= ve got is that Xorg failed to display some errors. So,the controller that you see below should be used as primary inside the ubuntu vm :

00:1d.0 VGA compatible =
controller: Device fb5d:40fb

while the ones you see below as secondary :

08:00.0 VGA compatible controller: NVIDIA Corporatio=
n TU102 [GeForce RTX 2080 Ti] (rev a1)
08:00.1 Audio device: NVIDIA Corporation TU102 High Definition Audio Contro=
ller (rev a1)
08:00.2 USB controller: NVIDIA Corporation TU102 USB 3.1 Host Controller (r=
ev a1)
08:00.3 Serial bus controller: NVIDIA Corporation TU102 USB Type-C UCSI Con=
troller (rev a1)

The script that I use to launch the vm is the following :

#!/bin/sh
setxkbmap it
vms=3D"$(ls /dev/vmm/*)"
vncs=3D"$(ps ax | awk '/vncviewer [0]/{print $6}')"

for vm in $vms; do
                session=3D"${vm##*/}"
                echo "bhyve session =3D $session"
                echo "vnc session =3D $vncs"
                if ! printf '%s\n' "${vncs}" | grep "=
;${session}"; then
                                printf 'VNC session not found,destroyin=
g ghost vms\n'
                                bhyvectl --vm=3D$session --destroy         =
                 =20
                else
                                printf 'Found VNC session %s\n' &qu=
ot;${session},no ghost vms found,not destroying them"
                fi
done

vmdisk1=3D`geom disk list | awk '/^Geom name: /{d=3D$NF} /^ *ident: (20=
15020204055E)/ && d{print d}'`
echo "TOSHIBA External USB 3.0 1.8 TB ; $vmdisk1"

mount -t ufs /dev/$vmdisk1'p2' /mnt/$vmdisk1'p2'

bhyve -S -c sockets=3D1,cores=3D2,threads=3D2 -m 4G -w -H -A \
-s 0,hostbridge \
-s 2,virtio-blk,/mnt/$vmdisk1'p2'/bhyve/img/Linux/ubuntu2210.img,bo=
otindex=3D1 \
-s 3,virtio-blk,/dev/$vmdisk4 \
-s 4,virtio-blk,/dev/$vmdisk2 \
-s 8:0,passthru,2/0/0 \
-s 8:1,passthru,2/0/1 \
-s 8:2,passthru,2/0/2 \
-s 8:3,passthru,2/0/3 \
-s 10,virtio-net,tap19 \
-s 11,virtio-9p,sharename=3D/ \
-s 29,fbuf,tcp=3D0.0.0.0:5919,w=3D1600,=
h=3D950,wait \
-s 30,xhci,tablet \
-s 31,lpc \
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CODE.fd \
vm0:19 < /dev/null & sleep 2 && vncviewer 0:19

For sure ,on /boot/loade= r.conf I've added :

/boot/loader.conf

pptdevs=3D"2/0/0 2/0/1 2/0/2 2/0/3"

As I said before,I tried= two xorg conf files to achieve the goal. On the first one I tried to add only the framebuffer,like this :

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 "vnc" 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" Identifier "Card0" Driver "modesetting" BusID "PCI:0:29: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


bu= t it didn't work. This is the log file that shows the errors reported := https= ://pastebin.ubuntu.com/p/Gv7wgsDR4K/
I have also removed the xorg.conf file,but it di= dn't work either. This is the log file that shows the errors reported :=


ht= tps://pastebin.ubuntu.com/p/wNcfQTByQm/

Can someone give me some= suggestions that can help me to understand where the mistake is,please,tha= nks.
--
Mario.
--00000000000075a67d05eeee695a--