Bulding Spice from git

Today, I keep building Spice directly from Git (no jhbuild).

Building Spice directly from git

Building Spice directly from the Git repositories turned out to be surprisingly easy, given how much trouble I ran into with jhbuild. However, I was missing a number of optional packages, most notably for VNC support. This shows up as empty package informations at the end of the build:

configure:      GTK_VNC:  
configure:      LIBVIRT:  
configure:        OVIRT:  

Contrast this with “working” packages:

configure:    SPICE_GTK: -pthread -I/usr/local/include/spice-1 -I/usr/local/include/spice-client-gtk-3.0 -I/usr/local/include/spice-client-glib-2.0 -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -L/usr/local/lib -lspice-client-gtk-3.0 -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lspice-client-glib-2.0
configure: 
configure:      LIBXML2: -I/usr/include/libxml2 -lxml2
configure: 

Some packages are a little tricky to find if you are not familiar with their internal name. For instance, oVirt is in libgovirt-devel (additional g, for “go, virt, go” I guess). The VNC support is in gtk-vnc2-devel, which is entirely logical provided you accept the appropriate definition of “logical“. And I had to ask for help for this one:

configure: WARNING: The x264enc GStreamer element(s) are missing. You should be able to find them in the gst-plugins-ugly 1.0 package.

It turns out it is in gstreamer1-plugins-ugly , the 1 being the important part, because the message tells you about the gst-plugins-ugly 1.0 package, and there is a 1 there too. I guess 😉 Also, you need an additional repository too, which is also all perfectly obvious with the correct interpretation of “obvious“). But in the end, it takes mere minutes to get a working remote-viewer, whereas jhbuild was clearly rebuilding the entire universe (and then some extra packages just to appease some obscure $DEITY).

My temporary conclusion is that jhbuild is to  configure and make what Gentoo is to other Linux distros. An interesting exercise, to do once in your life when you have plenty of free CPU time.

I could test my locally-built remote-viewer, and ran into a minor bug, a missing message if the protocol is not good, i.e. if you type ssh://foo for example. I ran into this initially by not having VNC configured, and attempting to use that protocol. So I finally sent my first patch for virt-viewer. Yeah, about time!

Issue with graphical boot in Ubuntu 14.04 LTS

I have this Ubuntu VM built from a physical disk that refuses to boot in graphical mode. What’s even stranger is that this seems to depend on the network setting, specifically bridge vs. NAT. Below are the results in bridged mode, which makes it possible to debug things when I can ssh into the guest.

Cirrus: Boots in text mode, switches to “graphical text mode”, then text login. startx gives me “no screen found”. After installing xserver-xorg-video-cirrus package, boot hangs after switching to graphical text mode (black screen, blinking cursor, tested 3 times in a row, and once had a few boot messages on it). Guest reachable with ssh. dmesg contains:

[   25.814651] init: lightdm main process (997) terminated with status 1
[   25.844275] init: plymouth-ready (startup) main process (171) terminated with status 1
[   25.844844] init: plymouth-stop pre-start process (1357) terminated with status 1
[   26.501096] random: nonblocking pool is initialized
[   45.103422] init: failsafe-x main process (1398) terminated with status 1

Xorg.log contains:

[    24.860] (EE) Failed to load module "vesa" (module does not exist, 0)
[    24.860] (II) CIRRUS: driver for Cirrus chipsets: CLGD5430, CLGD5434-4, CLGD5434-8,
    CLGD5436, CLGD5446, CLGD5480, CL-GD5462, CL-GD5464, CL-GD5464BD,
    CL-GD5465, CL-GD7548, CL-GD7555, CL-GD7556
[    24.860] (++) using VT number 7

[    24.871] (WW) Falling back to old probe method for cirrus
[    24.871] (--) Assigning device section with no busID to primary device
[    24.871] (--) Assigning device section with no busID to primary device
[    24.871] (WW) CIRRUS: More than one matching Device section found: Autoconfigured Video Device cirrus
[    24.871] (--) Assigning device section with no busID to primary device
[    24.871] (WW) CIRRUS: More than one matching Device section found: Autoconfigured Video Device cirrus
[    24.871] (--) Chipset CLGD5446 found
[    24.871] (EE) cirrus: The PCI device 0xb8 at 00@00:02:0 has a kernel module claiming it.
[    24.871] (EE) cirrus: This driver cannot operate until it has been unloaded.
[    24.871] (EE) No devices detected.
[    24.872] (EE) 
Fatal server error:
[    24.872] (EE) no screens found(EE) 

