qemu gpu passthrough black screen

previously at may 2017 I have configured a virtual qemu machine with a gpu passthrought of a radeon 5450, it works fine except a kernel panic (on VM) after the 2nd boot of the VM…

Now I am trying to remake this machine with the same configuration ( just 1-2 things different) formerly :

  • Gigabyte GA-990-FXA-ud3
  • AMD FX6300
  • 1st graphic card : NVidia GT210
  • 2nd graphic card : AMD Radeon HD5450
  • debian 8

changes since :

  • AMD FX8350
  • 1st graphic card : NVidia GT710

(I know its a little bit outdated configuration but I am not a gamer so I do not need more)

I have written this startup script :

#/bin/sh  echo '0000:02:00.1' | tee /sys/bus/pci/devices/0000:02:00.1/driver/unbind  modprobe vfio modprobe vfio_pci  echo 1002 68f9 | sudo tee /sys/bus/pci/drivers/vfio-pci/new_id echo 1002 aa68 | sudo tee /sys/bus/pci/drivers/vfio-pci/new_id   qemu-system-x86_64 -M q35 -m 2048 -enable-kvm \ -bios OVMF.fd \ -device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 \ -soundhw ac97 \ -hda virtualrawdrive -cdrom ubuntuinstall.iso \ -device piix4-ide,bus=pcie.0,id=piix4-ide  -device vfio-pci,host=02:00.0,bus=root.1,addr=00.0,multifunction=on -device vfio-pci,host=02:00.1,bus=pcie.0 \ -vnc :0 

but Its not working, when I launch the script, 2nd graphic card VGA screen lights up, displays ubuntu plymouth screen, and after nothing, the screen stays on, but displays a black screen.

My lspci -nnk :

[...] 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK208B [GeForce GT 710] [10de:128b] (rev a1)     Subsystem: Gigabyte Technology Co., Ltd GK208B [GeForce GT 710] [1458:36f7]     Kernel driver in use: nvidia     Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia 01:00.1 Audio device [0403]: NVIDIA Corporation GK208 HDMI/DP Audio Controller [10de:0e0f] (rev a1)     Subsystem: Gigabyte Technology Co., Ltd GK208 HDMI/DP Audio Controller [1458:36f7]     Kernel driver in use: snd_hda_intel     Kernel modules: snd_hda_intel 02:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Cedar [Radeon HD 5000/6000/7350/8350 Series] [1002:68f9]     Subsystem: Micro-Star International Co., Ltd. [MSI] Cedar [Radeon HD 5000/6000/7350/8350 Series] [1462:2127]     Kernel driver in use: vfio-pci     Kernel modules: radeon 02:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Cedar HDMI Audio [Radeon HD 5400/6300/7300 Series] [1002:aa68]     Subsystem: Micro-Star International Co., Ltd. [MSI] Cedar HDMI Audio [Radeon HD 5400/6300/7300 Series] [1462:aa68]     Kernel driver in use: vfio-pci     Kernel modules: snd_hda_intel [...] 

My former 2017 script :

echo '0000:02:00.1' | sudo tee /sys/bus/pci/devices/0000:02:00.1/driver/unbind  modprobe vfio modprobe vfio_pci  echo 1002 68f9 | sudo tee /sys/bus/pci/drivers/vfio-pci/new_id echo 1002 aa68 | sudo tee /sys/bus/pci/drivers/vfio-pci/new_id  qemu-system-x86_64 -enable-kvm -M q35 -m 2048 -cpu host -smp 2,sockets=1,cores=2,threads=1 \ -bios /usr/share/qemu/bios.bin \ -vga none -device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 \ -device piix4-ide,bus=pcie.0,id=piix4-ide  -device vfio-pci,host=02:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on -device vfio-pci,host=02:00.1,bus=pcie.0 \ -soundhw ac97 \ -drive file=/home/user/ubuntuimage,id=disk,format=raw,if=none -device ide-hd,bus=piix4-ide.0,drive=disk 

I think the problem comes from the “x-vga=on” option, but it not works on the new versions, I have got this error :

