Closed DennisLfromGA closed 9 years ago
IMHO it sounds to me that if that was possible you should have a security issue on chromeos. The command would need to run as root as it is now.
I think this kind of falls into the same category as the new Multi-profile feature - once you're in, you're in...
Hmm, no there shouldn't be a way now when I am in chromeos, to run a root command accept from opening a cross window myself and go to the shell. That is what I like about chromeos. Running a command as root shouldn't be possible from some kind of chrome app. This doesn't mean there is no way, maybe a background app that adds an overlay button to chromeos. However that would still mean you need to start it manually on a reboot from the commandline. So "once you're in, you're in..." is not correct in my opinion.
Well, if you've already started the chroot and it's running in the background, switching between the two doesn't require root. This is actually what I implemented on the extensioncycle branch, but it's waiting for smartcycle to get merged. Basically, the crouton extension lists the running chroots and you can switch to them with a mouse click.
I've been using the 'smartcycle' branch on my new chroots of late because I like it so much. I haven't tried the 'extensioncycle' branch, frankly, because I was unclear of it's purpose. You've piqued my curiosity now though with the description of switching with a mouse click, I'll try it next...
I'm testing @drinkcat's 'separate_partition' branch right now and it's awesome! No fear of powerwashes anymore... :)
Rebased that branch.
Thank you.
@dnschneid Nice. I assumed you also needed root to switch between screens, because if I use chvt on the command line I need to run it as root to let it work.
It looks like in my chroots the setuid permission is set on 'chvt' -
-rwsr-xr-x 1 root root 5516 Apr 29 2012 /var/crouton/chroots/wheezy-cb/bin/chvt
but not in crosh -
-rwxr-xr-x 1 root root 11K Mar 12 00:29 /usr/sbin/chvt*
Nice. I assumed you also needed root to switch between screens, because if I use chvt on the command line I need to run it as root to let it work.
The trick here is that the extension asks the websocket server (running in the chroot) to switch VT. And as Dennis pointed out, chvt
is SUID inside the chroot.
@drinkcat thanks for the explanation.
It's naturally no complete solution, but I'm quite happy with it. I start the following script in a ssh/crosh chrooted shell, and when i want to switch to the XFCE session, I go to the window using Alt-tab or the mouse, and press any key.
#!/usr/bin/perl
use strict;
use warnings;
use Term::ReadKey;
ReadMode 3;
print "
█╗ ██╗███████╗ ██████╗███████╗
╚██╗██╔╝██╔════╝██╔════╝██╔════╝
╚███╔╝ █████╗ ██║ █████╗
██╔██╗ ██╔══╝ ██║ ██╔══╝
██╔╝ ██╗██║ ╚██████╗███████╗
╚═╝ ╚═╝╚═╝ ╚═════╝╚══════╝
### Press any key to switch to XFCE ";
while (my $char = getc()) {
`croutoncycle next`;
}
This now exists alongside the xiwi stuff.
This question was originally posted in the Google+ 'Crouton Users' community by Amith F. and I'm simply posting it here for more visibility - and hopefully some input.
Is there a way to toggle XFCE and ChromeOs with just a mouseclick? (for instance by clicking on a button).