dnschneid / crouton

Chromium OS Universal Chroot Environment
https://goo.gl/fd3zc?si=1
BSD 3-Clause "New" or "Revised" License
8.56k stars 1.24k forks source link

Need proper XMETHOD coexistence #1274

Closed divx118 closed 9 years ago

divx118 commented 9 years ago

When xiwi target is not in front, xorg target will be installed and XMETHOD will be set to x11. This also happens when updating with a new WM target. sudo sh ~/Downloads/crouton -r trusty -t xiwi,lxde updating and adding xfce should be done like this sudo sh ~/Downloads/crouton -u -t xiwi,xfce Normally it shouldn't be needed to add xiwi target on update. This should be solved once https://github.com/dnschneid/crouton/issues/1198 is implemented.

On a side note, it would also be nice to be able to choose the xmethod on entering the chroot, so you can choose when accelerated gpu is needed.

dnschneid commented 9 years ago

This is definitely an issue, but I'm going to mark it as a dupe of #1198 so we're tracking it in one place. As for choosing an xmethod, you can do that now, sort of.

sudo enter-chroot XMETHOD=xorg startxfce4

sudo enter-chroot XMETHOD=xiwi startxfce4

should both work if you have xorg and xiwi installed.

divx118 commented 9 years ago

BTW sudo enter-chroot XMETHOD=xorg startxfce4 or sudo enter-chroot XMETHOD=xiwi startxfce4 or sudo enter-chroot XMETHOD=x11 startxfce4 doesn't work, I get -su: 1: XMETHOD=[xorg,xiwi,x11]: not found Didn't look yet why.

dnschneid commented 9 years ago

Oops, forgot env.

sudo enter-chroot exec env XMETHOD=xorg startxfce4

dnschneid commented 9 years ago

Wait, that still doesn't work. Let me look into it.

DennisLfromGA commented 9 years ago

It might need 'DISPLAY=...' also

On Fri, Dec 26, 2014 at 5:22 PM, David Schneider notifications@github.com wrote:

Wait, that still doesn't work. Let me look into it.

— Reply to this email directly or view it on GitHub https://github.com/dnschneid/crouton/issues/1274#issuecomment-68160798.

DennyL@GMail

divx118 commented 9 years ago

@dnschneid Probably because the link is created in x11-common https://github.com/dnschneid/crouton/blob/master/targets/x11-common#L11 so on target install.

dnschneid commented 9 years ago

It's really because the actual state of X11 backend selection didn't match what was in my head :)

I'm working on a patch to fix coexistence.

dnschneid commented 9 years ago

Try the xmethods branch.

divx118 commented 9 years ago

That works. Just needed to install manually "xserver-xorg-video-intel" it wasn't pulled in by target xorg it seems. Also no fbdev driver was available.

dnschneid commented 9 years ago

Blargh, makes sense. Re-opening to track this stuff.

dnschneid commented 9 years ago

OK, try the latest version of the xmethods branch.

sfc-gh-eraigosa commented 9 years ago

@dnschneid do you have any instructions on how to get enter-chroot to use a different branch like xmethods branch? I'm assuming the command for startup would be something like (assuming my chroot name is trusty and i use unity), but I'm not sure how to make enter-chroot use a different branch:

sudo enter-chroot -n trusty exec env XMETHOD=xorg startunity

sudo enter-chroot -n trusty exec env XMETHOD=xiwi startunity

moocow1452 commented 9 years ago

It looks like a valid command, but it's unable to open the Display Environment as of now.

divx118 commented 9 years ago

@dnschneid Tried it and works fine now. fbdev and intel drivers are installed.

@wenlock You can't just use enter-chroot to use another branch. You need to update your chroot with manually running installer/main.sh from that branch.

dnschneid commented 9 years ago

Updated again to address issues with precise.

vsukul commented 9 years ago

Hey all, I've tried pretty much every install tactic that's been described here but cant get xiwi to work properly. It'll installed, but when loading the chroot, it opens the window and then nothing shows up. the extension states that its connected. tried with both master branch and xmethods branch, tried with trusty on either xfce or unity (new chroot install, not an update of a running chroot-- although i tried that as well to no avail). running on a toshiba chromebook 2.

vsukul commented 9 years ago

this is what appears in crosh after launch after my latest try using xfce/utopic. don't know if that offers any useful insight into what isn't working:

screenshot 2014-12-30 at 1 52 56 pm

DennisLfromGA commented 9 years ago

Have you got the latest version (2.0.0) of the 'Crouton Integration' app? Also, on Utopic when starting the chroot, I sometimes have to exit full screen mode and then maximize again for the screen to display the desktop - don't know why...

dnschneid commented 9 years ago

@vsukul, please open a new bug to track that, and include the output of croutonversion

tedm commented 9 years ago

Also, if you installed -t xiwi over an existing chroot, you may want to update as well like:

... -t xiwi -u