Not sure what do do with “this driver cannot operate until it has been unloaded”… Does not make sense to me: a driver cannot work until it has been loaded, or ???

QXL: Initially booted in text mode. After installing xserver-xorg-video-qxl, the boot proceeds to the graphical login screen. However, the session is immediately killed right after login. I don’t know which log file I should look at for this, but as usual, Google knows. Nothing suspicious in Xorg.log or dmesg. Looking at lightdm.log shows that the new X process dies with a SIGBUS (signal 10):

[+337.71s] DEBUG: Session pid=2056: Continue authentication
[+337.75s] DEBUG: Session pid=2108: Authentication complete with return value 0: Success
[+337.75s] DEBUG: Session pid=2056: Authenticate result for user ddd: Success
[+337.75s] DEBUG: Session pid=2056: User ddd authorized
[+337.76s] DEBUG: Session pid=2056: Greeter requests session ubuntu
[+337.76s] DEBUG: Seat: Stopping greeter; display server will be re-used for user session
[+337.76s] DEBUG: Session pid=2056: Sending SIGTERM
[+337.83s] DEBUG: Session pid=2056: Greeter closed communication channel
[+337.83s] DEBUG: Session pid=2056: Exited with return value 0
[+337.83s] DEBUG: Seat: Session stopped
[+337.83s] DEBUG: Seat: Greeter stopped, running session
[+337.83s] DEBUG: Registering session with bus path /org/freedesktop/DisplayManager/Session1
[+337.83s] DEBUG: Session pid=2108: Running command /usr/sbin/lightdm-session gnome-session --session=ubuntu
[+337.83s] DEBUG: Creating shared data directory /var/lib/lightdm-data/ddd
[+337.83s] DEBUG: Session pid=2108: Logging to .xsession-errors
[+337.84s] DEBUG: Activating VT 7
[+337.84s] DEBUG: Activating login1 session c4
[+338.45s] DEBUG: User /org/freedesktop/Accounts/User1002 changed
[+338.71s] DEBUG: Session pid=2108: Exited with return value 0
[+338.71s] DEBUG: Seat: Session stopped
[+338.71s] DEBUG: Seat: Stopping display server, no sessions require it
[+338.71s] DEBUG: Sending signal 15 to process 2047
[+338.89s] DEBUG: Process 2047 exited with return value 0
[+338.89s] DEBUG: DisplayServer x-0: X server stopped
[+338.89s] DEBUG: Releasing VT 7
[+338.89s] DEBUG: DisplayServer x-0: Removing X server authority /var/run/lightdm/root/:0
[+338.89s] DEBUG: Seat: Display server stopped
[+338.89s] DEBUG: Launching process 2824: /sbin/prime-switch
[+338.91s] DEBUG: Process 2824 exited with return value 0
[+338.91s] DEBUG: Seat: Exit status of /sbin/prime-switch: 0
[+338.91s] DEBUG: Seat: Active display server stopped, starting greeter
[+338.91s] DEBUG: Seat: Creating greeter session
[+338.91s] DEBUG: Seat: Creating display server of type x
[+338.91s] DEBUG: Using VT 7
[+338.91s] DEBUG: Seat: Starting local X display on VT 7
[+338.91s] DEBUG: DisplayServer x-0: Logging to /var/log/lightdm/x-0.log
[+338.91s] DEBUG: DisplayServer x-0: Writing X server authority to /var/run/lightdm/root/:0
[+338.91s] DEBUG: DisplayServer x-0: Launching X Server
[+338.91s] DEBUG: Launching process 2844: /usr/bin/X -core :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
[+338.91s] DEBUG: DisplayServer x-0: Waiting for ready signal from X server :0
[+338.95s] DEBUG: Got signal 10 from process 2844
[+338.95s] DEBUG: DisplayServer x-0: Got signal from X server :0
[+338.95s] DEBUG: DisplayServer x-0: Connecting to XServer :0
[+338.95s] DEBUG: Launching process 2845: /sbin/prime-offload
[+338.95s] DEBUG: Process 2845 exited with return value 0
[+338.95s] DEBUG: Seat: Exit status of /sbin/prime-offload: 0
[+338.96s] DEBUG: Seat: Display server ready, starting session authentication
[+338.96s] DEBUG: Session pid=2851: Started with service 'lightdm-greeter', username 'lightdm'
[+338.97s] DEBUG: Session pid=2851: Authentication complete with return value 0: Success
[+338.97s] DEBUG: Seat: Session authenticated, running command
[+338.97s] DEBUG: Session pid=2851: Running command /usr/lib/lightdm/lightdm-greeter-session /usr/sbin/unity-greeter
[+338.97s] DEBUG: Creating shared data directory /var/lib/lightdm-data/lightdm
[+338.97s] DEBUG: Session pid=2851: Logging to /var/log/lightdm/x-0-greeter.log
[+338.98s] DEBUG: Activating VT 7
[+338.98s] DEBUG: Activating login1 session c5
[+339.10s] DEBUG: Session pid=2851: Greeter connected version=1.10.6
[+339.22s] DEBUG: Session pid=2851: Greeter start authentication for ddd
[+339.22s] DEBUG: Session pid=2903: Started with service 'lightdm', username 'ddd'
[+339.23s] DEBUG: Session pid=2903: Got 1 message(s) from PAM
[+339.23s] DEBUG: Session pid=2851: Prompt greeter with 1 message(s)
[+339.62s] DEBUG: User /org/freedesktop/Accounts/User1002 changed

