123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- <!DOCTYPE html>
- <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Running an Amazon Linux (AL2) VM in Proxmox</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta charset="UTF-8">
- <meta name="keywords" content="Home Lab,Home Lab Ideas,Hypervisor,Install Guide,Self-Hosted,How To Install Amazon Linux On Proxmox,How To Run Amazon Linux On Proxmox VE,Linux,Proxmox,Proxmox Host,Proxmox Step By Step,Proxmox Tutorial,Proxmox VE,VM,Virtual Machine,Virtualization,Amazon Linux,AL2,Amaonz Linux 2,How To,Tutorial,i12bretro">
- <meta name="author" content="i12bretro">
- <meta name="description" content="Running an Amazon Linux (AL2) VM in Proxmox">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="revised" content="11/17/2024 09:31:43 AM" />
- <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
- <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
- <script type="text/javascript" src="includes/js/steps.js"></script>
- <link href="css/steps.css" rel="stylesheet" type="text/css" />
- </head>
- <body>
- <div id="gridContainer">
- <div class="topMargin"></div>
- <div id="listName" class="topMargin">
- <h1>Running an Amazon Linux (AL2) VM in Proxmox</h1>
- </div>
- <div></div>
- <div id="content">
- <h2>What is Amazon Linux?</h2>
- <blockquote><em>Amazon Linux 2 is a Linux operating system from Amazon Web Services (AWS). It provides a security-focused, stable, and high-performance execution environment to develop and run cloud applications. -<a href="https://aws.amazon.com/amazon-linux-2" target="_blank">https://aws.amazon.com/amazon-linux-2</a></em></blockquote>
- <h2>Creating the VM</h2>
- <ol>
- <li>Open a web browser and navigate to the ProxMox web UI (ie https://ProxMoxDNSorIP:8006/)</li>
- <li>Right click the Proxmox node name > Create VM</li>
- <li>Give the VM a unique ID and Name > Next</li>
- <li>On the OS tab, Select Do not use any media, leave the Type as Linux and the Version as 5.x - 2.6 Kernel > Next</li>
- <li>On the System tab, leave the defaults and check the Qemu Agent box to enable it > Next</li>
- <li>On the Hard Disk tab, delete the scsi0 disk > Next</li>
- <li>On the CPU tab, set Cores to 1 or more and Type to host > Next</li>
- <li>On the Memory tab, set the Memory to 512 or more > Next</li>
- <li>Leave the defaults on the Network tab > Next</li>
- <li>Verify the summary and click Finish</li>
- <li>Click the Proxmox node in the left navigation menu > Shell</li>
- <li>Run the following commands in the web shell
- <div class="codeBlock CMD"># lookup the latest amazon linux file name<br />
- regex='<td><a href="([^/]*\.qcow2)">[^/]*<\/a><\/td>' && response=$(curl -s -L https://cdn.amazonlinux.com/os-images/latest/kvm/) && [[ $response =~ $regex ]] && downloadURL="${BASH_REMATCH[1]}"<br />
- # download the amazon linux virtual disk<br />
- wget -O /tmp/al2.qcow2 https://cdn.amazonlinux.com/os-images/latest/kvm/$downloadURL<br />
- # import the downloaded virtual disk<br />
- # update the vmid and destination storage pool to match your environment<br />
- # usage<br />
- # qm importdisk <%target vmid%> <%path to source disk%> <%destination storage device%> [OPTIONS]<br />
- qm importdisk 2000 /tmp/al2.qcow2 SSD_100GB</div>
- </li>
- <li>Once the import completes, select the newly created Amazon Linux VM from the left navigation panel</li>
- <li>Select Hardware from the left sub-navigation menu</li>
- <li>Double click the Unused Disk to edit it > Click the Add button</li>
- <li>Click the Add dropdown > CloudInit Drive</li>
- <li>Set the target storage for the CloudInit drive > Click the Add button</li>
- <li>Select Cloud-Init from the left sub-navigation menu</li>
- <li>Edit each of the Cloud-Init fields to set a username, password and DNS/network parameters</li>
- <li>Select Options from the left sub-navigation menu</li>
- <li>Double click Boot Order</li>
- <li>Check the Enabled box next to the hard disk and drag it up in the boot order as needed, typically below the CD-ROM device</li>
- <li>Click OK</li>
- <li>Click the Start button in the top right of the screen</li>
- <li>Select Console from the left sub-navigation menu to watch the boot process</li>
- </ol>
- <h2>Setting Up Amazon Linux 2</h2>
- <ol>
- <li>Once the boot process completes, login with the username and password set in the Cloud-Init settings earlier</li>
- <li>Run the following commands in the terminal
- <div class="codeBlock CMD"># elavate to root<br />
- sudo su<br />
- # enable hostname preservation in cloud-init config<br />
- echo -e "\npreserve_hostname: true" >> /etc/cloud/cloud.cfg<br />
- # set the hostname<br />
- hostnamectl set-hostname amazon-linux<br />
- # output hostname details<br />
- hostnamectl<br />
- # update software repositories<br />
- yum check-update<br />
- # install available updates<br />
- yum update<br />
- # install qemu-guest-agent<br />
- yum install qemu-guest-agent -y<br />
- # shutdown<br />
- shutdown now<vmid><storage></storage></vmid></div>
- <strong> </strong></li>
- <li>Once the VM has shutdown completely, power it back up on clicking the Start button at the top right of the screen</li>
- <li>After the boot process completes, login back in</li>
- <li>Continue with the following command in the terminal
- <div class="codeBlock CMD"># verify hostname details were retained<br />
- sudo hostnamectl</div>
- <strong> </strong></li>
- <li>Welcome to Amazon Linux running in Proxmox</li>
- </ol> </div>
- </div>
- </body>
- </html>
-
|