qemu-system-x86_64: -device vfio-pci,host=02:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on: vfio 0000:02:00.0: failed getting region info for VGA region index 8: Invalid argument device does not support requested feature x-vga 

I have try use a “fresh” version of qemu (4.0.0) and OVMF (compiled from the GIT sources) but It does not changes anything…

So thanks by advance for your aswers

PS : sorry for my bad english, I am french

Disconnecting external monitor does not apply laptop screen settings

I have an really annoying problem with Ubuntu 18.04. My laptop has a 4k 15″ display. As this makes everything super small, I prefer scaling it down to 1080×1920 when using it. At work I have a dual monitor setup, both connected to a small dock/adapter which I connect to my machine with thunderbolt 3. In my Nvidia X server settings I have configured the dual screens to be next to each other and the laptop screen turned off. Now to the problem.

Whenever I disconnect these displays, my laptop screen turns back on with full 4k resolution. If I go into Nvidia X Server I can change it to 1080 again. But then the next time I connect to my dual monitors again, the setup is all wrong and I have to spend 5 minutes for rebooting and reconfiguring everything correctly again.

Is there a proper way to fix this? Is there a way to change display configurations automatically or maybe with a hotkey or something?

I’m using all the latest updates and Nvidia driver 430.

Invite to share screen (iMessage) – Automation – How?

How can i automate an “Invite to share screen” from iMessages.

I share screens a lot with my colleagues and it would just make sense to have an option to quick ask someone to view my screen. Yet now, i have to look the user up in the imessage window and “target practice” the small icon, then Invite ..

Would be easier if i could automate it, or somehow create a desktop shortcut.

Added nouveau.modeset=0 now black screen and nothing

Running Ubuntu 18.04.2. My system is crypt.

I was having an issue where Ubuntu didn’t seem to be waking up after screen idle timeout and lock. I would have to hard crash the system and then reboot.

Followed suggestion on this post to enter nouveau.modeset=0 to grub. After doing that and sudo update-grub and a reboot, now I never see the bios setup options, never see the enter crypt password. Can’t CTRL+ALT+F1, F6, or F7. Totally screwed my system. I can’t ssh in either.

Don’t enter nouveau.modeset=0!

So now what? How do I get back into my system? I’ve tried without being able to see anything at all to enter my crypt password. Then going through the motions of trying to login blind and possibly set my grub back, but it is not working. Just blank! It drives me nuts that this is an issue in this day and age. Should just work.

Executing bash code interactively using -c flag (With |& and gnu screen)

Before we get into the weeds: I’m choosing to use screen as a very crude multithreading tool. This is because I like screen, it’s everywhere I care about, and it suits this purpose.

I’m trying to have screen run a bash command, and redirect stderr + stdout to both the screen session as well as a text file.

The command I would like is

screen -dmS <generated_session_id> bash -c './get_fileserver_file_from_api <file_uri> -f "<save_directory>" |& tee -a "<save_directory>/downloadlog.txt"'

Currently, I can’t figure out how to redirect the output from get_fileserver_file_from_api into <save_directory>/downloadlog.txt.

I’ve tried

  • screen -dmS <generated_session_id> bash -c './get_fileserver_file_from_api <file_uri> -f "<save_directory>" |& tee -a "<save_directory>/downloadlog.txt"'
  • screen -dmS <generated_session_id> bash -c './get_fileserver_file_from_api <file_uri> -f "<save_directory>"' |& tee -a "<save_directory>/downloadlog.txt"
  • screen -dmS <generated_session_id> bash -c './get_fileserver_file_from_api <file_uri> -f "<save_directory>" \|& tee -a "<save_directory>/downloadlog.txt"'
  • screen -dmS <generated_session_id> bash -c './get_fileserver_file_from_api <file_uri> -f "<save_directory>" \|\& tee -a "<save_directory>/downloadlog.txt"'
  • Etc

Either bash directly tells me I have a bad syntax or the downloadlog.txt contains whether any errors on screen‘s part

I’m sure this is a problem with escaping properly, but I just can’t seem to unlock it without help.

Thanks