The content of /var/log/lightdm/x-0.log ends with:

Loading extension GLX
(II) [KMS] Kernel modesetting enabled.
resizing primary to 1024x768
primary is 0xb8977bc0
qxl_kms_surface_create: Bad bpp: 1 (1)
qxl_kms_surface_create: Bad bpp: 1 (1)
qxl_kms_surface_create: Bad bpp: 1 (1)

It’s not very clear to me why someone would request 1 bit per pixel display, even less clear why that would end the process with a signal 10. The guest also does cannot be shutdown properly from the VM, because clicking on the “Power off” dialog box that pops up closes the dialog, but has otherwise apparently no effect. Shutting down from ssh is possible.

This configuration remains my best chance, I believe, if I can decipher the meaning of the 1bpp message and the source of the SIGBUS.

VGA: I’m frankly surprised this one does not work. It starts booting in text mode, then shows the Ubuntu logo, and stays there. Looking at Xorg.0.log, it seems that it attempts to use the pre-existing NVIDIA driver for this. I can probably make this one work by excluding some modules at boot, but I don’t want to mess up with a configuration that works on bare hardware.

I also get messages indicating that it failed to load modules modesetting, fbdev or vesa. It might be worth investigating why.

Curiously, shutdown -h now over ssh does not work in that scenario. The system keeps running. However, the Shutdown menu from virt-manager does work. Go figure.

VirtIO: I’m pretty sure that this morning, it had booted to text login. But right now, it behaves much like VGA, except that I can’t even ssh to the machine. I did not find any obvious driver to install for this one.

VMVGA: Boots to “graphical text” login. After installing xserver-xorg-video-vmware, I get a behavior that looks a lot like QXL, except that the VMware driver apparently believes that the correct resolution is something like 3000×3000, which makes it a bit inconvenient. Even if I use the whole screen for the guest window, the login appears at the very bottom.

The symptoms are identical, and the cause seems to be the same, since lightdm.log tells me:

[+45.95s] DEBUG: Seat: Starting local X display on VT 7
[+45.95s] DEBUG: DisplayServer x-0: Logging to /var/log/lightdm/x-0.log
[+45.95s] DEBUG: DisplayServer x-0: Writing X server authority to /var/run/lightdm/root/:0
[+45.95s] DEBUG: DisplayServer x-0: Launching X Server
[+45.95s] DEBUG: Launching process 2127: /usr/bin/X -core :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
[+45.95s] DEBUG: DisplayServer x-0: Waiting for ready signal from X server :0
[+46.22s] DEBUG: User /org/freedesktop/Accounts/User1002 changed
[+46.92s] DEBUG: Got signal 10 from process 2127
[+46.92s] DEBUG: DisplayServer x-0: Got signal from X server :0
[+46.92s] DEBUG: DisplayServer x-0: Connecting to XServer :0

The difference is that the x-0.log file tells me even less than for QXL:

Initializing built-in extension XFree86-VidModeExtension
Initializing built-in extension XFree86-DGA
Initializing built-in extension XFree86-DRI
Initializing built-in extension DRI2
Loading extension GLX

So I need to figure out why the crash.

Bugs

Added some information regarding trackpad tracking. It turns out I was wrong, Windows doesn’t “get it right”.

Advertisements

Author: Christophe de Dinechin

I try to change the world, but that's work in progress. If you want to know me, google "Christophe de Dinechin". Keywords: concept programming, virtualization, OS design, programming languages, video games, 3D, modern physics. Some stuff I did that I'm proud of: the first "true" 3D game for the PC, HP's big iron virtualization, real-time test systems for car electronics, some of the best games for the HP48 calculator, a theory of physics that makes sense (at least to me).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s