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

Switching between Linux and Chromeos #205

Closed justincecce closed 11 years ago

justincecce commented 11 years ago

After I open the linux os with "sudo startxfce4", if I switch back I to chromeos I cannot get back into linux. I use the shift/ctrl+forward, then I use shift/ctrl+refresh but it is refreshing into a black screen with just the mouse pointer. I can switch back to chromeos. Not sure what I am doing wrong. Thanks!

iRitwik commented 11 years ago

I have a similar problem. When I do "sudo startxfce4", ubuntu screen pops up but when I switch to Chrome OS and try switching back to Ubuntu, I get a black screen which wouldn't just go way. It says "Developer Console" on top and prompts for "localhost login" at the bottom. This prompt doesn't accept my Ubuntu username but does accept chronos and fires up a shell within a shell (probably). How do I get seamless switching between chrome os and ubuntu on a pixel?

tedm commented 11 years ago

If you are on the Samsung ARM, this happens when you hit ctr alt fwd key before the shift, then you get the vt2 terminal prompt. I'm not sure if this happens on the non ARM models too, but you may want to select the hot key sequence, so that the hot-keys for terminal are not hit before the chroot keys.

iRitwik commented 11 years ago

@tedm Yes you were right about that. Ctrl+Alt+Forward/Backward moves you back and forth from terminal mode on Chromebook Pixel even when Ubuntu isn't running. At the same time however, Ctrl+Alt+Shift+Forward/Backward doesn't do anything. I had a look at http://support.google.com/chromeos/bin/answer.py?hl=en&answer=183101 but it was no help. I would still like help on how to switch back to ubuntu. Thanks.

tedm commented 11 years ago

Those 4 keystrokes are specific to the Samsung. I'm not sure what the answer is for your pixel, but I think a lot of pixel users are successfully hot-keying back and forth. Can you enter the chroot from a crosh / shell to ensure that it's up and running?

dnschneid commented 11 years ago

It's ctrl+alt+forward followed by ctrl+alt+refresh to get back to the chroot.

DennisLfromGA commented 11 years ago

I've noticed different behavior since version 75d4ec244d / 'Always make the host Xauthority accessible, and make switching X meth…'

Sorry for my confusion but could someone explain what's going on with the switching key combos, displays, and vt's ?

The key combo Ctrl-Alt-Shift-F1/F2 seems to also work on the Acer C7 now and I guess all other Chromebooks. It looks like this is in addition to the older method using Ctrl-Alt-F2 & Ctrl-Alt-F3, etc. I'm not sure if the display is ChromeOS's like in Xephyr or if it's still assigning the next display & vt to the the other keys (too ?) like F4, F5, etc. This seems like kind of a big deal to me and I'm wondering if the older method is going to go away altogether...

Some clarification would be much appreciated.

dnschneid commented 11 years ago

Good question. A little history:

On x86 platforms (all but the Samsung ARM Chromebook), crouton can launch a standard X server. The X server allocates a new VT and gets full, segregated access to the video hardware, just like Chromium OS does. Switching VTs in X is performed by the Ctrl+Alt+F# shortcut, which is defined by X11. Switching VTs from a non-X VT is handled by the kernel, and is [Ctrl+]Alt+F#. R25 of Chromium OS had a patch that deactivated the shortcuts to switch to VTs 3 and up from the Chromium OS X server so that Chromium OS could repurpose them as keyboard shortcuts.

This meant that in order to get to the crouton X servers (VT3+), you would have to switch to VT2 (Ctrl+Alt+Forward) in order to be able to use the kernel's VT shortcuts to get to VT3+. That's the two-step switch that you're familiar with. This kinda sucks because 1) it takes two keyboard shortcuts to do a fairly common task, 2) it's hard to explain and easy to screw up, and 3) if you don't actually have a crouton X server running, you'll get stuck on VT3.

On ARM, the video driver cannot segregate the VTs' hardware access, so if you try to run a second native X server it clobbers and crashes the first, Chromium OS restarts it automatically, and yours then subsequently gets clobbered. Yuck. So ARM enforces the Xephyr approach to creating an X server (you can enable this on x86 by explicitly using -t xephyr), which creates a nested X server (an X server as an X client...yo dawg) and uses ratpoison as a full-screen window manager to switch between them. This lets them coexist, but you lose any hope of hardware acceleration on any platform. Importantly, Ctrl+Alt+F1 and Ctrl+Alt+F2 still switch VTs, so ratpoison needed a new shortcut to cycle between chroots. I chose Ctrl+Alt+Shift+F1/F2 as it's similar to the VT-style switching, is unlikely to be taken by Chromium OS in the future, and the arrows explain the cycle direction. These shortcuts are nice because they're foolproof and scale well with lots of simultaneous chroots (not a common use case, but whatever).

Now we have two sets of shortcuts and two sets of instructions, new users generally aren't good at guessing which one they need to use, and bloggers tend to report one or the other without giving any context, leading to more confusion. And did I mention that getting stuck on VT3 really sucks? You have to reboot, as far as I can tell. Gross!

The last component is that with Xephyr, the chroot now has the information it needs to make use of the host's X11 server, which is pretty convenient for a variety of things. Before, if you didn't install Xephyr, you wouldn't have access to the host's X11 server, but if you did and were on X86, you'd lose the hardware-accelerated X11 method. More yuck.

So I made things more consistent. Now the chroot always knows about the host's X11 server (via the host-x11 command), and you can independently switch which X method to use (by upgrading the appropriate target). Finally, I added to the X11 target a keylaunch (keyboard shortcut daemon) config that runs a script to detect which VTs have X11 servers on them, and cycle to the next/previous one. Binding that to Ctrl+Alt+Shift+F1/F2 means the keyboard shortcut seems to do the exact same thing regardless of platform or X11 method.

Rest assured that on x86, it's doing the same thing you'd have to do manually with VT switching, but without the multiple steps or potential for error. You can, of course, still manually switch; those keyboard shortcuts are controlled by Chromium OS and are unlikely to disappear anytime soon. But I personally like the smart cycling way better...you can even script it by running crouton-cycle in the chroot.

tl;dr: new version has a +3 convenience buff for x86 with no compromises.

tedm commented 11 years ago

one problem with the 4 keys is that if a new crouton user presses 3 of the keys first (shift last), they get into vt2, and there's no message to just press ctrl alt left arrow to get back to chromeos and try again.

Or, they might login from vt2 and enter-chroot which appears to work for awhile, but eventually can just crash and reboot (on the ARM in dev channel)

what are folks using vt2 for, and is it stable in the stable or beta channels with a crouton chroot running?

DennisLfromGA commented 11 years ago

Thanx David for the history lesson and the humor; I was never good at history but I think I got most of what you were trying to convey. I'll use the xephyr switchng method in the future which is a lot simpler and won't leave me stuck on vt3 when I forget if I've got a chroot running or not....

tonymurray commented 10 years ago

Thanks for the post - I did not know about Ctrl-Alt-Shift -> Very useful! I have an Acer 720p. I don't experience getting stuck on VT2 or VT3; however I have noticed that it's necessary to release the ctrl-alt keys, and press them again to continually cycle between VTs