yashsingh1/xdaforums huggingface dataset:
[Android] icantlogin:
Ah, this is a great idea! It's crazy how much RAM you need to build LineageOS these days. My poor laptop doesn't suffice anymore :( It's been fun to explore Google Cloud VMs for the past day though, thanks for the tutorial :)

A few notes from 2022:

The current length of the free trial is 90 days or until you use up the $300 credit, whichever comes first.

During the trial you're limited to 8 vCPUs, I guess a sensible choice today would be picking the 'COMPUTE-OPTIMIZED' Machine family and then an 8 vCPU, 32 GB memory Machine type (availability might vary per region though).

For boot disk, pick Ubuntu 20.04 LTS - x86/64, amd64.

DON'T ALLOW HTTP(S) traffic in the firewall, this is meant for setting up a webserver, we don't need this and it creates an unnecessary security risk (I guess OP misunderstood what this was for).

Edit: meanwhile I learned that if you do allow HTTP traffic in the firewall, you can later use sudo python -m http.server 80 to temporarily start a webserver and easily download your generated files to your own computer by approaching your VM's external IP address through a web browser. Very handy!

When in the SSH terminal for the first time, run these commands:

sudo apt update

Prevents package not found errors when installing build packages

sudo apt upgrade

Applies the latest software and security updates, always a good idea

sudo apt install python-is-python3 unzip

Fixes python not found errors and installs unzip for unzipping Android platform tools.
[Android] edsmat:
as you did ?
[Android] Kevinjoa:
You can check it by yourself (by choosing the country, for example Germany), still a nice thing for people who can get trial as private person in another country. :)
[Android] arvinquilao:
For users with knowledge about setting up web servers:

I think the Ubuntu 14.04 vm has apache web server set up already. You can test this by typing the External IP to a browser. The external ip can be found beside the SSH button from the console page. If apache is set up correctly, it will show a "Hello World!" page. You can then copy or move the zip files from the /out directory to the /var/www/html folder (delete or rename index.html first so it doesn't load the "Hello World!" page).

This is how I copy the rom zip so it can be accessed and downloaded directly from the browser:

And this is how it will appear in the browser:

I only use this method for private testing before uploading my files to other hosting sites like Google Drive or AFH.

Other solutions can be read here: https://cloud.google.com/compute/docs/instances/connecting-to-instance#standardssh

Edit: And just to add, there's also the Cloud Console app from Play Store which you can use to access the vm instance from your smartphone. I already tried using it to compile CM-13.0 using my Android One phone. :)
[Android] nitin.chobhe:
Yeah, that's the beauty ;) and you are not uploading it to cloud storage, you are doing it on the cloud itself. Your PC is a dumb terminal, all the action is done on the Google Cloud

Yes

Thanks for sharing this information (I might add this in the second post). I was not knowing this :)

