<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Virtual Machines on Andrew Beaton</title>
    <link>https://andrewbeaton.net/tags/virtual-machines/</link>
    <description>Recent content in Virtual Machines on Andrew Beaton</description>
    <image>
      <title>Andrew Beaton</title>
      <url>https://andrewbeaton.net/me.jpeg</url>
      <link>https://andrewbeaton.net/me.jpeg</link>
    </image>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Tue, 20 Jun 2023 00:00:00 +0000</lastBuildDate><atom:link href="https://andrewbeaton.net/tags/virtual-machines/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Automating Linux Containers and Virtual Machines on Proxmox.</title>
      <link>https://andrewbeaton.net/posts/2023/06/proxmox-automate-lxcs-vms/</link>
      <pubDate>Tue, 20 Jun 2023 00:00:00 +0000</pubDate>
      
      <guid>https://andrewbeaton.net/posts/2023/06/proxmox-automate-lxcs-vms/</guid>
      <description>A guide to automating the creation of linux containers and virtual machines on Proxmox using scripts.</description>
      <content:encoded><![CDATA[<h2 id="introduction">Introduction</h2>
<p>Automation plays a key role in standardising and simplifying the process of building environments.</p>
<p>Continuing on my journey of automating my home lab setup, I found a very good resource that&rsquo;s available for <a href="https://www.proxmox.com/en/">Proxmox</a> users to automate the installation of various Linux containers and Virtual Machines. You can find them from user <a href="https://github.com/tteck/">tteckster</a> here <a href="https://tteck.github.io/Proxmox/">https://tteck.github.io/Proxmox/</a></p>
<p>By using these scripts, we can save time, ensure consistency, and reduce the chances of human error during the environment build process.</p>
<h2 id="why-automate-lxc-and-vm-builds">Why Automate LXC and VM Builds?</h2>
<p>Automation offers several notable benefits when it comes to building Linux containers and VMs:</p>
<h3 id="time-and-effort-savings"><strong>Time and Effort Savings</strong></h3>
<p>Manually configuring and setting up containers or VMs can be a time-consuming and labor-intensive task.</p>
<p>By automating the build process using command line scripts, we can save significant time and effort.</p>
<p>Scripts eliminate the need to manually perform repetitive steps, allowing for faster deployment.</p>
<h3 id="consistency-and-reproducibility"><strong>Consistency and Reproducibility</strong></h3>
<p>Maintaining consistency across multiple containers or VMs is vital in ensuring reliable application deployment.</p>
<p>Command line scripts enable us to define the exact configuration and settings required for each container or VM.</p>
<p>By automating the build process, every instance is built using the same steps, ensuring consistency and reproducibility across different environments.</p>
<h3 id="error-reduction"><strong>Error Reduction</strong></h3>
<p>Manual configuration is prone to human error. Even a small mistake in the build process can lead to significant issues, affecting the stability and performance.</p>
<p>Automation minimises the chances of human error by executing a predefined set of instructions consistently.</p>
<p>Scripts can perform complex and error-prone tasks accurately, reducing the risk of misconfiguration or missteps.</p>
<h3 id="flexibility-and-customisation"><strong>Flexibility and Customisation</strong></h3>
<p>These command line scripts provide a flexible and customisable approach to building Linux containers and VMs.</p>
<p>These scripts often offer various options and parameters that allow us to tailor the build process according to their specific requirements.</p>
<p>We can choose different configurations, select specific software packages, and define resource allocation based on our application&rsquo;s needs.</p>
<h2 id="introducing-the-command-line-scripts">Introducing the Command Line Scripts</h2>
<p>This brilliant <a href="https://tteck.github.io/Proxmox/">website</a> by <a href="https://github.com/tteck/">tteckster</a> provides a collection of command line scripts that enable the automation of Linux Container (LXC) and Virtual Machine (VM) builds on <a href="https://www.proxmox.com/en/">Proxmox</a>.</p>
<p>These scripts enable us to create in an interactive manner, offering options for both basic and advanced configurations.</p>
<h3 id="basic-setup">Basic Setup</h3>
<p>The basic setup uses default settings, making it a convenient option for users who prefer a quick and straight forward setup.</p>
<p>To run the basic script for your specific machine, go through the list of options available and use the command in the Proxmox shell.</p>
<p>For example, to create a Linux Container for Cloudflared, we can use the following command:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>bash -c <span style="color:#e6db74">&#34;</span><span style="color:#66d9ef">$(</span>wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/cloudflared.sh<span style="color:#66d9ef">)</span><span style="color:#e6db74">&#34;</span>
</span></span></code></pre></div><p>Or to create a MariaDB container, we can use the following command:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>bash -c <span style="color:#e6db74">&#34;</span><span style="color:#66d9ef">$(</span>wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/mariadb.sh<span style="color:#66d9ef">)</span><span style="color:#e6db74">&#34;</span>
</span></span></code></pre></div><h3 id="advanced-setup">Advanced Setup</h3>
<p>For more flexibility and customisation, the advanced setup feature of the scripts allows us to alter the default settings according to our needs.</p>
<p>This function utilises the <code>whiptail</code> command to present options in a dialogue box format, allowing us to modify the options available, such as increased memory, disk size and set options such as static IP addresses and DNS.</p>
<p>To run the advanced setup script, when prompted, choose the <!-- raw HTML omitted --> settings options when presented after running your chosen script.</p>
<p>After selecting your options, the script collects and verifies the input in order to generate the final configuration for the container or virtual machine.</p>
<h2 id="summary">Summary</h2>
<p>Automating our Proxmox builds with command line scripts streamlines the deployment process, reduces manual effort, and ensures consistency and reproducibility.</p>
<p>By using the provided basic or advanced setup scripts from the website, we can easily build Linux Containers or Virtual Machines on <a href="https://www.proxmox.com/en/">Proxmox</a> tailored to our specific needs in a repeatable manner.</p>
<p>Remember to visit <a href="https://tteck.github.io/Proxmox/">https://tteck.github.io/Proxmox/</a> for more details and documentation on the available scripts.</p>
<p>There are also a number of other scripts available and can be found by searching on GitHub. For example, user <a href="https://github.com/roib20">roib20</a> has created Proxmox helper scripts for TrueNAS and CloudInit which can be found here <a href="https://github.com/roib20/proxmox-scripts.">https://github.com/roib20/proxmox-scripts</a></p>
]]></content:encoded>
    </item>
    
  </channel>
</rss>
