The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.
Difference between revisions of "Amazon EC2 Launch"
(19 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:Funtoo Linux on AWS (Amazon Web Services)}} | |||
This page documents how to launch a Funtoo Linux Amazon EC2 instance. | This page documents how to launch a Funtoo Linux Amazon EC2 instance. | ||
== Starting Out == | |||
=== Create an Account=== | |||
The first thing you'll need to do, if you haven't already, is to head over to https://aws.amazon.com and create an account so that you can log in to the AWS Console. If you create a new account, you'll be using your "root credentials" to log in. Eventually, | The first thing you'll need to do, if you haven't already, is to head over to https://aws.amazon.com and create an account so that you can log in to the AWS Console. If you create a new account, you'll be using your "root credentials" to log in. Eventually, | ||
you should create an IAM User account to log in, instead of using your root credentials to log in, | you should create an IAM User account to log in, instead of using your root credentials to log in, as this is a good security practice. While the steps to do this will not be covered in this document, you can read more [https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html in the official AWS documentation] on how to do this. | ||
== Choosing A Region == | |||
{| style="border:none;vertical-align:text-top;width:100%;" | |||
|-style="vertical-align:top;" | |||
| | |||
OK, now you are logged in to the AWS Console. The first thing you'll want to do is to ''choose a region'' in which you'd like to deploy your Funtoo Linux image. This is done by selecting your preferred region in the upper right-hand corner. Once you are in the correct region, it's now time to launch an image. | |||
|| [[File:aws-region-select.png|200px|right|thumb|First things first -- select your region!]] | |||
|} | |||
== Starting the Launcher == | |||
{| style="border:none;vertical-align:text-top;width:100%;" | |||
|-style="vertical-align:top;" | |||
| | |||
To launch a Funtoo Linux image, we'll go through a "UI wizard" process that initiates by clicking the blue '''Launch''' button at the top of the screen | To launch a Funtoo Linux image, we'll go through a "UI wizard" process that initiates by clicking the blue '''Launch''' button at the top of the screen. Once clicking this button, the UI wizard will start to guide you through the process of creating an image. We'll go through each screen below. | ||
|| [[File:aws-select-launch.png|thumb|right|200px|Time to launch Funtoo!]] | |||
|} | |||
Once clicking this button, the UI wizard will start to guide you through the process of creating an image. We'll go through each screen below. | |||
== Choosing Funtoo == | |||
{| style="border:none;vertical-align:top;width:100%;" | |||
|-style="vertical-align:top;" | |||
| | |||
[[File:aws-select-funtoo.png|right|thumb|200px|Now, select Funtoo in the AWS Marketplace]] | |||
===Amazon Machine Image=== | |||
You'll be prompted to choose an Amazon Machine Image (AMI). Click on '''AWS Marketplace''' and type "funtoo" in the search bar to find the available Funtoo Linux images. You will want to choose a Funtoo Linux AMI optimized for the particular instance type you want to use. If unsure, we recommend starting with the "optimized for t2 instances" Funtoo Linux AMI and using a {{c|t2.xlarge}} instance type: | You'll be prompted to choose an Amazon Machine Image (AMI). Click on '''AWS Marketplace''' and type "funtoo" in the search bar to find the available Funtoo Linux images. You will want to choose a Funtoo Linux AMI optimized for the particular instance type you want to use. If unsure, we recommend starting with the "optimized for t2 instances" Funtoo Linux AMI and using a {{c|t2.xlarge}} instance type: | ||
[[File:aws- | |-style="vertical-align:top;" | ||
| | |||
[[File:aws-funtoo-continue.png|right|200px|thumb|Confirm that you want to 'subscribe' to Funtoo Linux.]] | |||
===Confirm Your Subscription=== | |||
Now, click the blue '''Select''' button. You'll now be prompted to confirm a subscription to Funtoo Linux. Note that this doesn't actually incur any additional charges from us, since our images are available free of charge, but Amazon still records you as having "subscribed" to Funtoo Linux anyway: | Now, click the blue '''Select''' button. You'll now be prompted to confirm a subscription to Funtoo Linux. Note that this doesn't actually incur any additional charges from us, since our images are available free of charge, but Amazon still records you as having "subscribed" to Funtoo Linux anyway: | ||
You'll want to click the blue '''Continue''' button to continue. | You'll want to click the blue '''Continue''' button to continue. | ||
|} | |||
== Configure Instance == | |||
{| style="border:none;vertical-align:top;width:100%;" | |||
|-style="vertical-align:top;" | |||
| | |||
Next, you'll be prompted to configure the instance. In general, the defaults are typically fine, but make sure that '''Shutdown behavior''' is set to '''stop''', so that when you shut down, your instance will still exist but in a dormant state. | Next, you'll be prompted to configure the instance. In general, the defaults are typically fine, but make sure that '''Shutdown behavior''' is set to '''stop''', so that when you shut down, your instance will still exist but in a dormant state. | ||
{{Important|Don't click "Review and Launch" at this point! We'll want to continue to "Next: Add Storage"!}} | {{Important|Don't click "Review and Launch" at this point! We'll want to continue to "Next: Add Storage"!}} | ||
Next, we'll want to continue to the next screen by selecting the non-highlighted '''Next: Add Storage''' button. | Next, we'll want to continue to the next screen by selecting the non-highlighted '''Next: Add Storage''' button. | ||
|| | |||
[[File:aws-instance-details.png|right|200px|thumb|Most instance details can be left at their defaults.]] | |||
|} | |||
== Adding Storage == | |||
{| style="border:none;vertical-align:top;width:100%;" | |||
|-style="vertical-align:top;" | |||
| | |||
{{Warning|Skipping this step will result in your AMI having only 8GiB of disk space total! This is because AMIs are created with a minimally-sized root EBS volume. You should modify the size of the root volume to suit your needs. At boot time, Funtoo Linux will resize the root volume to utilize all available space.}} | {{Warning|Skipping this step will result in your AMI having only 8GiB of disk space total! This is because AMIs are created with a minimally-sized root EBS volume. You should modify the size of the root volume to suit your needs. At boot time, Funtoo Linux will resize the root volume to utilize all available space.}} | ||
On this next screen of the wizard, you can add additional disks to your image, which is usually not required. What '''is generally required, however, is expanding the size of the disk from 10GB to a larger capacity (we recommend at least 50GB if you are starting out.) Do This by modifying the GiB setting for {{c|/dev/xvda}} as follows: | On this next screen of the wizard, you can add additional disks to your image, which is usually not required. What '''is generally required, however, is expanding the size of the disk from 10GB to a larger capacity (we recommend at least 50GB if you are starting out.) Do This by modifying the GiB setting for {{c|/dev/xvda}} as follows: | ||
When Funtoo Linux first starts, it will automatically resize its root partition and filesystem to take advantage of all available space, so that your additional storage space will be available by the time you log in. | When Funtoo Linux first starts, it will automatically resize its root partition and filesystem to take advantage of all available space, so that your additional storage space will be available by the time you log in. | ||
|| [[File:aws-add-storage.png|thumb|right|200px|Expanding the size of the root volume is important!]] | |||
|} | |||
== Adding Tags == | |||
The next step, '''Adding Tags''', can be safely skipped. Proceed to the next part of the wizard: '''Configure Security Group'''. | The next step, '''Adding Tags''', can be safely skipped. Proceed to the next part of the wizard: '''Configure Security Group'''. | ||
== Configure Security Group == | |||
{| style="border:none;vertical-align:top;width:100%;" | |||
|-style="vertical-align:top;" | |||
| | |||
This next section allows you to configure a security group for your new instance. This security group is what defines what kinds of connections are allowed to be made to your new instance. By default, we ship with an auto-generated security group that allows SSH access (via TCP port 22) from anywhere on the Internet. You should select this security group, or alternatively can select another security group that allows appropriate access. | This next section allows you to configure a security group for your new instance. This security group is what defines what kinds of connections are allowed to be made to your new instance. By default, we ship with an auto-generated security group that allows SSH access (via TCP port 22) from anywhere on the Internet. You should select this security group, or alternatively can select another security group that allows appropriate access. | ||
Line 65: | Line 77: | ||
{{Important|To be able to log in from any IP, you will want to make sure that your security group contains a rule that matches the one shown below.}} | {{Important|To be able to log in from any IP, you will want to make sure that your security group contains a rule that matches the one shown below.}} | ||
|| [[File:aws-security-group.png|right|200px|thumb|Be sure to choose a security group that allows you to SSH in!]] | |||
[[File:aws-security-group.png| | |} | ||
== Review == | |||
{| style="border:none;vertical-align:top;width:100%;" | |||
|-style="vertical-align:top;" | |||
| | |||
[[File:aws-launch.png|right|200px|thumb|Time to launch -- for real!]] | |||
Finally, you will be asked to review the launch plan. Now is a good time to review. It's generally safe to click the blue '''Launch''' button at this point: | |||
|} | |||
== Generating a Key Pair == | |||
{| style="border:none;vertical-align:top;width:100%;" | |||
|-style="vertical-align:top;" | |||
| | |||
Before your instance is launched, AWS will prompt you and ask if you want to use an existing key pair or create a new key pair. This part may be confusing | |||
for new AWS users but it actually fairly easy to explain. AWS generates a public/private SSH key pair, and the public part of that key pair will automatically be installed under the {{c|ec2-user}} account on the Funtoo Linux instance. You will then be able to download the private part of the key pair. Since this is just a regular SSH private key, SSH will happily accept it, but you must use the {{c|-i path/to/private-key.pem}} when calling {{c|ssh}} to provide your private key. When this is done, you'll be able to log in to the {{c|ec2-user}} account using {{c|ssh}} without providing a passphrase. Here's a screenshot of the Key Pair dialog below: | |||
{{Important|For security reasons your downloaded private key must be chmod'ed 400 or it *will* fail and ask for a non-existent password. | |||
{{Console|body=$##i## chmod 400 path/to/private-key.pem}}}} | |||
|| [[File:aws-keypair.png|right|200px|thumb|Time to choose a key pair, or create a new one.]] | |||
|} | |||
== Instance Created! == | |||
{| style="border:none;vertical-align:top;width:100%;" | |||
|-style="vertical-align:top;" | |||
| | |||
=== A New Instance is Launching: === | |||
Once you've launch your image, you will now be free of the wizard and back in the AWS Console UI. You'll see your new instance launching: | |||
|| | |||
[[File:aws-pending.png|right|200px|thumb|Your new Funtoo Linux AWS instance is launching. It will be ready for login soon...]] | |||
|-style="vertical-align:top;" | |||
| | |||
=== A Public IP is Ready === | |||
You'll see that it is in a "pending" (yellow) state. In about 30 seconds, it should be in a green "ready" state. At this point, you should be able to copy the public IP of your instance as follows: | |||
|| [[File:aws-public-ip.png|right|200px|thumb|Copy your public IP!]] | |||
|} | |||
== Logging In == | |||
Now, you should be able to use this IP to log in: | |||
{{console|body= | {{console|body= | ||
##g##drobbins@ryzen##!g## ##c##~ $##!c## ##i##ssh -i ~/Downloads/drobbins-funtoo-us-east-1.pem ec2-user@54.152.74.161 | \##g##drobbins@ryzen##!g## ##c##~ $##!c## ##i##ssh -i ~/Downloads/drobbins-funtoo-us-east-1.pem ec2-user@54.152.74.161 | ||
The authenticity of host '54.152.74.161 (54.152.74.161)' can't be established. | The authenticity of host '54.152.74.161 (54.152.74.161)' can't be established. | ||
ECDSA key fingerprint is SHA256:06VxabD5Gom5FRzpg7jZrBWro+TJkZBFa2+29WTSII4. | ECDSA key fingerprint is SHA256:06VxabD5Gom5FRzpg7jZrBWro+TJkZBFa2+29WTSII4. | ||
Line 91: | Line 139: | ||
NOTE: This message can be removed by deleting /etc/motd. | NOTE: This message can be removed by deleting /etc/motd. | ||
##g##ec2-user@ip-172-31-22-215##!g## ##c##~ $##!c## ##i##sudo su | \##g##ec2-user@ip-172-31-22-215##!g## ##c##~ $##!c## ##i##sudo su | ||
##r##ip-172-31-22-215##!r## ##bl##/home/ec2-user##!bl## # ##i##ego sync | \##r##ip-172-31-22-215##!r## ##bl##/home/ec2-user##!bl## # ##i##ego sync | ||
}} | }} |
Latest revision as of 16:23, July 25, 2019
This page documents how to launch a Funtoo Linux Amazon EC2 instance.
Starting Out
Create an Account
The first thing you'll need to do, if you haven't already, is to head over to https://aws.amazon.com and create an account so that you can log in to the AWS Console. If you create a new account, you'll be using your "root credentials" to log in. Eventually, you should create an IAM User account to log in, instead of using your root credentials to log in, as this is a good security practice. While the steps to do this will not be covered in this document, you can read more in the official AWS documentation on how to do this.
Choosing A Region
OK, now you are logged in to the AWS Console. The first thing you'll want to do is to choose a region in which you'd like to deploy your Funtoo Linux image. This is done by selecting your preferred region in the upper right-hand corner. Once you are in the correct region, it's now time to launch an image. |
Starting the Launcher
To launch a Funtoo Linux image, we'll go through a "UI wizard" process that initiates by clicking the blue Launch button at the top of the screen. Once clicking this button, the UI wizard will start to guide you through the process of creating an image. We'll go through each screen below. |
Choosing Funtoo
Amazon Machine ImageYou'll be prompted to choose an Amazon Machine Image (AMI). Click on AWS Marketplace and type "funtoo" in the search bar to find the available Funtoo Linux images. You will want to choose a Funtoo Linux AMI optimized for the particular instance type you want to use. If unsure, we recommend starting with the "optimized for t2 instances" Funtoo Linux AMI and using a |
Confirm Your SubscriptionNow, click the blue Select button. You'll now be prompted to confirm a subscription to Funtoo Linux. Note that this doesn't actually incur any additional charges from us, since our images are available free of charge, but Amazon still records you as having "subscribed" to Funtoo Linux anyway: You'll want to click the blue Continue button to continue. |
Configure Instance
Next, you'll be prompted to configure the instance. In general, the defaults are typically fine, but make sure that Shutdown behavior is set to stop, so that when you shut down, your instance will still exist but in a dormant state. Important Don't click "Review and Launch" at this point! We'll want to continue to "Next: Add Storage"! Next, we'll want to continue to the next screen by selecting the non-highlighted Next: Add Storage button. |
Adding Storage
Warning Skipping this step will result in your AMI having only 8GiB of disk space total! This is because AMIs are created with a minimally-sized root EBS volume. You should modify the size of the root volume to suit your needs. At boot time, Funtoo Linux will resize the root volume to utilize all available space. On this next screen of the wizard, you can add additional disks to your image, which is usually not required. What is generally required, however, is expanding the size of the disk from 10GB to a larger capacity (we recommend at least 50GB if you are starting out.) Do This by modifying the GiB setting for When Funtoo Linux first starts, it will automatically resize its root partition and filesystem to take advantage of all available space, so that your additional storage space will be available by the time you log in. |
Adding Tags
The next step, Adding Tags, can be safely skipped. Proceed to the next part of the wizard: Configure Security Group.
Configure Security Group
This next section allows you to configure a security group for your new instance. This security group is what defines what kinds of connections are allowed to be made to your new instance. By default, we ship with an auto-generated security group that allows SSH access (via TCP port 22) from anywhere on the Internet. You should select this security group, or alternatively can select another security group that allows appropriate access. Warning Our default security group is ideal for initial login, but as you gain familiarity with AWS, you should consider restricting access to the IP(s) you use to access your Funtoo Linux virtual machines. Doing so is beyond the scope of this simple introduction but we welcome contributed documentation on how to perform these steps. Important To be able to log in from any IP, you will want to make sure that your security group contains a rule that matches the one shown below. |
Review
Finally, you will be asked to review the launch plan. Now is a good time to review. It's generally safe to click the blue Launch button at this point: |
Generating a Key Pair
Before your instance is launched, AWS will prompt you and ask if you want to use an existing key pair or create a new key pair. This part may be confusing
for new AWS users but it actually fairly easy to explain. AWS generates a public/private SSH key pair, and the public part of that key pair will automatically be installed under the Important For security reasons your downloaded private key must be chmod'ed 400 or it *will* fail and ask for a non-existent password. user $ chmod 400 path/to/private-key.pem |
Instance Created!
A New Instance is Launching:Once you've launch your image, you will now be free of the wizard and back in the AWS Console UI. You'll see your new instance launching: |
|
A Public IP is ReadyYou'll see that it is in a "pending" (yellow) state. In about 30 seconds, it should be in a green "ready" state. At this point, you should be able to copy the public IP of your instance as follows: |
Logging In
Now, you should be able to use this IP to log in:
drobbins@ryzen ~ $ ssh -i ~/Downloads/drobbins-funtoo-us-east-1.pem ec2-user@54.152.74.161 The authenticity of host '54.152.74.161 (54.152.74.161)' can't be established. ECDSA key fingerprint is SHA256:06VxabD5Gom5FRzpg7jZrBWro+TJkZBFa2+29WTSII4. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '54.152.74.161' (ECDSA) to the list of known hosts. // Welcome to Funtoo Linux for Amazon EC2! This image has been optimized // for the best possible performance by taking advantage of all CPU // instruction sets offered by Amazon Web Services. >>> Release: Funtoo Linux 1.2-release-ec2 >>> Version: 17-Nov-2018 >>> Subarch: intel64-haswell >>> Created by: Daniel Robbins <drobbins@funtoo.org> >>> Open Source Community: Funtoo Linux (https://www.funtoo.org) >>> Commercial Support: BreezyOps (https://breezyops.com) >>> Bug reports: https://bugs.funtoo.org >>> Support email: support@funtoo.org NOTE: This message can be removed by deleting /etc/motd. ec2-user@ip-172-31-22-215 ~ $ sudo su ip-172-31-22-215 /home/ec2-user # ego sync