GCP Cloud Shell & TMUX Sessions

1,774 views
Skip to first unread message

Christophe R. Patraldo

unread,
Aug 13, 2019, 12:37:46 PM8/13/19
to gce-discussion
I create a named tmux session in cloud shell.  I open multiple windows within the session.  I leave it be or I detach it.  It times out.  I reconnect.  I try to attach session by name.  I invariably get no session.  Well, not quite.  It depends on whether I have tmux integration checked.  (See tmux settings.)  Shouldn't I be able to attach my named session by logging into the console and accessing the cloud shell?  Or this this impossible because of the ephemeral nature of cloud shell? 

Alexandre Duval-Cid

unread,
Aug 13, 2019, 7:48:30 PM8/13/19
to gce-discussion
hello,

Google Groups is generally a venue for outages, and architectural discussions. Vm and cloud shell issues are more suited for a forum such as Serverfault.com[1], they have a friendly active community that takes great pleasure in digging into these particular VM configuration issues.

Justin Reiners

unread,
Aug 13, 2019, 8:11:47 PM8/13/19
to Christophe R. Patraldo, gce-discussion
"Custom installed software packages and persistence

The virtual machine instance that backs your Cloud Shell session is not permanently allocated to a Cloud Shell session and terminates if the session is inactive for an hour. After the instance is terminated, any modifications that you made to it outside your $HOME are lost."



I've used Google Cloud for a while, and I learned quickly that the cloud shell isn't a VM that stays alive all the time. if you need to run crons or have an always-on VM you need to use compute engine for that.




On Tue, Aug 13, 2019 at 11:37 AM Christophe R. Patraldo <ch...@pinchepoutine.com> wrote:
I create a named tmux session in cloud shell.  I open multiple windows within the session.  I leave it be or I detach it.  It times out.  I reconnect.  I try to attach session by name.  I invariably get no session.  Well, not quite.  It depends on whether I have tmux integration checked.  (See tmux settings.)  Shouldn't I be able to attach my named session by logging into the console and accessing the cloud shell?  Or this this impossible because of the ephemeral nature of cloud shell? 

--
© 2018 Google Inc. 1600 Amphitheatre Parkway, Mountain View, CA 94043
 
Email preferences: You received this email because you signed up for the Google Compute Engine Discussion Google Group (gce-dis...@googlegroups.com) to participate in discussions with other members of the Google Compute Engine community and the Google Compute Engine Team.
---
You received this message because you are subscribed to the Google Groups "gce-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gce-discussio...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gce-discussion/fa854274-27ad-4eef-ab53-68e9e039e819%40googlegroups.com.

Ashik M

unread,
Aug 14, 2019, 3:57:41 PM8/14/19
to gce-discussion

Hi Christophe,

I do agree with Alexandre and Justin but just to add to the point if anyone else was wondering:

"When you start Cloud Shell, it provisions a g1-small Google Compute Engine virtual machine running a Debian-based Linux operating system. Cloud Shell instances are provisioned on a per-user, per-session basis. The instance persists while your Cloud Shell session is active and terminates after an hour of inactivity.
" [1] 

Compute products like Compute Engine or Even Kubernetes Engine  is your best resource for performing the type of operation you are trying to accomplish if you require long term access to resources and stateful data.  

If you're having issues with persistent of your communication with your project or are managing multiple projects in tandem, you can consult the concept of configurations with gcloud [2]


On Tuesday, August 13, 2019 at 12:37:46 PM UTC-4, Christophe R. Patraldo wrote:
Reply all
Reply to author
Forward
0 new messages