<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>11526</bug_id>
          
          <creation_ts>2017-05-18 14:11:34 +0000</creation_ts>
          <short_desc>ROOTLESS_X prevents X from running in Qemu</short_desc>
          <delta_ts>2020-03-17 01:09:47 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>graphics</component>
          <version>2.3</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>3.1 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Raphael Kubo da Costa (rakuco)">raphael.kubo.da.costa</reporter>
          <assigned_to name="Kevin Hao">kexin.hao</assigned_to>
          <cc>jku</cc>
    
    <cc>joshuagloe</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>ross.burton</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>73321</commentid>
    <comment_count>0</comment_count>
    <who name="Raphael Kubo da Costa (rakuco)">raphael.kubo.da.costa</who>
    <bug_when>2017-05-18 14:11:34 +0000</bug_when>
    <thetext>I was talking to Jussi earlier today about changing the default user in core-image-sato and he mentioned xserver-nodm-init and the ROOTLESS_X option.

I&apos;ve added ROOTLESS_X = &quot;1&quot; to my local.conf, bitbake&apos;d core-image-sato and ran the qemux86 image with runqemu.

The image boots fine, but X fails to start. After a few seconds, I can see the following messages on the terminal:

  xinit: giving up
  xinit: unable to connect to X server: Connection refused
  xinit: server error</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73324</commentid>
    <comment_count>1</comment_count>
    <who name="Joshua Lock">joshuagloe</who>
    <bug_when>2017-05-18 14:50:33 +0000</bug_when>
    <thetext>Sounds like we need a test for rootless X</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73331</commentid>
    <comment_count>2</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2017-05-18 16:14:19 +0000</bug_when>
    <thetext>Jussi, can you take this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73354</commentid>
    <comment_count>3</comment_count>
    <who name="Jussi Kukkonen">jku</who>
    <bug_when>2017-05-18 17:47:29 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; Jussi, can you take this?

Yup.