Nitin
[Android] zhuoyang:
After your trial end you can try Microsoft Azure and DigitalOcean (there's a $10 coupon , which will be sufficient for few build)
[Android] nitin.chobhe:
Yes, the basic idea it to learn building the ROM without spending days time in syncing the repo and time required for building :highfive:

I faced this issue when I started learning building the ROMs

Nitin
[Android] arvinquilao:
I'm also amazed at how fast Google Cloud platform performs the initial repo sync (~10 minutes).
[Android] Adromir:
If it is just me, or are the pricing pretty high after the trial period? I put some data in the pricing calculator and it gave me a monthly cost that is like 10x of my dedicated root server. So although I really appreciate the effort in this guide, i don't see a benefit in it for people wanting to build their own roms from source, because after 2 month they need to stop building or pay a price (if i wasnt missing anything) which lies several times over other options.
[Android] hackslash:
The 500 GB SSD has a flat rate of $85/month (I don't know whether they charge for transactions on Persistent SSD).

And don't forget to shut down the VM after you have used it. The prices are calculated on effective hourly basis and can save you money if you decide to use it after the trial period ends.

And another thing, on which processor these VM are running? (Intel Xeon ?????)
[Android] nitin.chobhe:
The pricing totally depends on the usage. And the purpose of this guide is to make people aware of the possibility of building the rom on server.

In 2 months an average can learn about building. Then he has to decide whether to continue with Google cloud or rent some other cheaper server :D
[Android] STRYDER~007:
If I understand it correctly,it uses your machine's hardware to build. Cloud is just a VM instance connected to your PC. So whatever specs you have, it'll be built according to it.It'll take time according to the processor you have.(i5, i7 etc) Please correct me if I'm wrong! :D
[Android] hackslash:
Cloud VM is a completely different thing. It doesn't uses your PC resources for anything. It's a virtual instance running on Google Cloud servers hence it shares resources such as CPU, RAM and Disk with the cloud servers. You only need an internet connection to access the cloud server and you can access that server using any kind of PDA.

Most mainframe servers use Intel Xeon processors as they literally support more than 4 TB of RAM. I already have a cloud instance with Microsoft Azure as a Student incentive and it is based on Quad Core Intel Xeon E3 processors with 20 GB SSD and 6 GB RAM. So that's why I was considering signing up for a trial with Google Cloud.
[Android] STRYDER~007:
Thanks for the clarification! If that's the case,I'm signing up for cloud right now! :p
[Android] nitin.chobhe:
Yes, what [MENTION=6435663]mfbcool[/MENTION] explained is correct. That's why the cloud came in to existence - to avoid the usage of local hardware (which in most of the cases is very mean ;))
[Android] pranavthombare:
[MENTION=5044214]nitin.chobhe[/MENTION] this is a great guide. thanks a lot for sharing this. i tried and just wanted to ask that since i own a oneplus one, i'll be needing proprietary files via the usb cable. how can i achieve that. and i face number of warnings, is it okay or i'm doing something wrong? what warnings? various. like warning: unused parameter 'x' . And how much time does it takes? :p
[Android] nitin.chobhe:
One Plus One is supported by various ROMs (CM is the major one). You can take the proprietary files from them. No need to extract them from your deice. That is easier.
[Android] Ab20000:
oK u do this but what happens after this trail period? how much we have to pay per rom then??
[Android] HypoTurtle:
I believe it's $0.18 per GB per month; with there being price breaks at certain GBs
[Android] hackslash:
As you're using an SSD, your SSD will cost you $85 (flat price) per month (Only Standard Storage have prices which are determined by number of transactions but they offer quite low IOPS and disk speeds making them non-ideal for ROM development). The VM Instance (4 Core, 15 GB RAM in this case) costs $0.05 per hour.

So for example, your run your instance on 500 GB SSD for 2 hours, 5 days a week, your VM cost would be roughly $8.69/month and SSD will be $85/month. Your total monthly bill would be approximate $94/month.
[Android] rirozizo:
I love you :D
[Android] hackslash:
Just a small note to everyone building on cloud server:

Don't close the SSH connection during the build. It's obvious as all processes will be terminated which means your build will be stopped.

However, if electricity is unreliable (and you have no backup power supply), use screen!

Before you start building type this in SSH terminal:

screen

Screen biggest advantage is that it allows you to detach your current session allowing you to run it in background. So even if SSH connections is closed, the build is running in background.

After you have executed the make command i.e. you have started the build press Ctrl + A + D. This will detach your current session and will allow it to run in background. Now you can simply logout from the SSH connection.

If you want to jump back to that detached session enter this in terminal:

screen -r
[Android] nitin.chobhe:
Wow, this is good information. Thanks for sharing :good:
[Android] Ab20000:
I did repo sync on my laptop it was fine
[Android] nitin.chobhe:
Using Google Cloud? Or you did it on your machine? How much time did it take?
[Android] Ab20000:
Sadly 8 hrs on 4mb Internet.
[Android] wingedpanther:
One of the best guide.

Thanks for your detailed explanation
[Android] #Vangreen:
Ok I bulid rom

But how I can download it or upload it on cloud ?

I don't know how to use ssh client :/
[Android] nitin.chobhe:
Wow, congrats!

How to download - You can read last 2-3 pages, it had been explained
[Android] hackslash:
Why don't you use SFTP protocol for downloading files (works at the same port as SSH).

Download any SFTP client (such as MobaTerm Terminal or BitVise SSH Client, search for them in google)

Your VM will have a public IP address. You can find it in your Instance settings (unfortunately, I don't know the exact location of this setting as I don't use Google Cloud Platform).

Now using the client you downloaded, connect to your Instance using the IP address you obtained from above step and your User name / Password combination.

After connection is established, the client will open a File Explorer like interface allowing you to navigate through directories, download files, delete files, just as in Windows file explorer.

You can now simply navigate to the folder where the zip is located, right click the zip file and hit download. The zip will now be downloaded to your host computer.
[Android] #Vangreen:
[MENTION=6435663]mfbcool[/MENTION] My user name is that form google acount or this in terminal? I cant login to sftp :/
[Android] hackslash:
It's your user name in terminal.
[Android] #Vangreen:
[MENTION=6435663]mfbcool[/MENTION]

I have this error

Status:	Łączenie z 104.197.247.166...

Odpowiedź	fzSftp started, protocol_version=5

Polecenie:	open "pawelwangryn0@104.197.247.166" 22

Polecenie:	Ufaj nowemu kluczowi hosta: Raz

Błąd:	Disconnected: No supported authentication methods available (server sent: publickey)

Błąd:	Nie można połączyć się z serwerem
[Android] hackslash:
If this could be in english.....

However, from my understanding, it seems that Google has blocked SSH connections from other clients.
[Android] #Vangreen:
I was wandering the problem. I upload zip file to git repo ;)

Thanks for Help :D
[Android] piskor:
From my understanding he need authentication by ssh key and need to follow for example this http://www.petefreitag.com/item/532.cfm
[Android] hackslash:
Oh! I just forgot about SSH keys! I have googled about it and you're right. [MENTION=6282138]Vangreen[/MENTION] you need to create a SSH key pair to connect to your instance using external clients. Follow this awesome guide right from Google: https://cloud.google.com/compute/docs/instances/connecting-to-instance
[Android] darjwx:
So there's no possibility to use it in Europe if you don't have a business?
[Android] #Vangreen:
I use it in europe. I don't have any problem.

ЛГ
[Android] darjwx:
Did you leave blank the part of the business?

Thanks for the answer
[Android] #Vangreen:
I don't remember but i think yes.

ЛГ
[Android] Markinb66:
Thank you for this great guide, you can compile the ROM for the LS990. Thank you. Sorry for my English.
[Android] nitin.chobhe:
Using this and the guide that's linked at the end of the first post, you yourself can build the ROM that you want...
[Android] Markinb66:
Sorry. I said already built the ROM, I'm using google translator and there are words not put them translated. Sorry for my English.
[Android] nitin.chobhe:
Wow, congratulations! :highfive:

What ROM did you build BTW?

Nitin
[Android] MZO:
Good work mate! :D will use this guide hopefully after 2 years lmao

P.S. Muhammad Hamza here :p
[Android] nitin.chobhe:
Lol... You don't need this when you have Amy's build server ;)

