You are not logged in.

#1 2014-08-04 23:01:43

ackalker
Member
Registered: 2012-11-27
Posts: 199

Xweston - run Xwayland like an ordinary X server using weston

While it is possible to run X clients in Weston by loading the xwayland.so module, running X window managers in an ordinary Weston session doesn't work because Weston normally runs its own window manager.

For those who would like to get on the Wayland bandwagon but don't want to give up on their favorite X window manager yet, here is Xweston, a little hack to try and make X window managers run in Weston.

Xweston runs Weston with a dummy shell client, which means there is no Weston window manager running, it now becomes possible to run an X window manager or even a display manager instead.

xweston-i3_thumb.png
X session running i3 running Xweston running i3. Note the weston-terminal on top of the two tiled xterms.

Installation and setup

To try out Xweston, build and install the package from the AUR.
No further configuration is needed.

Next, start Xweston like a normal X session, specifying Xweston as the server to use. For example:

$ startx -- /usr/bin/Xweston

If all goes well, Weston and Xwayland should start, followed by the X clients and/or window manager which you have specified in ${HOME}/.xinitrc .

Contributing

The source code is licensed under the GPL version2, and is hosted on Github. Any issue reports, pull requests, Wiki edits are very welcome.

Tested display managers

  • LightDM - Works. To add a dynamic seat using LightDM, do:

    # dm-tool add-seat xlocal xserver-command=/usr/bin/Xweston

Tested window managers

  • awesome - Works.

  • dwm - Works.

  • i3 - Works, but i3bar icons don't respond to hovering or clicking.

  • LXQt? - Works.

  • OpenBox - Starts, but has invisible menu & window decorations.

  • PekWM - Some problems.

  • ratpoison - Works.

  • wmii - Works.

  • XMonad (+XMobar + dmenu) - Works.

Known issues

  • When running Xweston in an existing X session, be sure that any keys to be used by the X window manager running in Weston aren't being captured by either Weston or the hosting X window manager. Remap them if needed.

  • Sometimes the mouse pointer doesn't show up until the first X client is started. An obvious workaround is to start one, such as an xterm (don't forget to put it in the background by adding an `&`!) before exec'ing the window manager.

  • When Xweston is started from a VT, it is possible that on quitting the X window manager, Weston doesn't shut down properly. If there is no X running on another VT, it may not be possible to switch VTs in order to try and kill Weston. Be warned!

  • Running (X)weston from a VT on systems with ATI video cards can result in system freezes or kernel panics involving radeon_crtc_handle_flip. This will hopefully be fixed with Linux kernel 3.16.

  • When running in a separate session on a VT, switching VTs may not work well, this is most often caused by Xwayland segfaulting. Known upstream, AFAICT, a fix is in the works.

  • When running in a session started from a display manager, trying to run native Wayland applications results in "Permission denied" errors. This is because the wayland-0 socket (which starts out owned by root) is not shared with the running user yet. Workaround (assuming $USER is in the group 'users', note the security implications!), do:

    # chown :users /tmp/.Xweston/
    # chown $USER /tmp/.Xweston/$DISPLAY
    # chown $USER /tmp/.Xweston/$DISPLAY/wayland-0

    then do:

    $ ln -s /tmp/.Xweston/$DISPLAY/wayland-0 "$XDG_RUNTIME_DIR/wayland-${DISPLAY#:}"
    $ export WAYLAND_DISPLAY=wayland-${DISPLAY#:}

It goes without saying that all of this is highly experimental, and that I cannot guarantee anything whatsoever. Please let me know what you think of it. Suggestions and fixes are very welcome.

Thanks to all for reporting their experiences smile

Last edited by ackalker (2014-08-15 13:59:15)

Offline

#2 2014-08-05 14:43:11

Head_on_a_Stick
Member
From: Asteroid B-612
Registered: 2014-02-20
Posts: 3,942
Website

Re: Xweston - run Xwayland like an ordinary X server using weston

I think it's mind-blowing:
2014_08_05_154057_1920x1080_scrot.jpg
It all seems to work pretty well, except my touchpad is slow & the synaptics drivers are unloaded.
glxinfo shows direct rendering, with no 'llvmpipe' in the renderer string (Intel HD4600).
EDIT: Some problems with PekWM:
2014_08_05_195524_1920x1080_scrot.jpg
And OpenBox (as you say, invisible menu & window decorations):
2014_08_05_195712_1920x1080_scrot.jpg

Last edited by Head_on_a_Stick (2014-08-05 19:01:59)


_0_
__0
000

Offline

#3 2014-08-05 16:48:33

adirat
Member
Registered: 2012-11-03
Posts: 27

Re: Xweston - run Xwayland like an ordinary X server using weston

First of all, great work smile This is awesome!

ackalker wrote:

Known issues

  • When Xweston is started from a VT, Weston doesn't shut down properly. If there is no X running on another VT, it may not be possible to switch VTs in order to try and kill Weston. Be warned!

I do not seem to experience this behaviour. Anyway, it's a good thing, I guess.

XMonad (+XMobar + dmenu) work without issue. Screenie:

wayland_screenshot.png

Offline

#4 2014-08-05 19:29:44

ackalker
Member
Registered: 2012-11-27
Posts: 199

Re: Xweston - run Xwayland like an ordinary X server using weston

@Head_on_a_Stick, @adirat
Glad you like it :-)

