Crostini questions

331 views
Skip to first unread message

Jo Shields

unread,
Jun 11, 2018, 8:53:01 PM6/11/18
to Chromium OS Development
Hi,

I'd like to try and enhance the experience using my Linux desktop software inside Chrome OS, by detecting that condition & following some better-integrated Chrome OS specific code paths.

I'm sure I'll run into more of these over time, but for now:

* How can I properly detect that I'm running inside the container? For example, with Flatpak, I get a file - /.flatpak-info, which not only lets me know I'm in that environment by existing, but also tells me some information I can make use of (such as whether certain developer features are enabled in the sandbox or not). Is there any equivalent?
* How can I launch a Terminal window from inside the sandbox? For example, in an IDE, if using "run on external console", I'd rather use the native Chrome OS terminal app rather than spawn off a different terminal emulator. Extra points if I can just pass a flag (like XTerm's -e) to run the named command inside the same container instance, which would allow for seamless "run on external console" style behaviour in an IDE.
* How can I add an app to the Chrome OS launcher menu? Is there somewhere I can put a .desktop file, for cleaner integration? e.g. to have a clickable icon to launch Android Studio

Jo Shields

unread,
Jun 12, 2018, 12:27:36 AM6/12/18
to Chromium OS Development
* How can I detect whether the system is in developer mode or not (e.g. whether I can expect `adb` to connect, as per https://developer.android.com/topic/arc/studio)

Keith I Myers

unread,
Jun 12, 2018, 9:10:44 AM6/12/18
to hexxi...@googlemail.com, Chromium OS dev
Here are a few of the answers that I have been able to dig up after playing with it for a few weeks, 

* How can I properly detect that I'm running inside the container? For example, with Flatpak, I get a file - /.flatpak-info, which not only lets me know I'm in that environment by existing, but also tells me some information I can make use of (such as whether certain developer features are enabled in the sandbox or not). Is there any equivalent?

I have had absolutely no issues with running Flatpak applications, I am not sure why you mean by developer features being enabled or not as Crostini is a pretty stock Debian 9 setup with full root access out of the box. 

* How can I launch a Terminal window from inside the sandbox? For example, in an IDE, if using "run on external console", I'd rather use the native Chrome OS terminal app rather than spawn off a different terminal emulator. Extra points if I can just pass a flag (like XTerm's -e) to run the named command inside the same container instance, which would allow for seamless "run on external console" style behaviour in an IDE.

I personally use Gnome Shell, or Xterm instead of the ChromeOS Crostini Terminal App after a update broke it (which as been resolved). Applications that need to launch a console just work, I have never had any issues. 

You can set this via 
sudo update-alternatives --config x-terminal-emulator

* How can I add an app to the Chrome OS launcher menu? Is there somewhere I can put a .desktop file, for cleaner integration? e.g. to have a clickable icon to launch Android Studio

Crostini seems to pull .desktop icons from /usr/share/applications, I have not been able to get it to work any other way. 

* How can I detect whether the system is in developer mode or not (e.g. whether I can expect `adb` to connect, as per https://developer.android.com/topic/arc/studio)

The system should not need to be in developer mode for ADB to work if you want to connect to Android Devices. At this time however only ADB over WiFi works so you cannot use the more reliable USB method. 


On Tue, Jun 12, 2018 at 12:27 AM 'Jo Shields' via Chromium OS Development <chromiu...@chromium.org> wrote:
* How can I detect whether the system is in developer mode or not (e.g. whether I can expect `adb` to connect, as per https://developer.android.com/topic/arc/studio)

--
--
Chromium OS Developers mailing list: chromiu...@chromium.org
View archives, change email options, or unsubscribe:
https://groups.google.com/a/chromium.org/group/chromium-os-dev
---
You received this message because you are subscribed to the Google Groups "Chromium OS Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-os-d...@chromium.org.


--
 
--
Keith I Myers
 


Roger Tawa

unread,
Jun 12, 2018, 10:19:14 AM6/12/18
to keithiok...@gmail.com, hexxi...@googlemail.com, chromium-os-dev
To detect if I am running on in a crosvm, I do:

if [ -e /etc/apt/sources.list.d/cros.list ]; then
  # in crosvm
fi

Probably not a good long term solution, but works for now.

Thanks,
Roger

-

Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages