Local SDL window does not work

Bug #226273 reported by ktulu
24
This bug affects 3 people
Affects Status Importance Assigned to Milestone
virt-manager (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: virt-manager

After starting a VM with SDL, I get the following error:

Error starting domain: virDomainCreate() failed QEMU quit during console startup

     =======================| DirectFB 1.0.1 |=======================
          (c) 2001-2007 The DirectFB Organization (directfb.org)
          (c) 2000-2004 Convergence (integrated media) GmbH
        ------------------------------------------------------------

(*) DirectFB/Core: Single Application Core. (2008-04-08 15:15)
(*) Direct/Memcpy: Using Generic 64bit memcpy()
(!) Direct/Util: opening '/dev/fb0' and '/dev/fb/0' failed
    --> No such file or directory
(!) DirectFB/FBDev: Error opening framebuffer device!
(!) DirectFB/FBDev: Use 'fbdev' option or set FRAMEBUFFER environment variable.
(!) DirectFB/Core: Could not initialize 'system' core!
    --> Initialization error!
Could not initialize SDL - exiting

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/engine.py", line 480, in run_domain
    vm.startup()
  File "/usr/share/virt-manager/virtManager/domain.py", line 379, in startup
    self.vm.create()
  File "/usr/lib/python2.5/site-packages/libvirt.py", line 240, in create
    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirtError: virDomainCreate() failed QEMU quit during console startup

     =======================| DirectFB 1.0.1 |=======================
          (c) 2001-2007 The DirectFB Organization (directfb.org)
          (c) 2000-2004 Convergence (integrated media) GmbH
        ------------------------------------------------------------

(*) DirectFB/Core: Single Application Core. (2008-04-08 15:15)
(*) Direct/Memcpy: Using Generic 64bit memcpy()
(!) Direct/Util: opening '/dev/fb0' and '/dev/fb/0' failed
    --> No such file or directory
(!) DirectFB/FBDev: Error opening framebuffer device!
(!) DirectFB/FBDev: Use 'fbdev' option or set FRAMEBUFFER environment variable.
(!) DirectFB/Core: Could not initialize 'system' core!
    --> Initialization error!
Could not initialize SDL - exiting

############################################################################

Without SDL, I can't switch to qemu console. So it's not possible to connect USB devices.

Revision history for this message
Alexander Jones (alex-weej) wrote :

Still relevant in Intrepid. Not sure why the DirectFB stuff is there...

Revision history for this message
falstaff (falstaff) wrote :

You can use the VNC-Server Display in virt-manager and connect to the console with a serial console. The QEMU Console is mapped to a /dev/pts/X device... Works like a charm for me...

However, It would be nice to have the SDL Window working anyway... :-)

Revision history for this message
Murat Gunes (mgunes) wrote :

Thanks for reporting. This issue persists with Intrepid (final), with a slightly different error message (only the line numbers in the traceback differ):

#############################################3

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/engine.py", line 472, in run_domain
    vm.startup()
  File "/usr/share/virt-manager/virtManager/domain.py", line 379, in startup
    self.vm.create()
  File "/usr/lib/python2.5/site-packages/libvirt.py", line 237, in create
    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirtError: virDomainCreate() failed internal error QEMU quit during console startup

     =======================| DirectFB 1.0.1 |=======================
          (c) 2001-2007 The DirectFB Organization (directfb.org)
          (c) 2000-2004 Convergence (integrated media) GmbH
        ------------------------------------------------------------

(*) DirectFB/Core: Single Application Core. (2008-09-12 20:02)
(*) Direct/Memcpy: Using Generic 64bit memcpy()
(!) Direct/Util: opening '/dev/fb0' and '/dev/fb/0' failed
    --> No such file or directory
(!) DirectFB/FBDev: Error opening framebuffer device!
(!) DirectFB/FBDev: Use 'fbdev' option or set FRAMEBUFFER environment variable.
(!) DirectFB/Core: Could not initialize 'system' core!
    --> Initialization error!
Could not initialize SDL - exiting