which I believe should pull in extension though I manually added it, in addition to the Chrome Integration app from store. Not sure if it's necessary, but maybe specifying your DE again with -u might help, and of course, latest version of crouton, and probably update if the up arrow is in your taskbar inducating an update to Chrome OS is out there requiring reboot.

merah-putih commented 9 years ago

@tedm : installed xiwi over an existing chroot does not seem to work. Below what I got, when installing xiwi over an existing precise/xfce on acer c720 (latest stable channel):

croutonversion: crouton: version 1-20141228012255~master:00179dae

I run: sudo sh -e ~/Downloads/crouton -t xiwi -n precise -u

giving the error output: ... Installing target xiwi... xserver-xorg-video-dummy was already not hold. Segmentation fault (core dumped) Reading package lists... Done Building dependency tree
Reading state information... Done xorg is already the newest version. Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:

The following packages have unmet dependencies: xserver-xorg-video-dummy : Depends: xorg-video-abi-11 Depends: xserver-xorg-core (>= 2:1.10.99.901) E: Unable to correct problems, you have held broken packages. Failed to complete chroot setup. Unmounting /mnt/stateful_partition/crouton/chroots/precise...

tedm commented 9 years ago

@merah-putih try downloading the latest crouton, a minute ago it was:

latest: version 1-20141231011135~master:992afe3e

then try:

sudo sh -e ~/Downloads/crouton -t -u xiwi -n precise

You might want to powercycle, that segmentation fault did not look good.

dnschneid commented 9 years ago

@merah-putih I think that's a bug upgrading from xorg to xiwi on precise. Could you please open a separate bug for that?

jzellis commented 9 years ago

I added xiwi to my existing trusty/xfce chroot today on my Acer C720, so it can definitely be done. Now I'm just trying to figure out how to be able to use it without the extension. Do I need to update with the xorg target or is there a way to do it with the existing xfce4 target? Or are the two mutually exclusive (xiwi, xfce)?

dnschneid commented 9 years ago

Updating with -t xorg will switch back to native X11.

jzellis commented 9 years ago

Ah, okay. But there's no way to choose which method I want to use each time? For example, sometimes I'd like to use it in a Chrome window if I'm just running Sublime Text, but other times I'd like to run it separately (if I'm watching VLC, say). Is that possible?

dnschneid commented 9 years ago

That will happen once the xmethods branch merges.

jzellis commented 9 years ago

Ah, cool, thanks! (Sorry -- I'm still a newbie with this, even though I've been running crouton on my Chromebook for months!)

dnschneid commented 9 years ago

crouton is both deceptively simple and extraordinarily complex at the same time. No worries!

DennisLfromGA commented 9 years ago

Boy, the new xmethod fixes and invocation feature that will switch back & forth will be hugely popular I believe. :)

On Wed, Dec 31, 2014 at 3:15 PM, David Schneider notifications@github.com wrote:

Updating with -t xorg will switch back to native X11.

— Reply to this email directly or view it on GitHub https://github.com/dnschneid/crouton/issues/1274#issuecomment-68466598.

DennyL@GMail

tedm commented 9 years ago

@DennisLfromGA yes, definitely, seems like everyone and their brother are trying this out, and loving it, but some game or vlc or something is just not as fast so they want a way to switch. Would be great if we could just get some acceleration in xiwi. I am learning a lot and taking notes by following you around on G+ getting users up and running one at a time.

sfc-gh-eraigosa commented 9 years ago

@tedm I used xiwi all week while hacking on my package for atom. Worked so nicely. I do think i would stick with xiwi strictly if acceleration was in place for sure. That would make it very usable. BTW, I'm amazed how sleep and resume just works. very nice.

dnschneid commented 9 years ago

I doubt xiwi will ever have GPU acceleration. As soon as the dust around the freon stuff settles, it'll be xiwi for non-accelerated convenience, and xorg for performance going forward.

tedm commented 9 years ago

that makes sense. Many will want a switching utility. I'm one of the few who doesn't game much and watch HD on a TV, so the xiwi (and the ARM cpu) is fine. The most intense graphics I do on the chromebook is Netflix SD, or borderline HD, and that is on the Chrome side. I really value the fanless design of the ARM, though I realize future Broadwell designs may be fanless, and Haswells can be quiet when not pushed.

tedm commented 9 years ago

@wenlock For my expectations with the chromebook, xiwi is fine, but almost any multimedia I do is on the Chrome side such as most browsing, all youtube, and netflix. (for audio I use a Pono) - so the need for sound and video acceleration in the chroot for my uses are not great. I guess with the steam, and games and all that more people are installing apps in the chroot that need good video acceleration.

DennisLfromGA commented 9 years ago

@dnschneid, @drinkcat,