Joshua, you changed milestone and importance -- mistakes?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73356</commentid>
    <comment_count>4</comment_count>
    <who name="Joshua Lock">joshuagloe</who>
    <bug_when>2017-05-18 17:48:33 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; (In reply to comment #2)
&gt; &gt; Jussi, can you take this?
&gt; 
&gt; Yup.
&gt; 
&gt; Joshua, you changed milestone and importance -- mistakes?

Yes, sorry. I manage to do this quite often…</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73524</commentid>
    <comment_count>5</comment_count>
    <who name="Jussi Kukkonen">jku</who>
    <bug_when>2017-05-26 07:11:35 +0000</bug_when>
    <thetext>some notes in case I don&apos;t find a solution today and need to remember later:

* xserver crashes when initializing input devices
* This has apparently been broken for a long time, possibly even since xorg 1.17.2 (when logind support for input permissions was added)
* logind seems to do a bit more than that but possibly some combo of udev rule and/or &quot;setgid input&quot; might get us a working non-root xserver
* with systemd something seems to currently break a little earlier (as if it wasn&apos;t able to open a VT), this might be another issue as logind really should be handling the input permissions in this case...

Also agree with Joshua: we&apos;d need a test for this if we want this to keep working.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73525</commentid>
    <comment_count>6</comment_count>
    <who name="Jussi Kukkonen">jku</who>
    <bug_when>2017-05-26 08:33:13 +0000</bug_when>
    <thetext>&gt; * xserver crashes when initializing input devices

That may have been too hasty. There is indeed this warning when starting as &quot;xuser&quot;:

 [     6.555] xf86EnableIOPorts: failed to set IOPL for I/O (Operation not permitted)

but the actual crash happens in libvgahw.so module load (InitOutput()):

[     6.557] (II) Loading sub module &quot;vgahw&quot;
[     6.557] (II) LoadModule: &quot;vgahw&quot;
[     6.557] (II) Loading /usr/lib/xorg/modules/libvgahw.so
[     6.557] (II) Module vgahw: vendor=&quot;X.Org Foundation&quot;
[     6.557] 	compiled for 1.19.1, module version = 0.1.0
[     6.557] 	ABI class: X.Org Video Driver, version 23.0
[     6.557] (EE) 
[     6.557] (EE) Backtrace:
[     6.558] (EE) 0: /usr/bin/Xorg (xorg_backtrace+0x3d) [0x57250d]
[     6.558] (EE) 1: /usr/bin/Xorg (0x400000+0x175e69) [0x575e69]
[     6.558] (EE) 2: /lib/libpthread.so.0 (0x7f5a8a995000+0x119e0) [0x7f5a8a9a69e0]
[     6.558] (EE) 3: /usr/lib/libpciaccess.so.0 (pci_io_write8+0x3) [0x7f5a8bbbf863]
[     6.558] (EE) 4: /usr/lib/xorg/modules/libvgahw.so (vgaHWSaveColormap+0x56) [0x7f5a87650ee6]
[     6.558] (EE) 5: /usr/lib/xorg/modules/libvgahw.so (vgaHWSave+0x55) [0x7f5a876529d5]
[     6.558] (EE) 6: /usr/lib/xorg/modules/drivers/vmware_drv.so (0x7f5a87e76000+0x4552) [0x7f5a87e7a552]
[     6.558] (EE) 7: /usr/bin/Xorg (InitOutput+0xa5a) [0x4765ea]
[     6.558] (EE) 8: /usr/bin/Xorg (0x400000+0x37ab6) [0x437ab6]
[     6.558] (EE) 9: /lib/libc.so.6 (__libc_start_main+0xf1) [0x7f5a8a6184e1]
[     6.558] (EE) 10: /usr/bin/Xorg (_start+0x2a) [0x422e2a]
[     6.558] (EE) 
[     6.558] (EE) Segmentation fault at address 0x8
[     6.558] (EE) 

This was a little different with older releases and that confused me -- the above is from current poky master with ROOTLESS_X and sysvinit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73526</commentid>
    <comment_count>7</comment_count>
    <who name="Jussi Kukkonen">jku</who>
    <bug_when>2017-05-26 08:49:54 +0000</bug_when>
    <thetext>Workaround: Passing this to runqemu:
   qemuparams=&quot;-vga std&quot;
makes X work (slowly but still).

So it could be an issue with wmvare driver, not with our X setup.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73874</commentid>
    <comment_count>8</comment_count>
    <who name="Jussi Kukkonen">jku</who>
    <bug_when>2017-06-08 12:37:59 +0000</bug_when>
    <thetext>Moving to M2, no solution yet.

Just to reiterate if it wasn&apos;t clear: this does not look like an issue with xserver-nodm. It&apos;s probably the vmware X driver not working without root.

I guess we could add an error/warning in the recipe when building with ROOTLESS_X in the mean time...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74857</commentid>
    <comment_count>9</comment_count>
    <who name="Jussi Kukkonen">jku</who>
    <bug_when>2017-07-07 08:33:27 +0000</bug_when>
    <thetext>I&apos;ve not confirmed this but my current working hypothesis is this:
xf86-video-vmware does work with rootless X _if_ the host is compatible (in other words, one of the VMWare ones). We&apos;re running in qemus vmware emulation and something isn&apos;t right.

I don&apos;t have any VMWare machines to test the assumption.

I wonder if spice + qxl works any better?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81912</commentid>
    <comment_count>10</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2018-10-18 15:24:05 +0000</bug_when>
    <thetext>Related: I&apos;ve been idly looking at overhauling how qemu does graphics in our images from vmware bits to modern virtio.  This should resolve this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86730</commentid>
    <comment_count>11</comment_count>
    <who name="Kevin Hao">kexin.hao</who>
    <bug_when>2020-03-17 01:09:47 +0000</bug_when>
    <thetext>commit ba279900933d
Author: Kevin Hao &lt;kexin.hao@windriver.com&gt;
Date:   Sat Feb 8 20:36:42 2020 +0800

    xserver-nodm-init: Fix the start failure for non-root user
    
    In order to start the xserver, a non-root user should have the
    cap_sys_admin capability to set the drm master. We try to get
    the cap_sys_admin capability by setting it in both the thread
    and file inheritable set. The side effect of this is that we
    would have to add the &quot;pam&quot; to the distro features if we want
    use the xserver-nodm-init for a non-root user.
    
    [Yocto #11526]
    
    (From OE-Core rev: cfd71a68a4931c8bda15357ebb1e9ebcf0e302dc)
    
    Signed-off-by: Kevin Hao &lt;kexin.hao@windriver.com&gt;
    Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>