Nitin
[Android] Markinb66:
Dirty Unicorns thanks to your great guide. But still I can not prove it because I could not pass it to the PC.
[Android] nitin.chobhe:
Why can't you pass it to PC? Use basketbuild or AFH.

If you are not having ftp account there, refer this post: http://xdaforums.com/showpost.php?p=66486381&postcount=43

You can host it on local and then easily copy it :good:

Nitin
[Android] MZO:
Lol not any more haha, I am broke without anything to build ??
[Android] Markinb66:
Thank you very much. He could not try, but I ask the FTP access AFH and looking forward to try.
[Android] Markinb66:
Compile and tried for the first time in LS990 thanks to this great guide. Although now I have camera and WiFi errors and have to continue reading to see how to fix. Thank you.
[Android] Typhus_:
Hello!

Not sure if anyone has already posted this here...sorry if it has already, just trying to help.

HOW TO CONNECT TO GOOGLE COMPUTE ENGINE USING WINSCP

Awesome!

Simple and fast!

:)
[Android] MidnightDevil:
I cant sign up as "individual" as I only have a "Bussiness" option available.

"This service can only be used for business or commercial reasons. You are responsible for assessing and reporting VAT.".

Anyone having the same issue? UK Based.
[Android] hackslash:
Not available as "Indiviual User" in UK. See their TOS for details.

If you're really interested in Cloud VMs, why not try Azure. They give you a $200 free credit for the first month. I use Azure and currently use their DS13 V2 Instance that costs $1.51/hour (There are no charges for keeping the VM powered off). (BTW, the DS13 V2 packs 20 Cores + 120 GB RAM with a 500 GB Temporary SSD which I use as my 'out' directory for ROM builds)
[Android] nitin.chobhe:
You can try this too. But I find Google cloud more user friendly than Azure...

Nitin
[Android] MidnightDevil:
I will have a look into it. thanks for the tip :)
[Android] BRoy_98:
Is there any way to connect with google cloud from my phone? Or is there any server that can be controlled from my phone?
[Android] nitin.chobhe:
Yes, you can after all it is google ;)

Use this Cloud Console app from none other than Mr. Google - https://play.google.com/store/apps/details?id=com.google.android.apps.cloudconsole&hl=en

Nitin
[Android] BRoy_98:
Thanks man... U saved me!!! :)
[Android] salah6805:
Nitin.chobhe bro can u tell me the cheapest and the best server for compiling roms rather than google