Yes, the mouse / touchpad slowness is also a known problem, but I think it is a general Wayland issue, others are experiencing the same with other setups as well.

@Head_on_a_Stick, glad to hear that you appear to have hardware acceleration, it seems to be a driver dependent thing to have it or not.

Last edited by ackalker (2014-08-05 19:33:32)

Offline

#5 2014-08-05 22:48:38

null
Member
Registered: 2009-05-06
Posts: 285

Re: Xweston - run Xwayland like an ordinary X server using weston

Just had two complete system freezes (radeon driver) within the first 5 minutes, but other than that dwm just worked fine smile


⚑★⚓ my dotfile repo ⚓★⚑

Offline

#6 2014-08-06 20:56:06

ackalker
Member
Registered: 2012-11-27
Posts: 199

Re: Xweston - run Xwayland like an ordinary X server using weston

New update: version 0.2 is up on the AUR smile

This one fixes (well, hacks around) the long startup delay, which was caused by not doing the secret handshake between xinit and Xwayland.
Expect a bit of error spam (in particular multiple "/usr/bin/Xwayland-wrapper died, respawning..." messages) in the log. Weston was obviously not designed to be (ab)used in the way Xweston does.

Enjoy smile

Last edited by ackalker (2014-08-07 18:16:21)

Offline

#7 2014-08-07 20:54:22

ackalker
Member
Registered: 2012-11-27
Posts: 199

Re: Xweston - run Xwayland like an ordinary X server using weston

New update: version 0.3.

Moar docs in da source, make Xweston behave even more like an ordinary X server by detecting whether or not it should use the secret handshake using SIGUSR1.

Last edited by ackalker (2014-08-07 21:05:04)

Offline

#8 2014-08-09 21:03:09

ackalker
Member
Registered: 2012-11-27
Posts: 199

Re: Xweston - run Xwayland like an ordinary X server using weston

Good news, I have greatly simplified things, and am working on getting Xweston to play nice with X display managers as well.
I am currently testing with LightDM, adding a new seat using Xweston as the 'server'.
It basically works, the GTK greeter shows up, and I can log in to my i3 session.
There are still some issues with switching VTs which I am trying to sort out.
Also, when started by a DM, sessions normally don't have permissions to use the wayland-0 socket, so running native Wayland applications in such a session doesn't work yet.

I hope to release an update soon.

Last edited by ackalker (2014-08-09 21:07:04)

Offline

#9 2014-08-13 16:15:28

ackalker
Member
Registered: 2012-11-27
Posts: 199

Re: Xweston - run Xwayland like an ordinary X server using weston

New update: version 0.4

This adds support for running X display managers, tested with LightDM.

To add a dynamic 'seat' (in LightDM parlance, nothing to do with what systemd considers to be a seat!) from within your running X session, do

# dm-tool add-seat xlocal xserver-command=/usr/bin/Xweston

This should start your configured LightDM greeter under Xweston on the next free VT.

New known issues:

  • Switching VTs may not work well, this is most often caused by Xwayland segfaulting. Known upstream, AFAICT, a fix is in the works.

Last edited by ackalker (2014-08-13 16:21:52)

Offline

#10 2014-08-13 16:50:47

HalosGhost
Member
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 1,486
Website

Re: Xweston - run Xwayland like an ordinary X server using weston

Wow! This looks like great work so far! Can you elaborate on the software stack in-play here? If run from a VTT, is your project running the chosen WM inside Weston inside X?

All the best,

-HG


