{"id":83,"date":"2019-01-31T12:00:57","date_gmt":"2019-01-31T11:00:57","guid":{"rendered":"http:\/\/mickael.bucas.name\/blog\/?p=83"},"modified":"2019-01-31T12:36:08","modified_gmt":"2019-01-31T11:36:08","slug":"kubuntu-18-10-update-strange-x11-problem-complex-solution","status":"publish","type":"post","link":"https:\/\/mickael.bucas.name\/blog\/2019\/01\/kubuntu-18-10-update-strange-x11-problem-complex-solution\/","title":{"rendered":"KUbuntu 18.10 update : strange X11 problem, complex solution"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Upgrade, then reboot&#8230; <\/h3>\n\n\n\n<p>After the upgrade from 18.04 to 18.10, SDDM failed to start. This happened with kernel 4.18.0-10 and 4.15.0-36 (it was the chance to discover <code>grub-reboot<\/code>). The machine is a virtual machine, and PCI devices are using <code>virtio-pci<\/code> driver for example.<br><br>I looked into <code>\/var\/log\/Xorg.0.log<\/code> and found many error messages, the first one being :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">(EE) open \/dev\/dri\/card0: No such file or directory<br>See Xorg log file and crash file attached. <\/pre>\n\n\n\n<p>Then I looked at the output of <code>lspci -vvnn<\/code> and it seems that no kernel driver manages the VGA Controller. According to the following message, the missing kernel driver may be : <code>bochs-drm<\/code> or <code>virtio-vga<\/code><br><a rel=\"noreferrer noopener\" href=\"https:\/\/www.redhat.com\/archives\/libvir-list\/2015-August\/msg00220.html\" target=\"_blank\">https:\/\/www.redhat.com\/archives\/libvir-list\/2015-August\/msg00220.html<\/a> <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Asking for help <\/h3>\n\n\n\n<p>As usual when something goes wrong and it seems it&#8217;s not my fault, I&#8217;ve asked for some help. I opened a bug on Launchpad :<br><a href=\"https:\/\/bugs.launchpad.net\/ubuntu\/+source\/xorg-server\/+bug\/1802950\">https:\/\/bugs.launchpad.net\/ubuntu\/+source\/xorg-server\/+bug\/1802950<\/a><\/p>\n\n\n\n<p>Unfortunately that hasn&#8217;t been very helpful, mostly because I have never been able to upload a crash report. The standard crash report tool works under X11, which was of course not available. The command line tools didn&#8217;t work for me but I didn&#8217;t find why. So I left it sleep for some time<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">A new hope<\/h3>\n\n\n\n<p>There was a hint in the developer&#8217;s comments that there was some hope to make it work again in the future: Ubuntu could include the missing module in the kernel they provide. It was removed in 2014, and could be back as there is <a href=\"https:\/\/bugs.launchpad.net\/bugs\/1795857\">bug 1795857<\/a> from October 2018 asking for it. But such sidelines problem doesn&#8217;t get much attention, so it&#8217;s not included as of January 2019.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Go to the source<\/h3>\n\n\n<p>Then I thought that it&#8217;s only a module, and I could build it myself from the sources of the kernel. I didn&#8217;t know if it was easy under Ubuntu, but I already build kernels on Gentoo for 15 years, so I wanted to give it a try.<\/p>\n\n\n<p>First I installed the kernel sources package:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"> apt-get install linux-source-4.18.0<\/pre>\n\n\n\n<p>When I looked at its content I was disappointed, because it&#8217;s only a tarball, but it&#8217;s easy enough to decompress:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd \/usr\/src\/linux-source-4.18.0\/<br>tar xjf linux-source-4.18.0.tar.bz2<br>cd linux-source-4.18.0\/ <\/pre>\n\n\n\n<p>I tried the usual <code>make oldconfig<\/code> but some packages are necessary to make it work:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt-get install bison<br>apt-get install flex<br>apt-get install libelf-dev<\/pre>\n\n\n\n<p>From this point, I could go forward with my idea:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">make oldconfig<br>make menuconfig<\/pre>\n\n\n\n<p>In the menus I searched and enabled the module <code>CONFIG_DRM_BOCHS=m<\/code><br>Then I launched the compilation:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">make modules<\/pre>\n\n\n\n<p>Now you have time to take a break and get coffee, because Ubuntu enables many modules that are compiled by this command. It also takes space: the whole kernel tree with all compilation results and intermediate files amounts to 15 Gb !<\/p>\n\n\n\n<p>At the end  of this compilation, I installed manually the only module I&#8217;m interested in, because I don&#8217;t want to cripple the modules installed from standard packages:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mkdir \/lib\/modules\/4.18.0-12-generic\/kernel\/drivers\/gpu\/drm\/bochs<br>cp drivers\/gpu\/drm\/bochs\/*.ko \/lib\/modules\/4.18.0-12-generic\/kernel\/drivers\/gpu\/drm\/bochs<br>depmod -a<\/pre>\n\n\n\n<p>Now is the moment of truth, I try to load this module in the running kernel:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">modprobe bochs-drm<\/pre>\n\n\n\n<p>It didn&#8217;t work, but it was not obvious because <code>modprobe<\/code> didn&#8217;t show any message, so I searched elsewhere and found something in <code>dmesg<\/code> output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">bochs_drm: version magic '4.18.17 SMP mod_unload ' should be '4.18.0-12-generic SMP mod_unload ' <\/pre>\n\n\n\n<p>I didn&#8217;t know where this was defined nor if I could do something about it. If it&#8217;s not the same version, maybe I&#8217;ve the wrong kernel sources !<\/p>\n\n\n\n<p>However I found it in the main <code>Makefile<\/code> of the kernel so I decided to make a further attempt by changing the values in that file, even though I&#8217;ve no idea of the potential consequences&#8230; So I changed the values:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SUBLEVEL = 17<br>EXTRAVERSION =<\/pre>\n\n\n\n<p>To the values expected by the running kernel:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SUBLEVEL = 0<br>EXTRAVERSION = -12-generic<\/pre>\n\n\n\n<p>Then I restarted a clean compilation:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">make clean<br>make modules<br># Get more coffee<br>cp drivers\/gpu\/drm\/bochs\/*.ko \/lib\/modules\/4.18.0-12-generic\/kernel\/drivers\/gpu\/drm\/bochs<br>depmod -a<br>modprobe bochs-drm<br>systemctl start sddm<\/pre>\n\n\n\n<p>And then I got SDDM back on screen !<\/p>\n\n\n\n<p>I hope <code>bochs-drm<\/code> will be included in future standard kernels, as asked for in <a href=\"https:\/\/bugs.launchpad.net\/bugs\/1795857\">bug 1795857<\/a>, because until it is included, these steps will be necessary after each update of the standard kernel.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>That was not a simple solution to my problem. Did it work ? Yes ! Do I recommend it to anyone ? No, this method is too brittle and takes too much time.<\/p>\n\n\n\n<p>But it shows how Open Source makes it possible to solve your problems without the help of the author or packager of the software you want to use, and even do things that where not anticipated by them.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Upgrade, then reboot&#8230; After the upgrade from 18.04 to 18.10, SDDM failed to start. This happened with kernel 4.18.0-10 and 4.15.0-36 (it was the chance to discover grub-reboot). The machine is a virtual machine, and PCI devices are using virtio-pci driver for example. I looked into \/var\/log\/Xorg.0.log and found many error messages, the first one&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-83","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/mickael.bucas.name\/blog\/wp-json\/wp\/v2\/posts\/83","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mickael.bucas.name\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mickael.bucas.name\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mickael.bucas.name\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mickael.bucas.name\/blog\/wp-json\/wp\/v2\/comments?post=83"}],"version-history":[{"count":5,"href":"https:\/\/mickael.bucas.name\/blog\/wp-json\/wp\/v2\/posts\/83\/revisions"}],"predecessor-version":[{"id":91,"href":"https:\/\/mickael.bucas.name\/blog\/wp-json\/wp\/v2\/posts\/83\/revisions\/91"}],"wp:attachment":[{"href":"https:\/\/mickael.bucas.name\/blog\/wp-json\/wp\/v2\/media?parent=83"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mickael.bucas.name\/blog\/wp-json\/wp\/v2\/categories?post=83"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mickael.bucas.name\/blog\/wp-json\/wp\/v2\/tags?post=83"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}