---------- Post added at 01:59 PM ---------- Previous post was at 01:53 PM ----------

That means we can compile roms on android too with the same speed :D:D:D
[Android] nitin.chobhe:
Try to rent a legacy server. There are guys who are renting the servers for building ROMs. PM me and I can give you contact details.

Nitin
[Android] theincognito:
[MENTION=5044214]nitin.chobhe[/MENTION] : I got developer access and the FTP access with the required details(server name,username,password,port number,etc) from Android File Host. Now can you please tell me how to upload files from my console to the FTP?(In detail,if you can. I am a noob at these things. I have experience only at uploading to FTP via FileZilla.)

Nevermind,got it.

For those who still don't know how to upload it to your FTP server,

sudo apt-get install curl
curl -T your-rom-file.zip ftp://your.ftpserver.com --user username:password
[Android] Markinb66:
One more way to upload the file using FTP.

1. Move to the directory where the file is located.

2. Type ftp your.ftpserver.com and press enter.

3. User name.

4. Password

5. passive and enter again.

6. send your-rom-file.zip your-rom-file.zip

Then use any file manager (ES File Explorer for example), start the FTP server and view the file from the phone or do it using FileZilla for Windows.

It is longer than other methods, but not have it as an option for more if another method fails.

Sorry for my English.
[Android] pcwizzy37:
I don't have a credit or debit card. :(
[Android] DarkFrenzy:
[MENTION=5044214]nitin.chobhe[/MENTION]

how many builds i can build for free $300
[Android] nitin.chobhe:
More than 100.

And that are sufficient for learning how to build :highfive:

Nitin
[Android] rohit1521:
ok...so hows much speed does it have?? i have 512kb...thats y
[Android] nitin.chobhe:
Your speed doesn't matter. The Google cloud has more than 1 Gbps speed. It'll sync the repo in 20-30 mins which would take a week or more with your speed ;)

Nitin
[Android] nicolasneville12:
If you not have credit card to sign up free trial

Try Thinapps.org

But the thinapps cannot use custom sizes of hdd and set cpu core

based on ubuntu 14.01
[Android] rayzen6:
Its not useful for building ROMs I think seens space offered is too less to even dwld sources.
[Android] nitin.chobhe:
Yes, as far as I know, only Google Cloud and Amazon can be used for building the ROMs

Nitin
[Android] #VISION:
hey [MENTION=5044214]nitin.chobhe[/MENTION] u were talking about legecy servers for building rom..can u explain about that?:confused:
[Android] adityaupreti:
How to connect file manager with google cloud
[Android] nitin.chobhe:
What file manager?

Search WinSCP

Nitin
[Android] adityaupreti:
I dont have windows
[Android] nitin.chobhe:
How do you expect me to guess what you have? :rolleyes::rolleyes::rolleyes: :mad::mad::mad:

Nitin
[Android] neonkat:
sorry for my noobness.

one more question,can i change the user name?

like its abc@instance-1:

and i want it to be xyz [MENTION=604008]instance[/MENTION]-1:

is this possible?
[Android] adityaupreti:
click on settings button there is a option to change
[Android] DarkFrenzy:
[MENTION=5044214]nitin.chobhe[/MENTION],

i have enjoyed this and learned to build.

now my balacne is getting low, so i want to know how to close this, should i delete the gmail account or my credit card account.

Thanks
[Android] akhilnarang:
It'll stop working on its own once credit gets over
[Android] nitin.chobhe:
There is an option in the account to close the billing account. Use that :good:

Nitin
[Android] :
is there ANYWAY i can use this without A debit or credit card???
[Android] nitin.chobhe:
No :mad:

Nitin
[Android] rignfool:
Amazon has their web service... very similar... just only 30gig in workable space
[Android] nitin.chobhe:
Doesn't it need a card?

Nitin
[Android] rignfool:
Yes... but it can be a gift card... or a prepaid card from the store... unlike Google's version...
[Android] rushic24:
im getting this error plz help fasttt

also on wiki.cyanogenmod.org they tell to connedct phone before building how to do that ??
[Android] nitin.chobhe:
I suggest you to read the ROM building thread by [MENTION=5216756]jackeagle[/MENTION] linked in OP.

Nitin
[Android] :
Is 30gb enough for building Roms?
[Android] nitin.chobhe:
I do not think so; but what's the problem in trying? Anyways it is free :mad:

Nitin
[Android] neonkat:
the source itself is about 20-30gb.
[Android] DarkFrenzy:
I have registered free trial with azure and it's very difficult to use but I managed to create a VM snd is running but it's useless as the connect button is greyed out. Do u have any easy solution to get connect button working?
[Android] nitin.chobhe:
No idea about Azure, never tried that.

Nitin
[Android] hackslash:
It's easy to connect once VM has been created and started. Just download a SSH client (such as Putty if you're using Windows). Enter your VM's IP address (if created using Resource Management) or DNS Name (you can get this information by clicking your VM from Azure main home screen). Hit connect. Provide your username and password or your SSH key pair (depends on which authentication method you used at the start of creating VM) and you're done.
[Android] DarkFrenzy:
Thanks it worked but my disk space is 1 GB but I chose 800gb
[Android] hackslash:
That 800 GB us a temporary SSD partition tied to your VM for free. By temporary I mean that on every reboot it is formatted automatically. You can use sudo fdisk-l to view that partition and mkfs.ext4 to format that to ext4. However, for downloading the original source, add another disk (look the option in your VM settings). You can add a normal HDD (of any size, the cost depends number of transactions per month regardless of the size) or a SSD (which has flat rates per month). I use a 200 GB HDD and it has write speeds of 25MB/sec. It's not great but my builds takes maximum 30 minutes without CCACHE.

However, I also sometimes use that temporary SSD as the OUT directory for my AOSP builds. Using that reduces time to 15-20 minutes.
[Android] DarkFrenzy:
[emoji12]
[Android] DevALT:
damn that exactly the method I did :)

but i installed gnome and vnc to get graphical interface :p
[Android] Sachin7843:
I have successfully built my ROM on Azure instead. Now I want to upload it somewhere, I tried setting up FTP but failed miserably, can someone please guide me with terminal commands on how to upload it? Thank you
[Android] adityaupreti:
use this

cd to location where rom is

now

curl -T rom.zip ftp://ftpserver.com enter here --user Ur user name

for eg

curl -T cm-14.0-201609018-ms013g ftp://basketbuild.com --username aditya

and it will ask u for password enter it ur done
[Android] Sachin7843:
ftp://ftpserver.com enter here - where could I create or get a ftp server to upload? I dont have developer access to AFH
[Android] adityaupreti:
get basketbuild account or write application to AFH for ftp
[Android] Sachin7843:
is it possible to create FTP server using FileZilla and use it? Unfortunately AFH is down for maintenance right now
[Android] adityaupreti:
i dont know you can search on google for ftp uploads
[Android] Sachin7843:
could you get the file to your account if you don't mind? I don't know how long it will take me to get developer status and then ftp server to upload
[Android] hackslash:
No need to use FTP. I use MEGA and upload all my builds directly to MEGA. Follow the instructions below:

Create an account at www.mega.nz

In your VM, install ruby and gem

sudo apt-get install ruby gem

Install rmega gem (you can see the source code here https://github.com/topac/rmega)

gem install rmega

Now to upload your build, just cd to the directory and execute this command:

rmega-up 'filename' -u 'email address'

You'll be prompted to enter your password. Enter it and the specified file will be uploaded to your mega account. You can read this readme https://github.com/topac/rmega/blob/master/README.md for all switches and flags you can use.

Now simply head to your MEGA account from your local computer and download the file.
[Android] Sachin7843:
YOU ARE A SAVIOUR MAN! I can't thank you enough! I spent all day finding any solution but at last, you helped! Thanks alot!
[Android] Eliminater:
how to add roomservice.xml ?
[Android] neonkat:
you can add roomservice.xml or localmanifest.xml,do check any guide for lroper info.

i use localmanifest.xml for downloading device repo's.

cd to .repo->create "local_manifests" folder->cd to it->create localmanifest.xml->add you stuffs and repo sync.
[Android] nitin.chobhe:
I'll add this method in the op. Thanks!

Nitin
[Android] ABSathe:
Hello [MENTION=5044214]nitin.chobhe[/MENTION] sir .. can you tell me what's the amount of bandwidth that is going to be used ?

And secondly is this method safe ? (Giving credit card no. )

Please clarify these doubts so that I can start using google cloud
[Android] shaneel1491:
What happens to the virtual machine after the trial expires?
[Android] neonkat:
the machine is deleted but your files are saved for 1 month,you can further continue by purchasing their subscription.
[Android] bluheart:
This is cool bro. Thanks.
[Android] jneto3000:
How can I connect to GC using Bitvise? :confused:

EDIT: I managed to connect using WinSCP because it works with Putty keys.

It's doing the job.