I've just updated crouton and my chroot (both xorg and xiwi are installed - xiwi is active) but I seem to be unable to invoke 'xorg' at will. I'm using: sudo enter-chroot -n utopic exec env XMETHOD=xorg startgnome but it just hangs at - ... /usr/bin/xinit: XFree86_VT property unexpectedly has 0 items instead of 1 Also, when I try to use startkde I get someting similar: ... $DISPLAY is not set or cannot connect to the X server.

I've also changed /etc/crouton/xmethod to contain 'xorg' but it still hangs at the same point.

Is there another trick to getting xorg to work that I'm missing?

I can invoke 'xiwi' using: sudo enter-chroot -n utopic exec env XMETHOD=xiwi startgnome but that's to be expected since 'xiwi' is active (/etc/crouton/xmethod contains xiwi) and is listed first in /etc/crouton/targets.

The only way I've been able to switch between 'xorg' and 'xiwi' successfully is to change their order in /etc/crouton/targets. If I place 'xiwi' first:

xiwi,xorg,audio,cli-extra,gtk-extra,extension,gnome,kde,xbmc,chrome-beta

then 'xiwi' works, If I place 'xorg' first:

xorg,xiwi,audio,cli-extra,gtk-extra,extension,gnome,kde,xbmc,chrome-beta

then 'xorg' works.

Stumped, -DennisL

P.S.

crouton: version 1-20150106104255~master:3b56999a
release: utopic
architecture: amd64
targets: xiwi,xorg,audio,cli-extra,gtk-extra,extension,gnome,kde,xbmc,chrome-beta
host: version 6457.36.0 (Official Build) beta-channel falco
merah-putih commented 9 years ago

@DennisLfromGA

Perhaps it works with the newest crouton: crouton: version 1-20150107122507~master:3b348ad5 release: trusty architecture: amd64 targets: chrome,xorg,xiwi,extension,keyboard,xfce host: version 6310.68.0 (Official Build) stable-channel peppy

The XMETHOD option works in my case, that I can switch from xiwi to xorg (and vice versa) without any problem, using:

sudo enter-chroot -n trusty exec env XMETHOD=xiwi startxfce4 sudo enter-chroot -n trusty exec env XMETHOD=xorg startxfce4

The keyboard (UK layout here), in xiwi, still doesn't map correctly though ...

DennisLfromGA commented 9 years ago

The version I used was yesterdays and had the XMETHOD merged but maybe something has changed so I'll download an try again - just to be sure.

hsharrison commented 9 years ago

Just stumbled across this page and thought I would mention that this is working for me on an old chroot that's been updated through an iteration of targets, xorg --> xephyr --> xiwi --> xorg (accordingly xorg is listed first in /etc/crouton/targets).

startgnome launches xorg correctly; exec env XMETHOD=xiwi startgnome launches xiwi correctly.

dnschneid commented 9 years ago

Oh, right. Since #1305 got merged, this bug can be closed. The only remaining issue is #1294.

DennisLfromGA commented 9 years ago

@dnschneid & @drinkcat -

I cannot get my chroot to start with the desired XMETHOD using the example above (e.g.)

sudo enter-chroot -n trusty exec env XMETHOD=xiwi startkde or sudo enter-chroot -n trusty exec env XMETHOD=xorg startkde

I'm still getting: "$DISPLAY is not set or cannot connect to the X server."

Is there another, preferred way to do this?


In the interim, I've scripted another method that does it from both inside and outside the chroot. It's based on an idea I found on this site but for the life of me I can't find it again the give the person credit, I think he named his script setxwin.

This seems to be an often requested feature already and I think the script might be an easy way around it. I just threw it together and it needs a lot of clean-up but it works with both the old xserverrc-* link and the new /etc/crouton/xmethod file. Please checkout 'setxm' and feel free to comment on improvements, if you like.

-DennisL

dnschneid commented 9 years ago

startkde inside the chroot actually needs to be wrapped by xinit. Look at the startkde script outside of the chroot for details.

Your setxm script looks nice, but it doesn't reorder the targets, so updating the chroot will reset the method. Instead, I perhaps it'd be useful to add an x11 method parameter to enter-chroot that would set the environment variable; i.e., -X xiwi or something. Might be worth opening another bug for that though.

DennisLfromGA commented 9 years ago

@dnschneid,

Wow, that was easy, thanx! I just added 'xinit' to the command and it worked:

sudo enter-chroot -n trusty exec env XMETHOD=xorg xinit /usr/bin/startkde


...add an x11 method parameter to enter-chroot that would set the environment variable...

I thought about that and, as an experiment, I hard-coded it to enter-chroot (line 844) -

env -i TERM="$TERM" XMETHOD=xorg chroot "$CHROOT" "$@" || ret=$?

but it still tried to use xiwi so I guess I don't fully understand what or where to add the x11 method.

-DennisL

dnschneid commented 9 years ago

su drops most of the environment variables. So the place where it generates the export line in the "cmd" variable that gets passed to su, you'd want to add XMETHOD in there. A real implementation would also need to filter the variable's contents to avoid misbehavior.