
Free Linux cloud shell for Gmail users - mondainx
https://console.cloud.google.com/cloudshell/editor?pli=1&shellonly=true
======
thesandlord
(I work for Google Cloud)

If you want to learn more about Cloud Shell, the marketing page is here:
[https://cloud.google.com/shell/](https://cloud.google.com/shell/)

Cloud Shell is one of my favorite things about GCP. A lot of dev tools
(Docker, Python/Go/Node/Ruby/Java/.Net, etc) are pre-installed, you can test
"localhost" servers with the preview feature, there is a built in file editor
(based on the open source Orion project), etc. And it's all free!

This link will directly open the shell in a full page, and I'm not sure it
will work unless you have set up your GCP account before. It's really not
designed to be opened this way, I recommend opening it from the GCP console
and then making it full screen if your want.

Also note: Cloud Shell gives you a persistent 5GB /home Directory, but every
other folder is reset after a while. If you want to add your own binaries, I'd
recommend adding home to your path and installing them there.

~~~
toyg
Can I give you a tidbit of feedback?

If the instance is ephemeral, I need to manage everything in HOME and that's
fine. For Python, that basically means using Virtualenv. That works fine at
the moment for python 2.7, but 3.x on Debian requires the package
python3-venv, which is not installed by default - and sure enough, it's
missing in Cloud Shell.

It's a bit annoying having to apt-get install python3-venv every time. Any
chance it could be preinstalled? It's such an essential tool for modern python
development...

~~~
traverseda
You can tell virtualenv to use an arbitrary python interpreter, even pypy,
using `--python=/path/to/python/interpreter`.

~~~
toyg
But then I have to install the virtualenv script in every dev environment,
when really the stdlib version is perfectly fine and requires no extra hacks.

It's an annoyance specific to Debian and to this day I'm not sure I understand
the rationale for splitting it out of the main python3 package.

------
jwilk
Before you get excited, read about limitations:

[https://cloud.google.com/shell/docs/limitations](https://cloud.google.com/shell/docs/limitations)

------
derefr
And if you'd rather use something on a higher level of abstraction, there's
also Google Apps Script
([https://www.google.com/script/start/](https://www.google.com/script/start/))

From one way of thinking, Apps Script is a lot like AWS Lambda; but from
another way of thinking, Apps Script is more like OS automation workflows that
happen to run in your cloud account rather than on your computer.

~~~
ameliaquining
Personally, I think of Apps Script as being more like the cloud-based
equivalent of VBA.

------
jwilk
It's available for to anyone that has a Google account.

You don't have to be a "Gmail user".

~~~
alberts00
You do need to register as a business if you are located in EMEA. There is no
private/personal option. This is a huge showstopper for me and, in my opinion,
anyone who wants to use it for educational purposes.

~~~
toyg
_> You do need to register as a business if you are located in EMEA._

Is that a T&C rule or a technical block? Because I'm in EMEA, not registered
as a business, and it opened for me just fine.

~~~
alberts00
It's inquired when you first register for GCP. If beforehand you've selected
EMEA country there will be no option to choose between personal/business.

GCP support did respond to my inquiry and they specified that it's the case in
whole EMEA.

P.S I just tried and it appears they've added option to switch to
"Individual". Great!

~~~
jwilk
You don't have to register for GCP to use the cloud shell.

------
decentrality
With my Google Chrome 64.0.3282.119 instance, there is no user selector it
seems, which is causing authentication to fail, which then causes an
infinitely repeating loop of reconnection attempts all leading to a 404 or 401
response in JSON.

~~~
cavisne
+1, not having the user selector on this is a pain, more than once ive spun up
some resources on a personnal account accidentally

------
emmelaich
Wow, even has dotnet. Including C#, F# and Visual Basic.

    
    
        $ find /opt/dotnet/ -name \*.sh
        /opt/dotnet/sdk/2.0.0/Roslyn/RunCsc.sh
        /opt/dotnet/sdk/2.0.0/Roslyn/RunVbc.sh
        /opt/dotnet/sdk/2.0.0/FSharp/RunFsc.sh
        ....

------
seoguru
This is nice. If we could ssh into it, it would be _great_! Is that feature
coming soon?

~~~
thesandlord
I don't think that feature is planned. However, you can get a f1-micro VM for
free:

[https://news.ycombinator.com/reply?id=16248668&goto=item%3Fi...](https://news.ycombinator.com/reply?id=16248668&goto=item%3Fid%3D16247577%2316248668)

------
mschuster91
How does this work? Given that its PID1 is not a "real" init process but a
bash running the script `/google/scripts/onrun.sh` and its / being type
`aufs`, I guess this is a Debian Docker instance?

~~~
emmelaich
Yep, /etc/debian_version is 9.3.

It has a docker0 network interface (among others)

~~~
mschuster91
> It has a docker0 network interface (among others)

That's for the dockerd which is running inside the ... VM?

The interesting thing is that the uptime and dmesg show that this system is
not shared on the kernel level - if I were to guess, I'd say that Google
allocates a real virtual machine with a tiny OS running Docker, starts the
docker container inside this VM and then grants you webshell/ssh access to
this Docker container.

But why the Docker setup when the machine is yours anyway?

~~~
emmelaich
You're right... and docker works:

    
    
        $ docker pull hello-world
        $ docker run hello-world
    
        Hello from Docker!
        This message shows that your installation appears to be working correctly. 
        ....
    

Not surprising since two of the outgoing ports allowed are 2375 and 2376 --
the docker non-ssl and ssl ports.

~~~
Shoothe
A minor note: docker run will download the image if it's not already present.
No need to pull manually (unless you want to go offline or something like
that).

------
asadlionpk
This looks cool. I wonder how does the sandboxing work since it looks like
docker but some things are different.

I am curious because we made a somewhat similar tool for conducting
interviews[1] but ours has collaboration too.

[1] [https://codepad.remoteinterview.io/](https://codepad.remoteinterview.io/)

------
mikeymop
Wow, Debian 3.9 kernel.

Has ssh, vim, tmux, and docker installed. I'm guessing this is either a
container itself or a Debian vm.

I'm still finding new things that are installed and useful. I would find
myself using it to QA docker compositions I write. The question is can I host
from this instance?

~~~
audscias
It's a container. And what do you mean by host? You can definitely run
containers in it, and an ephemeral external IP. There is a button at the top
right that shows what you are running on port 8000 from the outside, handy to
test whatever you are running.

------
netrc
Would be great for your shell to automount your Google drive. (I know Google
Drive isn't a real distributed file system, but the point stands... and if
GDrive doesn't work, how about Google making an actual distributed/network
file system that I can own for this purpose, like AWS EFS?)

------
supervillain
Interesting, upon 'ps aux', There's a 'sleep infinity' process running.

~~~
dvlsg
Docker maybe? I know that's one way to keep a docker container open.

------
tritium
Does this have something specific to do with Gmail? Or is it just that it’s
another thing (a separate, independent feature of your Google account) that
you get for free, as part of being a Gmail user?

~~~
thesandlord
This has nothing to do with Gmail. It is part of Google Cloud. Both Gmail and
GCP use your Google Account. The title is misleading.

(I work for Google Cloud)

------
massimosgrelli
I run sudo npm install -g n and then sudo n8.9.4 but I got an error "sudo: n:
command not found". How can I use n?

------
ryancnelson
is this down at the moment? (Sat Jan 27 23:18:48 UTC 2018) the ux seems to be
hanging, trying to contact
[https://ssh.cloud.google.com](https://ssh.cloud.google.com) ...

"slashdotted?", or whatever the hackernews term for that is?

~~~
ryancnelson
... of course, moments after i posted this comment, it started responding
again. Growing pains, I suppose, or temporary burp.

~~~
lallysingh
Delay for spinning up new instances?

------
h43z
Interesting how they make use of tmux sessions for the cloud shell session
feature.

------
ShabbosGoy
I setup an IPSec tunnel on it a while ago just to test , pretty neat IMO

------
Cyberis
Wow, I find GCP to be much less straightforward to use than AWS.

------
jacksmith21006
This is pretty cool. Thanks for sharing.

------
wklm
can I ssh into it? does it have a public ip?

~~~
thesandlord
If you want a free Linux box with a Public IP and SSH, I'd recommend spinning
up an f1-micro VM. It's part of the permanent free tier:

[https://cloud.google.com/free/](https://cloud.google.com/free/)

Cloud Shell is a "temporary" instance, really meant for interactive Dev/Admin
work.

(I work for GCP)

~~~
e12e
Thanks for taking the time to comment. I wasn't aware there was a free tier. I
really appreciate that it's an _actual_ free tier:

"Thanks for signing up for the 12-month free trial.

We've given you $300 in free trial credit to spend. If you run out of credit,
don't worry, you won't be billed until you give your permission."

[ed: and as mentioned above there are instances that don't consume any of
those 300 credits]

~~~
thesandlord
So there is the free trial and the free tier.

The free trial is $300 for 12 months that you can spend on pretty much
anything (I think there are some limits on GPUs due to abuse).

The free tier is free forever, no dollar limits or time limits. This includes
the 24/7 f1-micro, 28 App Engine hours per day, Cloud Datastore, Firebase
stuff, some Cloud Functions, etc.

~~~
devereaux
In the free tier, is it "fair game" to run 10 instances of the f1-micro?

I would like to test the throughput, measure uptime over a few months, and
check how well it handles DDOS. I would configure 10x static IPv4 and IPv6 to
make sure it does not impact anyone else.

I plan to setup a nginx serving a few static pages with a Round Robin DNS on a
subdomain.

~~~
thesandlord
Free trial, yes. Free tier, no.

Basically the free tier subtracts the cost of a f1-micro from your monthly
bill if you have at least one running.

~~~
devereaux
Thanks for the precision! It avoids a bad surprise :-)

Do you know if a f1-micro can cost more than $4 per month if it is used
extensively? By that, I just mean 100% cpu usage, 100% of the 5Gb disk quota,
with just 1 IPv4 and 1 IPv6.

I like the scalability, but I want my clients to know that their bill will not
"fluctuate".

Cost-wise, $40 for 10 IPv4 is in the upper tier (some OVH resellers give you
16 IPv4 on some decent dedicated server) but for what I need (low latency),
the wide geographic coverage could still make it worthwhile.

~~~
thesandlord
Network Egress is not included in the price, so you have to keep that in mind.
Ingress is free. Otherwise, feel free to use 100% 24/7.

------
alexdong
Python 2.7 by default?

~~~
toyg
Python 3.5 is also preinstalled.

------
daurnimator
No Lua preinstalled

------
supervillain
No Ruby Pre-installed.

~~~
emmelaich
Works for me.

$ ruby --version ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-linux]

------
sneak
Last I looked, Cloud Shell was still pretty tiny instances, with no paid
option for more (wth isn’t there a super boost mode that I pay for, at
least?!), and the integrated editor was meh. I suppose I could use it with the
gcloud CLI and docker-machine as a sort of orchestration console to bring up
more boxes, but then I have to remember to kill them or I get a huge bill.
(This has happened to me on DO before.)

AWS Cloud9 lets me pay for a single big honkin ec2 that backs the IDE, has a
better editor, browser ssh support—and has a built in option to suspend the
“expensive” instance after 30 mins of inactivity.

I loved Cloud Shell but the inability to let me pay for a bigger backing
instance or more storage is a real limitation. (One of my commonly worked on
projects takes 25 mins to compile on a boost mode Cloud Shell instance, and
operates on ~80GiB of data.) Cloud9 is at a real advantage here.

Whoever first integrates Atom, though (all of these seem to use Ace), I think
will be the real winner.

~~~
wyclif
_the integrated editor was meh_

Cloud Shell has Vim 8 installed, which you can use instead.

~~~
sneak
I meant the local one. Remote editing over ssh is a nonstarter.