"All errors are ᴘᴇʙᴋᴀᴄ errors—It's just a matter of narrowing down which keyboard and chair." -Trilby
\ldots

Offline

#11 2014-08-13 17:07:27

ackalker
Member
Registered: 2012-11-27
Posts: 199

Re: Xweston - run Xwayland like an ordinary X server using weston

@HalosGhost
Exactly.

This is a very simple schematic, similar to (part of) `ps jf` output:

<display manager>
  \_Xweston (which eventually exec's Xwayland)
    (\_Xwayland)
      \_weston
        \_dummy-client

Note that Xweston and dummy-client are nothing but simple shell scripts. After they're done, the display manager and any other X clients will know no better than that they're talking directly to an ordinary X server.

Note that currently you can only run X and native Wayland apps in the same session if you start Xweston from within an existing X session (but see workaround in first post).
Also, your X window manager most likely doesn't know how to manage native Wayland apps, so they will disappear forever behind Xwayland's root window the moment you click outside of them.

Last edited by ackalker (2014-08-13 21:34:31)

Offline

#12 2014-08-13 20:11:38

HalosGhost
Member
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 1,486
Website

Re: Xweston - run Xwayland like an ordinary X server using weston

ackalker wrote:

snip

Awesome. Thanks for the elaboration!

All the best,

-HG


"All errors are ᴘᴇʙᴋᴀᴄ errors—It's just a matter of narrowing down which keyboard and chair." -Trilby
\ldots

Offline

#13 2014-08-13 21:17:20

ackalker
Member
Registered: 2012-11-27
Posts: 199

Re: Xweston - run Xwayland like an ordinary X server using weston

@HalosGhost: You're welcome smile

Quick update: version 0.5

Fixes startx in a VT as non-root user.
Note to self: in the future, test all 3(!) use-cases:
- startx within X session
- startx in VT as non-root user
- display manager and session

Sorry for the inconvenience smile

Last edited by ackalker (2014-08-13 21:31:13)

Offline

#14 2014-08-14 12:23:24

Giselher
Member
From: Austria
Registered: 2010-02-02
Posts: 150
Website

Re: Xweston - run Xwayland like an ordinary X server using weston

Nice work!
But how does it handle native wayland applications?

Offline

#15 2014-08-14 15:59:14

sekret
Member
Registered: 2013-07-22
Posts: 205

Re: Xweston - run Xwayland like an ordinary X server using weston

I don't know what I'm doing wrong, but this doesn't work at all for me! Here's what I have tried:

1. startx in VT as non-root user

My .xinitrc for this test only has one line "exec dwm". I logged in and executed "startx -- /usr/bin/Xweston", but what I saw was standard weston.

2. startx within X session

I executed "startx -- /usr/bin/Xweston" and a new window with dwm appeared. Now if I try to run any command, e.g. launch dmenu, it's being launched within the X session rather than the Xweston session.
If I execute "WESTON_OPTS=--fullscreen startx -- /usr/bin/Xweston" my understanding is that it's the same as before, only the Xweston window is fullscreen, so I cannot see what happens behind it. But it's unusable.

My graphics card is a radeon run by the oss driver. Is there any more information I could give?

Offline

#16 2014-08-15 12:51:57

ackalker
Member
Registered: 2012-11-27
Posts: 199

Re: Xweston - run Xwayland like an ordinary X server using weston

@Giselher
If you use Xweston within an existing X session, running native Wayland apps shouldn't be a problem, as weston will create the required wayland-0 socket in your $XDG_RUNTIME_DIR directory, where Wayland apps should be able to find it.
Running multiple Xweston sessions from within the same X session could be a problem, I haven't looked into this yet.

Running Wayland apps from a standalone Xweston session is still a bit of a hassle. For a workaround, please see the bottom of my first post in this topic.
As the display manager will usually start Xweston as root (and often without $XDG_RUNTIME_DIR set), Xweston (and thus weston) doesn't know yet which user will actually be using the session. This is why in this case I've arranged for the socket and other files (owned by root!) to be put in a directory under /tmp/.Xweston/ . At some point, a service or setuid program should put (links to) these in the user's $XDG_RUNTIME_DIR directory.

@sekret
I'm busy moving the project to Github, and there is an update with some changes coming up which I hope will solve your problems, just be patient for a little longer smile

Last edited by ackalker (2014-08-15 13:25:00)

Offline

#17 2014-08-15 13:55:20

ackalker
Member
Registered: 2012-11-27
Posts: 199

Re: Xweston - run Xwayland like an ordinary X server using weston

Version 0.6.0 is out, and everything is now on Github, have a go at it smile

I'll update and clean up the first post soon, moving all tests and known issues to the repository's Wiki.

Last edited by ackalker (2014-08-15 14:04:38)

Offline

#18 2014-08-17 12:52:22

ackalker
Member
Registered: 2012-11-27
Posts: 199

Re: Xweston - run Xwayland like an ordinary X server using weston

@sekret
Please try out version 0.7.0, let me know if it works out for you or not.

Offline

#19 2014-08-17 20:50:58

sekret
Member
Registered: 2013-07-22
Posts: 205

Re: Xweston - run Xwayland like an ordinary X server using weston

Just updated to 0.7.1, it's just not working. I know, worst bug report ever, but I don't know what info I could provide. How can I help figuring it out?

Last edited by sekret (2014-08-17 20:51:27)

Offline

#20 2014-08-17 22:51:52

ackalker
Member
Registered: 2012-11-27
Posts: 199

Re: Xweston - run Xwayland like an ordinary X server using weston

Please be as specific as you can: what commands did you try? what (if any) messages are output as a result?

I would suggest trying the following for starters:

- check your environment settings (are you perhaps setting DISPLAY within your ${HOME}/.bashrc or ~/.profile ?)

- make sure that ${HOME}/.Xauthority isn't corrupted (check with `xauth list`). If not sure, back it up, delete it, then log out of your X session and back in again.

- make sure that weston works, without any weston.ini in your ${HOME}/.config/ directory, by running

$ weston

- start a very basic Xweston session with just a single xterm in it, by running:

$ startx /usr/bin/xterm -- /usr/bin/Xweston

- from within that xterm in Xweston, check the value of $DISPLAY, it should not be the same as that of your outer X session, but probably ':1'.

- from within the xterm in Xweston, try starting another xterm. It should open within the Xweston session, not in your outer X session.

In any case: if there are any error messages, please provide a (link to a) full transcript of the output.

Last edited by ackalker (2014-08-17 23:48:00)

Offline

#21 2014-08-18 07:20:15

sekret
Member
Registered: 2013-07-22
Posts: 205

Re: Xweston - run Xwayland like an ordinary X server using weston

Ok, I did those tests and they all worked just fine. Then I thought, maybe it's caused by my dwm configuration, so I build a vanilla dwm. Now everything works fine. I don't yet understand why, but I'll try to figure it out asap.

Offline

#22 2014-08-18 10:01:33

ackalker
Member
Registered: 2012-11-27
Posts: 199

Re: Xweston - run Xwayland like an ordinary X server using weston

@sekret
Glad it worked out smile

I think I will add some basic troubleshooting steps to the Wiki on Github once I move things from the first post there.

Offline

#23 2014-08-18 16:31:42

sekret
Member
Registered: 2013-07-22
Posts: 205

Re: Xweston - run Xwayland like an ordinary X server using weston

Well, up till now it hasn't worked out, I'm still searching for the reason. But I'll find it eventually, I hope wink I'll post it here, except if it's too embarrasing.

Offline

#24 2014-08-18 21:30:33

ackalker
Member
Registered: 2012-11-27
Posts: 199

Re: Xweston - run Xwayland like an ordinary X server using weston

"Small moves, Ellie, small moves..."
- Ted Arroway, Contact (1997)

Offline

#25 2014-09-07 17:49:52

mapintar
Member
Registered: 2010-04-17
Posts: 47

Re: Xweston - run Xwayland like an ordinary X server using weston

After install and start session I run:

ps aux | grep X

And show:

****        4268  0.0  0.0  13592  3328 tty1     S+   14:31   0:00 /bin/sh /usr/bin/startx -- /usr/bin/Xweston
****        4285  0.0  0.0  15960  1964 tty1     S+   14:31   0:00 xinit /home/hm/.xinitrc -- /usr/bin/Xweston :0 -auth /tmp/serverauth.nXByWc5ZR4
****        4286  5.9  0.7 295216 59696 tty1     Sl   14:31   0:38 Xwayland :0 -auth /tmp/serverauth.nXByWc5ZR4
****        6288  0.0  0.0  10740  2100 pts/0    S+   14:42   0:00 grep X

Gnome session work fine, and all weston program launch in a normal terminal, without any tweak.

Congratulation for great job smile .

Offline

Board footer

Powered by FluxBB