quickemu-project / quickemu

Quickly create and run optimised Windows, macOS and Linux virtual machines
MIT License
10.74k stars 470 forks source link

bug: VirGL initialization messages printed on the terminal after quickemu exits #1130

Closed Jai-JAP closed 6 months ago

Jai-JAP commented 6 months ago

Expected behavior

After quickemu command exits the VM should continue running in the background without printing anything on the terminal.

Actual behavior

VirGL initialization warnings/messages are printed some time after quickemu exits. Making the terminal look broken. The message shown is as follows gl_version 46 - core profile enabled

Steps to reproduce the behavior

Run any VM using VirGL and wait for the output to occur. I am currently using Endeavour OS Gemini VM

Quickemu output

Quickemu 4.9.3 using /usr/bin/qemu-system-x86_64 v8.2.2
 - Host:     Manjaro Linux running Linux 6.6 (myhostname)
 - CPU:      11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
 - CPU VM:   1 Socket(s), 2 Core(s), 2 Thread(s), 8G RAM
 - BOOT:     EFI (Linux), OVMF (/usr/share/edk2-ovmf/x64/OVMF_CODE.fd), SecureBoot (off).
 - Disk:     endeavouros-gemini-2024.04.20/disk.qcow2 (16G)
             Looks unused, booting from endeavouros-gemini-2024.04.20/EndeavourOS_Gemini-2024.04.20.iso
 - Boot ISO: endeavouros-gemini-2024.04.20/EndeavourOS_Gemini-2024.04.20.iso
 - Display:  SDL, virtio-vga-gl, GL (on), VirGL (on)
 - Sound:    intel-hda
 - ssh:      On host:  ssh user@localhost -p 22220
 - WebDAV:   On guest: dav://localhost:9843/
 - 9P:       On guest: sudo mount -t 9p -o trans=virtio,version=9p2000.L,msize=104857600 Public-myuser ~/Public
 - smbd:     On guest: smb://10.0.2.4/qemu
 - Network:  User (virtio-net)
 - Monitor:  On host:  nc -U "endeavouros-gemini-2024.04.20/endeavouros-gemini-2024.04.20-monitor.socket"
             or     :  socat -,echo=0,icanon=0 unix-connect:endeavouros-gemini-2024.04.20/endeavouros-gemini-2024.04.20-monitor.socket
 - Serial:   On host:  nc -U "endeavouros-gemini-2024.04.20/endeavouros-gemini-2024.04.20-serial.socket"
             or     :  socat -,echo=0,icanon=0 unix-connect:endeavouros-gemini-2024.04.20/endeavouros-gemini-2024.04.20-serial.socket
 - Process:  Starting ./endeavouros-gemini-2024.04.20.conf as endeavouros-gemini-2024.04.20 (79345)

myuser@myhostname:~/VMS 
 $_ gl_version 46 - core profile enabled

Linux Distribution & Kernel

Run the following and paste the output.

LSB Version:    n/a
Distributor ID: ManjaroLinux
Description:    Manjaro Linux
Release:    23.1.4
Codename:   Vulcan
Linux myhostname 6.6.26-1-MANJARO #1 SMP PREEMPT_DYNAMIC Wed Apr 10 20:11:08 UTC 2024 x86_64 GNU/Linux
Jai-JAP commented 6 months ago

This can be easily fixed by changing https://github.com/quickemu-project/quickemu/blob/befe1b86451bcfd3f3654b49af9f69be7a715a3d/quickemu#L1306 to

        ${QEMU} "${args[@]}" &> "${VMDIR}/${VMNAME}.log" &   # Redirect all output including errors to log 

or

        ${QEMU} "${args[@]}" > "${VMDIR}/${VMNAME}.log" 2>/dev/null &    # Discard all error messages

EDIT: Optionally https://github.com/quickemu-project/quickemu/blob/befe1b86451bcfd3f3654b49af9f69be7a715a3d/quickemu#L1304 should also be change to

        echo "${QEMU}" "${SHELL_ARGS}" "2>/dev/null" >> "${VMDIR}/${VMNAME}.sh"

in order to reflect similar behaviour

flexiondotorg commented 6 months ago

Please can you submit a pull request for this.