ungleich-staticcms/content/u/blog/how-to-run-your-browser-in-the-cloud/contents.lr
Nico Schottelius 87f99512ce ++ update
2019-11-18 12:47:32 +01:00

95 lines
3.4 KiB
Markdown

title: How to run your browser in the cloud
---
pub_date: 2019-11-18
---
author: Nico Schottelius
---
twitter_handle: NicoSchottelius
---
_hidden: no
---
_discoverable: yes
---
abstract:
Finally, freeing my notebook from memory and CPU pressure
---
body:
So I have this problem: no matter which notebook I buy, some
applications are always to "heavy" for it. Notably running two
browsers has so far exhausted the available RAM on my notebook.
## The Pros and Cons of the cloud
For many years I have the strict policy to be able to work
autonomously with my notebook. So moving parts of what I use to the
cloud was rarely an option. I want to be able to work offline.
However this comes with a drawback that switching the notebook can be
a bit cumbersome. So I migrated to a git + nextcloud + imap
based setup in which all "small files" (notes, source code, etc.)
reside in git repositories and "big files" (photos, videos, etc.)
reside in Nextcloud.
One thing I always want to have locally, are my emails, which I read
in [emacs](https://www.gnu.org/software/emacs/)
(using [mu4e](https://www.djcbsoftware.nl/code/mu/mu4e.html)).
Using mbsync / isync this problem has also been solved - my mails are
local and remote.
## The browser
While you can make a joke about emacs consuming all my memory (it
stands for [Eight Megabytes And Constantly
Swapping](https://www.gnu.org/fun/jokes/gnuemacs.acro.exp.html),
doesn't it?), the real problem are actually browsers. It was a problem
on my 256MB RAM notebook in 1998 with Netscape Navigator, it is still
a problem with firefox and chromium and 16GB RAM in 2019.
Even if you are crazy and upgrade to a 32GB RAM notebook, like I did,
you finally become CPU bound! Yes, indeed, the tabs of my browser
consume all CPU cores - while it is idling.
There is an important discussion around why browsers use
so many resources and how to optimise this, however this is not the
focus of this post...
## The browser in the cloud
Working at [ungleich](https://ungleich.ch), literally less than
50 meters away from the [Data Center
Light](https://datacenterlight.ch), I was wondering whether or not I
can actually use one of our VMs to outsource my browser.
First check: does it make sense? I use the browser, to browse the web
and it is rarely of use in an offline scenario. So it is a possible
candidate for moving out of my notebook.
Second check: how would I access it? I potentially want to be able to
access it from anywhere, even without my notebook. Luckily we have
recently gained some knowledge about
[Apache Guacamole](https://guacamole.apache.org/), which lets me
access VNC, RDP and even SSH via the web. Guacamole also supports 2FA,
which is a nice add-on.
Sanity check: So... I can *use a browser to access my browser*
in the cloud. Does that actually make sense? And the answer for me is
yes, because instead of running many tabs, I only have to run 1 tab
locally and can outsource the rest.
## More in the cloud
Actually, what happens behind the scenes is that the VM is running VNC
(we are also experimenting with XRDP), so I have actually full access
to a remote Linux desktop via browser and can even run applications
like libreoffice, blender or gimp remotely.
Because I think it's a cool thing to have, our team at ungleich added
it as an offer to our [Black IPv6 Friday
Crowdfunding](https://swiss-crowdfunder.com/campaigns/black-ipv6-friday?locale=en).
Below you can actually see how it looks like:
![Desktop in the cloud](/u/desktop-small.png)