Changed in virt-manager (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Leon (leonbo) wrote :

Will this be fixed in 9.04? Or will we have to wait for 9.10? Thanks in advance!

Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

Thanks for reporting this issue.
Do you still have it?
Are you able to reproduce it with a recent version of Ubuntu, such as Karmic or Lucid?

Changed in virt-manager (Ubuntu):
assignee: nobody → ktulu (eric-duda)
status: Triaged → Incomplete
Revision history for this message
akfrick (arne-frick) wrote : Re: [Bug 226273] Re: Local SDL window does not work
Download full text (3.2 KiB)

Sorry, I can neither confirm or deny whether or not the issue still exists.
I have long since switched from virt-manager to VirtualBox.

Best regards,

Arne Frick

On Mon, Mar 8, 2010 at 12:47 AM, Marc Deslauriers <
<email address hidden>> wrote:

> Thanks for reporting this issue.
> Do you still have it?
> Are you able to reproduce it with a recent version of Ubuntu, such as
> Karmic or Lucid?
>
>
> ** Changed in: virt-manager (Ubuntu)
> Assignee: (unassigned) => ktulu (eric-duda)
>
> ** Changed in: virt-manager (Ubuntu)
> Status: Triaged => Incomplete
>
> --
> Local SDL window does not work
> https://bugs.launchpad.net/bugs/226273
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in “virt-manager” package in Ubuntu: Incomplete
>
> Bug description:
> Binary package hint: virt-manager
>
> After starting a VM with SDL, I get the following error:
>
> Error starting domain: virDomainCreate() failed QEMU quit during console
> startup
>
> =======================| DirectFB 1.0.1 |=======================
> (c) 2001-2007 The DirectFB Organization (directfb.org)
> (c) 2000-2004 Convergence (integrated media) GmbH
> ------------------------------------------------------------
>
> (*) DirectFB/Core: Single Application Core. (2008-04-08 15:15)
> (*) Direct/Memcpy: Using Generic 64bit memcpy()
> (!) Direct/Util: opening '/dev/fb0' and '/dev/fb/0' failed
> --> No such file or directory
> (!) DirectFB/FBDev: Error opening framebuffer device!
> (!) DirectFB/FBDev: Use 'fbdev' option or set FRAMEBUFFER environment
> variable.
> (!) DirectFB/Core: Could not initialize 'system' core!
> --> Initialization error!
> Could not initialize SDL - exiting
>
>
> Traceback (most recent call last):
> File "/usr/share/virt-manager/virtManager/engine.py", line 480, in
> run_domain
> vm.startup()
> File "/usr/share/virt-manager/virtManager/domain.py", line 379, in startup
> self.vm.create()
> File "/usr/lib/python2.5/site-packages/libvirt.py", line 240, in create
> if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
> libvirtError: virDomainCreate() failed QEMU quit during console startup
>
> =======================| DirectFB 1.0.1 |=======================
> (c) 2001-2007 The DirectFB Organization (directfb.org)
> (c) 2000-2004 Convergence (integrated media) GmbH
> ------------------------------------------------------------
>
> (*) DirectFB/Core: Single Application Core. (2008-04-08 15:15)
> (*) Direct/Memcpy: Using Generic 64bit memcpy()
> (!) Direct/Util: opening '/dev/fb0' and '/dev/fb/0' failed
> --> No such file or directory
> (!) DirectFB/FBDev: Error opening framebuffer device!
> (!) DirectFB/FBDev: Use 'fbdev' option or set FRAMEBUFFER environment
> variable.
> (!) DirectFB/Core: Could not initialize 'system' core!
> --> Initialization error!
> Could not initialize SDL - exiting
>
>
> ############################################################################
>
> Without SDL, I can't switch to qemu console. So it's not possible to
> connect USB devices.
>
> To unsubscribe from this bug, go to:
>...

Read more...

Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

Does anyone else still have this issue?

Changed in virt-manager (Ubuntu):
assignee: ktulu (eric-duda) → nobody
Revision history for this message
Soren Hansen (soren) wrote :

It works for me. Regardless, I don't see why anyone would want to use SDL instead of VNC?

Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

OK, let's close this bug. If anyone still has the problem with a recent Ubuntu release, they can open a new bug.

Changed in virt-manager (Ubuntu):
status: Incomplete → Invalid
Revision history for this message
Alexander Jones (alex-weej) wrote :

SDL is way more useful for graphics than VNC. If you actually want to do
anything visual in your VM, using VNC is slow and horrible. PLEASE FIX THIS!
It has clearly just been compiled with the wrong options or something
(directfb references instead of X)

On 10 March 2010 13:17, Marc Deslauriers <email address hidden>wrote:

> OK, let's close this bug. If anyone still has the problem with a recent
> Ubuntu release, they can open a new bug.
>
> ** Changed in: virt-manager (Ubuntu)
> Status: Incomplete => Invalid
>
> --
> Local SDL window does not work
> https://bugs.launchpad.net/bugs/226273
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Changed in virt-manager (Ubuntu):
status: Invalid → Confirmed
Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

@Alexander Jones: so you are still having this issue?

I can't reproduce it either, SDL is working fine for me. It looks like your SDL is trying to use the wrong driver.

What sdl packages do you have installed? You can do a "dpkg dpkg -la | grep sdl" to find out.

Is the SDL_VIDEODRIVER environment variable set for your user for some reason?

You are trying SDL with a local VM, and not a remote one, right?

Changed in virt-manager (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

Sorry, the command should be:

dpkg -la | grep sdl

Revision history for this message
Alexander Jones (alex-weej) wrote :

I believe it was happening in Karmic, will check Lucid when I get the
chance.

On 10 March 2010 13:54, Marc Deslauriers <email address hidden>wrote:

> @Alexander Jones: so you are still having this issue?
>
> I can't reproduce it either, SDL is working fine for me. It looks like
> your SDL is trying to use the wrong driver.
>
> What sdl packages do you have installed? You can do a "dpkg dpkg -la |
> grep sdl" to find out.
>
> Is the SDL_VIDEODRIVER environment variable set for your user for some
> reason?
>
> You are trying SDL with a local VM, and not a remote one, right?
>
>
> ** Changed in: virt-manager (Ubuntu)
> Status: Confirmed => Incomplete
>
> --
> Local SDL window does not work
> https://bugs.launchpad.net/bugs/226273
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
Ancoron Luziferis (ancoron) wrote :

I can confirm this one in Lucid Beta 1 with the following messages:

LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin /usr/bin/kvm -S -M pc-0.12 -enable-kvm -m 2048 -smp 4 -name aria -uuid a4294a0d-a75a-a377-ddcd-7e35d5720815 -chardev socket,id=monitor,path=/var/lib/libvirt/qemu/aria.monitor,server,nowait -monitor chardev:monitor -localtime -boot c -drive file=/srv/virtual/aria-win2k3.img,if=ide,index=0,boot=on,format=raw -drive file=/srv/virtual/win2003-x64.iso,if=ide,media=cdrom,index=2,format=raw -net nic,macaddr=52:54:00:76:e9:1d,vlan=0,name=nic.0 -net tap,fd=54,vlan=0,name=tap.0 -chardev pty,id=serial0 -serial chardev:serial0 -parallel none -usb -usbdevice tablet -vga std
char device redirected to /dev/pts/7

   ~~~~~~~~~~~~~~~~~~~~~~~~~~| DirectFB 1.2.8 |~~~~~~~~~~~~~~~~~~~~~~~~~~
        (c) 2001-2008 The world wide DirectFB Open Source Community
        (c) 2000-2004 Convergence (integrated media) GmbH
      ----------------------------------------------------------------

(*) DirectFB/Core: Single Application Core. (2010-02-03 18:27)
(*) Direct/Memcpy: Using Generic 64bit memcpy()
(!) Direct/Util: opening '/dev/fb0' and '/dev/fb/0' failed
    --> No such file or directory
(!) DirectFB/FBDev: Error opening framebuffer device!
(!) DirectFB/FBDev: Use 'fbdev' option or set FRAMEBUFFER environment variable.
(!) DirectFB/Core: Could not initialize 'system_core' core!
    --> Initialization error!
Could not initialize SDL - exiting

Output from 'dpkg -l | grep sdl':

ii libsdl-image1.2 1.2.10-1 image loading library for Simple DirectMedia
ii libsdl-mixer1.2 1.2.8-6build1 mixer library for Simple DirectMedia Layer 1
ii libsdl-net1.2 1.2.7-2 network library for Simple DirectMedia Layer
ii libsdl1.2debian 1.2.14-4ubuntu1 Simple DirectMedia Layer
ii libsdl1.2debian-alsa 1.2.14-4ubuntu1 Simple DirectMedia Layer (with X11 and ALSA

Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

@Ancoron: is your DISPLAY environment variable set?

Revision history for this message
Ancoron Luziferis (ancoron) wrote :

yepp:

$ echo $DISPLAY
:0

Revision history for this message
Ancoron Luziferis (ancoron) wrote :

The main reason why we see this is when the framebuffer device is not available.

The only thread on the forums with valuable information was this (although dated): http://ubuntuforums.org/showthread.php?t=652038

But even after struggling with module blacklisting, kernel boot options and other things I was unable to get any framebuffer device (some said it also could be /dev/video0 on ubuntu).

I also checked that the kernel had the modules built in / options set:

$ grep CONFIG_FB /boot/config-2.6.32-16-generic
CONFIG_FB=y
CONFIG_FB_DDC=m
CONFIG_FB_BOOT_VESA_SUPPORT=y
...
^^ a lot of other modules follow.

So I tried manually with modprobe:

$ lsmod | grep fb
fbcon 39270 0
tileblit 2487 1 fbcon
font 8053 1 fbcon
bitblit 5779 1 fbcon
vesafb 4442 0

So modules load fine, but still no framebuffer device:

$ ls -l /dev/fb* /dev/video*
ls: cannot access /dev/fb*: No such file or directory
ls: cannot access /dev/video*: No such file or directory

And as I said before, nothing when "enforcing" some framebuffer (with vga=XXX boot option). Even Xorg complained about that (for sure I won't set up the system to only use the framebuffer):

(**) |-->Screen "Builtin Default fbdev Screen 0" (2)
(**) | |-->Device "Builtin Default fbdev Device 0"
(==) No monitor specified for screen "Builtin Default fbdev Screen 0".
(II) LoadModule: "fbdev"
(II) Loading /usr/lib/xorg/modules/drivers/fbdev_drv.so
(II) Module fbdev: vendor="X.Org Foundation"
(II) FBDEV: driver for framebuffer: fbdev
(WW) Falling back to old probe method for fbdev
(II) Loading sub module "fbdevhw"
(II) LoadModule: "fbdevhw"
(II) Loading /usr/lib/xorg/modules/linux/libfbdevhw.so
(II) Module fbdevhw: vendor="X.Org Foundation"
(EE) open /dev/fb0: No such file or directory
        "Builtin Default ati Screen 0" for depth/fbbpp 24/32
(II) Loading sub module "fb"
(II) LoadModule: "fb"
(II) Loading /usr/lib/xorg/modules/libfb.so
(II) Module fb: vendor="X.Org Foundation"
(!!) RADEON(0): MergedFB support has been removed and replaced with xrandr 1.2 support
(II) UnloadModule: "fbdev"
(II) Unloading /usr/lib/xorg/modules/drivers/fbdev_drv.so
(II) UnloadModule: "fbdevhw"
(II) Unloading /usr/lib/xorg/modules/linux/libfbdevhw.so

The only thing that caused some attraction was this option in the kernel config:

# CONFIG_FB_VIRTUAL is not set

So there cannot be any virtual framebuffers. Am I right here?

Revision history for this message
Ancoron Luziferis (ancoron) wrote :

So with all my efforts being not able to change anything and due to the fact that it works with Debian even in testing it must have to do with some Ubuntu patches or anything like that.

In addition this issue points me to the kernel rather than the virt-manager package.

Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

I simply cannot reproduce this issue on all three machines I've tried here.

Revision history for this message
Ancoron Luziferis (ancoron) wrote :

OK, here are my machine specs (maybe this is some conditional thing):

- AMD Phenom II X4 955 (@ 3.2 GHz)
- 2x 2 GiB DDR3 RAM (@ 1.333 GHz)
- Gigabyte GA-790XTA-UD4 (RD790/SB750)
- AMD Radeon HD4770
- 500 GB Hitachi Deskstar T7K500

$ uname -m
x86_64

Non-standard repositories:
- xorg-edgers

I'll try with other kernels.

Revision history for this message
Ancoron Luziferis (ancoron) wrote :

OK, no success with other kernels (tried 2.6.33 and 2.6.34-rc1).

@Marc:
How did you "setup" the framebuffer device on your machines?

I don't know if it is relevant but I have to state that I'm not using KMS (because the HD4770 still isn't supported) and so I have to revert to UMS via radeon.modeset=0 command line. And so I only get the plymouth text splash thing. That is somewhat strange as even grub2 is configured for another resolution (1920x1440).

Running vbeinfo inside grub also yields a ton of available resolutions so the VESA stuff should be working correctly. Although I must admit that non of the resolutions listed by that complies to the "official" resolutions of my monitor delivered via EDID (which are 1280x800 and 2560x1600).

Running "hwinfo --framebuffer" shows up this:

02: None 00.0: 11001 VESA Framebuffer
  [Created at bios.464]
  Unique ID: rdCR.zobvqQpNPrC
  Hardware Class: framebuffer
  Model: "(C) 1988-2005, ATI Technologies Inc. RV740"
  Vendor: "(C) 1988-2005, ATI Technologies Inc. "
  Device: "RV740"
  SubVendor: "ATI ATOMBIOS"
  SubDevice:
  Revision: "01.00"
  Memory Size: 16 MB
  Memory Range: 0xd0000000-0xd0ffffff (rw)
  Mode 0x0300: 640x400 (+640), 8 bits
  Mode 0x0301: 640x480 (+640), 8 bits
...

I don't have comprehensive knowledge about the Linux internals here but that output seems to me like there should be framebuffer support available.

Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

I don't use a framebuffer device. I use x.org.

KVM uses SDL to draw the virtual machines window. SDL has a variety of video output drivers available, including "x11" and "directfb". When SDL starts, it tries to auto-detect what graphics driver it should use. If you're running X, it should detect this and use the "x11" driver, which is what happens for me.

In your case, for some reason SDL is trying to use the "directfb" driver instead of "x11". The "directfb" driver is intended for running graphical application from a text console when X isn't running, by directly accessing the framebuffer device.

We need to figure out why SDL isn't detecting your x.org properly, so it will pick the "x11" driver.

Revision history for this message
Ancoron Luziferis (ancoron) wrote :

I'm making progress.

At least I got a /dev/fb0 now:

$ ls -l /dev/fb*
crw-rw---- 1 root video 29, 0 2010-03-21 14:08 /dev/fb0

What I did was adding "fbdev" at the end of my boot line. In addition I got high resolution VTs. Still not the monitors native resolution but a massive improvement. This "fbdev" seems to be valid only for EFI, but at least for me that works, although I've got a standard Award BIOS. In addition I got the graphical boot splash from plymouth without KMS.

The backside is, that still I am unable to start a VM using SDL:

(*) DirectFB/Core: Single Application Core. (2010-02-03 18:27)
(*) Direct/Memcpy: Using Generic 64bit memcpy()
(!) Direct/Util: opening '/dev/fb0' failed
    --> Permission denied
(!) DirectFB/FBDev: Error opening framebuffer device!
(!) DirectFB/FBDev: Use 'fbdev' option or set FRAMEBUFFER environment variable.
(!) DirectFB/Core: Could not initialize 'system_core' core!
    --> Initialization error!
Could not initialize SDL - exiting

It doesn't make a difference if I try to start it with my user account or with sudo, "permission denied" in both cases.

Revision history for this message
Ancoron Luziferis (ancoron) wrote :

Ah...

...now I get the point of SDL.

OK, then the DirectFB issue is a complete different story and should be reported separately.

Revision history for this message
Ancoron Luziferis (ancoron) wrote :

As a test (should have done this in the first place) I started the VM manually via the stated command line from the log file in /var/log/libvirt/qemu/.

KVM/QEMU uses SDL by default and it opens just fine and I can use the VM as usual. So this has nothing to do with KVM/QEMU itself. As starting the VM using "virt-manager" or the "virsh" command fails it must have something to do with those. Instead it seems that libvirt does not use and/or forward the "DISPLAY" environment variable (or the specified one in the appropriate <graphics/> tag) when SDL is specified for a VM.

This is documented here: http://libvirt.org/formatdomain.html#elementsGraphics

So if it doesn't work it's a bug in libvirt.

Revision history for this message
Ancoron Luziferis (ancoron) wrote :
Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

Closing this bug as bug 545426 has been resolved.

Changed in virt-manager (Ubuntu):
status: Incomplete → Fix Released
Revision history for this message
Bryan Forbes (bryanforbes) wrote : I can't believe you helped me save over $300 on this Rolex Sport Model

Hello Customer

A wide selection of brands is available to choose from.
The perfect place to buy watches as we offer best quality, excellent service, money back guarantee in case you are not satisfied and have many other strong points, such as fast delivery, helpful and caring customer service.

******************************************************
Today I received my two watches. Both watches were spectacular, you guys did a wonderful job and I will definitely recommend you to all my friends!
Thank you!
                     Will Rangel
******************************************************

Click here ---> http://penio.ru

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.