<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>LES Talk — LowEndSpirit</title>
        <link>https://lowendspirit.com/index.php?p=/</link>
        <pubDate>Sun, 05 Apr 2026 14:11:55 +0000</pubDate>
        <language>en</language>
            <description>LES Talk — LowEndSpirit</description>
    <atom:link href="https://lowendspirit.com/index.php?p=/categories/les-talk/feed.rss" rel="self" type="application/rss+xml"/>
    <item>
        <title>My hosting, storage, and software stack (what’s worked for me so far)</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/10174/my-hosting-storage-and-software-stack-what-s-worked-for-me-so-far</link>
        <pubDate>Wed, 12 Nov 2025 05:15:55 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>bikegremlin</dc:creator>
        <guid isPermaLink="false">10174@/index.php?p=/discussions</guid>
        <description><![CDATA[<p>It took some time and effort to put this all on paper. Sharing the info here in hope it will help more people, especially new members, to avoid some common pitfalls. Also posting it for selfish reasons: I suppose and hope the more experienced LESbians will correct any less-than-ideal choices with better ideas (I don't mind looking stupid in public if it lets me learn  <img src="https://lowendspirit.com/plugins/emojiextender/emoji/twitter/smile.png" title=":)" alt=":)" height="18" /> ).</p>

<p>Turns out I've been working (for pay) with computers for over 30 years now, and I've tried and learned a lot during that time (still learning, it's a dynamic field). Here's a short-list of what's worked for me so far (in an infrastructure-related order so to speak):</p>

<p><em>For those who know my style - the series is mostly technical, brief, and to-the-point. That's what it is: basically a list with brief explanations why. Not my usual long-windedness.</em></p>

<p><a rel="nofollow" href="https://io.bikegremlin.com/38495/my-hosting-stack/" title="My Hosting stack">My Hosting stack</a><br />
Infrastructure - domain registration, DNS, website and email hosting.</p>

<p><a rel="nofollow" href="https://io.bikegremlin.com/38590/my-storage-stack/" title="My (backups) Storage stack">My (backups) Storage stack</a><br />
<em>Storage - physical and cloud.</em></p>

<p><a rel="nofollow" href="https://io.bikegremlin.com/38600/my-os-system-software-stack/" title="My OS &amp; System Software stack">My OS &amp; System Software stack</a><br />
<em>Computer-running - OS, drivers, security, diagnostics, and utilities.</em></p>

<p><a rel="nofollow" href="https://io.bikegremlin.com/38706/my-application-software-stack/" title="My Application Software stack">My Application Software stack</a><br />
<em>Computer-using - writing, editing, playing media, and troubleshooting.</em></p>

<p>Writing this series got me to revisit and rethink my stack (helping myself too), and took me on a few trips down memory lane (like first time seeing Total Commander on my late uncle's PC, while I was just learning and using DOS command prompt at the time and similar).</p>

<p>It was fun, and, as the modern managers and HR folks say: challenging.  LOL  <img src="https://lowendspirit.com/plugins/emojiextender/emoji/twitter/smile.png" title=":)" alt=":)" height="18" /></p>

<p>Relja</p>

<p>P.S.<br />
<em>I think this topic logically belongs in this section, but if it's a bad idea, moving is one-click away.</em></p>
]]>
        </description>
    </item>
    <item>
        <title>How do you set up your terminal?</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/10113/how-do-you-set-up-your-terminal</link>
        <pubDate>Mon, 27 Oct 2025 20:56:54 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>Not_Oles</dc:creator>
        <guid isPermaLink="false">10113@/index.php?p=/discussions</guid>
        <description><![CDATA[<p><img src="https://lowendspirit.com/uploads/editor/si/dt01i70sd9xj.png" alt="" title="" /></p>

<p>I think I want a really peaceful, retro green terminal like the above screenshot.</p>

<p>I recently installed and wrote about <a rel="nofollow" href="https://lowendspirit.com/discussion/9738/how-to-install-vscodium-with-code-server-on-a-debian-12-vps/p1">vscodium and code-server,</a> but vscodium, although super great, is not retro green.</p>

<p>In the retro green terminal, there is a peaceful, non-distracting, empty space into which I can load whatever I am working on at the moment. Any one of several editors plus a vast array of command line tools can be used instantly.</p>

<p>In addition to the command line tools, dot files and dot directories can be used keep everything arranged, close by, yet out of the way. Right now I use one dot file and two dot directories.</p>

<p>My dot file is .tlog, which is a simple text file with dates, log entries, comments, and terminal commands transcribed along with their output.</p>

<p>My two dot directories are .current and .attic. The first, .current, is where I keep individual files and project directories on which I currently am working, although not at the precise present moment. The second, .attic, is where I keep files and projects on which I am not currently working, but which I think I might need or want to see again before too long.</p>

<p>Once a new project hits .current or moves from .current to .attic, I still can go work on it there. Its not like I <em>have</em> to move the project back to my home directory in order to edit a file.</p>

<p>As a simple workflow example, here is me working on this post, comments added.</p>

<pre><code>root@tx:~# su - tom # Logging in as root saves me from typing sudo a million times as day. 
tom@tx:~$ date # I need to remind myself of the date in order to add the date to the log.
Mon Oct 27 05:16:31 PM UTC 2025
tom@tx:~$ vi .tlog # Starting todays log entries. 
tom@tx:~$ cp -p .tlog .tlog~ # Local quick backup, just in case.
tom@tx:~$ vi How-do-you-set-up-your-terminal # Write todays post.j 
tom@tx:~$ ls # Does the post exist in my home directory?
How-do-you-set-up-your-terminal # Yes!
tom@tx:~$ vi .tlog # Add log entry for this post.
tom@tx:~$ ls .current/ # Not much yet on the new Texas server.
tom@tx:~$ mv How-do-you-set-up-your-terminal .current/ # Move the draft to the .current directory.
tom@tx:~$ clear # Restore the peacefulness of the clean view of my home directory.
</code></pre>

<p>The green color I am using is #00ED00, which reminds me of the <a rel="nofollow" href="https://en.wikipedia.org/wiki/IBM_5151">IBM 5151</a> that I used to use.</p>

<p>For backup, I mirror my /home/tom directory on another server from a different provider. I can log in to either mirror and begin working right away. In addition to mirroring, I keep tar backups at a third provider and also on a local disk.</p>

<p>The biggest disadvantage of my retro green setup might be that it is stuck in time. I loved and lost the infinite scrollback from the slightly earlier days of paper terminals. Also, perhaps my love of retro green keeps me from embracing many advantages of newer terminal setups?</p>

<p>How do you set up your terminal? Can you convince me, almost 78 years old now, to move forward in time, to become young again?</p>
]]>
        </description>
    </item>
    <item>
        <title>How to install vscodium with code-server on a Debian 12 VPS</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/9738/how-to-install-vscodium-with-code-server-on-a-debian-12-vps</link>
        <pubDate>Thu, 03 Jul 2025 21:42:38 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>Not_Oles</dc:creator>
        <guid isPermaLink="false">9738@/index.php?p=/discussions</guid>
        <description><![CDATA[<p><a rel="nofollow" href="https://github.com/VSCodium/vscodium">vscodium</a> provides "binary releases of VS Code without MS branding/telemetry/licensing."</p>

<p><a rel="nofollow" href="https://github.com/coder/code-server">code-server</a> provides the ability to "[r]un VS Code on any machine anywhere and access it in the browser."</p>

<p>The vscodium <a rel="nofollow" href="https://github.com/VSCodium/vscodium?tab=readme-ov-file#install-with-package-manager">README</a> sends us to the <a href="https://lowendspirit.com/index.php?p=/profile/paulcarroty" rel="nofollow">@paulcarroty</a> repo at Gitlab where there are specific <a rel="nofollow" href="https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo">Debian apt install instructions.</a></p>

<p><strong>Install vscodium and/or vscodium-insiders</strong></p>

<p>The specific install commands can be copied directly from the <a href="https://lowendspirit.com/index.php?p=/profile/paulcarroty" rel="nofollow">@paulcarroty</a> repo. Basically there are only four simple steps:</p>

<ul>
<li><p>Install a gpg key;</p></li>
<li><p>add the repository to <code>/etc/apt/sources.list.d/</code>;</p></li>
<li><p>update, upgrade; and then</p></li>
<li><p>install codium and/or codium-insiders.</p></li>
</ul>

<p><strong>Install code-server</strong></p>

<p>Next is to install code-server. The code-server repo includes an <a rel="nofollow" href="https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo">install script</a>, as well as the <a rel="nofollow" href="https://github.com/coder/code-server?tab=readme-ov-file">curl commands to test and run the install script.</a></p>

<p><strong>Connecting</strong></p>

<p>To connect, set up an ssh tunnel to the VPS from the local machine. Then, on the VPS, start codium or codium-insiders followed by code-server. Finally, go to <code>http://localhost:8080</code> in the local machine's browser.</p>

<p>On the local machine:</p>

<ul>
<li><code>ssh tom@xxx.xxx.xxx.xxx -L 8080:localhost:8080</code></li>
</ul>

<p>On the VPS:</p>

<ul>
<li><p><code>$ cat /home/tom/.config/code-server/config.yaml</code> # Get the code-server password</p></li>
<li><p><code>$ codium</code> # Start vscodium.</p></li>
<li><p><code>$ code-server</code> # Start code-server.</p></li>
</ul>

<p>Back on the local machine:</p>

<ul>
<li>Go to <code>http://localhost:8080</code> in the browser.</li>
</ul>

<p><strong>Screenshots</strong></p>

<p><img src="https://lowendspirit.com/uploads/editor/7d/sho4lyou9n86.png" alt="" title="" /></p>

<p><img src="https://lowendspirit.com/uploads/editor/8h/jsrw2jm1iip3.png" alt="" title="" /></p>
]]>
        </description>
    </item>
    <item>
        <title>FOSSBilling: A New, Free, and Open Source Billing Platform</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/6433/fossbilling-a-new-free-and-open-source-billing-platform</link>
        <pubDate>Thu, 07 Sep 2023 03:51:32 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>Not_Oles</dc:creator>
        <guid isPermaLink="false">6433@/index.php?p=/discussions</guid>
        <description><![CDATA[<h2><strong>Introduction</strong></h2>

<p>The new <a rel="nofollow" href="https://fossbilling.org">FOSSBilling</a> free and open source billing platform was <a rel="nofollow" href="https://lowendspirit.com/discussion/4999/fossbilling-first-release-since-rebranding-from-boxbilling/p1">discussed here at LES in December 2022.</a> The 2022 discussion included very helpful background posts from FOSSBilling developers <a href="https://lowendspirit.com/index.php?p=/profile/jaapmarcus" rel="nofollow">@jaapmarcus</a> and <a href="https://lowendspirit.com/index.php?p=/profile/evrifaessa" rel="nofollow">@evrifaessa</a>.</p>

<p>FOSSBilling has progressed a lot since the December 2022 LES discussion. Indeed,  shared hosting providers already have been using FOSSBilling in production.</p>

<p>Recently, I signed up as a customer at two shared hosting providers who use FOSSBilling. This post details the results of my testing FOSSBilling from the perspective of a shared hosting customer. Also presented after the test results are, courtesy of <a href="https://lowendspirit.com/index.php?p=/profile/BelleNottelling" rel="nofollow">@BelleNottelling</a>, insights about the upcoming 0.6.0 FOSSBilling release along with tips for using FOSSBilling.</p>

<h2><strong>FOSSBilling Demo</strong></h2>

<p>The FOSSBilling website has a <a rel="nofollow" href="https://fossbilling.org/demo">great demo,</a> which enables everyone to see both the administrator panel interface and the client area interface.</p>

<h2><strong>FOSSBilling vs. Blesta</strong></h2>

<p>When <a rel="nofollow" href="https://freevps.org">FreeVPS.org</a> was started, the FreeVPS Team went with <a rel="nofollow" href="https://www.blesta.com/">Blesta</a> instead of FOSSBilling because the FreeVPS Team had experience with Blesta. However, unless, like FreeVPS, you have a generous donor of a Blesta license (Thanks <a href="https://lowendspirit.com/index.php?p=/profile/Cloudie" rel="nofollow">@Cloudie</a>!), using Blesta normally requires <a rel="nofollow" href="https://www.blesta.com/pricing/">monthly payments or more expensive lifetime licenses.</a> Also, Blesta is <a rel="nofollow" href="https://www.blesta.com/#:~:text=Open%20Codebase,code%20at%20your%20finger%20tips.">not 100% open source.</a></p>

<h2><strong>FOSSBilling Tested At HostByBelle And At YetiNode</strong></h2>

<p>Shared hosting providers already using FOSSBilling in production include <a rel="nofollow" href="https://hostbybelle.com">HostByBelle</a> and <a rel="nofollow" href="https://yetinode.com">YetiNode.</a> Belle is one of the FOSSBilling developers. She is <a href="https://lowendspirit.com/index.php?p=/profile/BelleNottelling" rel="nofollow">@BelleNottelling</a> here on LES. YetiNode is run by our very own indomitable Yeti, <a href="https://lowendspirit.com/index.php?p=/profile/AuroraZero" rel="nofollow">@AuroraZero</a>.</p>

<p>My overall experience testing FOSSBilling as a customer was excellent at both HostByBelle and at YetiNode. I had no trouble launching a test html page on each provider's shared hosting service. Here are links to the two test pages: <a rel="nofollow" href="https://hbb.metalvps.com">HostByBelle</a> and <a rel="nofollow" href="https://ytn.metalvps.com">YetiNode.</a></p>

<p>Both providers use <a rel="nofollow" href="https://hestiacp.com/">HestiaCP</a> to provision shared hosting. Billing with FOSSBilling and provisioning with HestiaCP were very similar at HostByBelle and at YetiNode. I tried FOSSBilling's Support Ticket interface at HostByBelle. <a href="https://lowendspirit.com/index.php?p=/profile/AuroraZero" rel="nofollow">@AuroraZero</a> talked with me by PM here at LES.</p>

<h2><strong>Screenshots Of FOSSBilling At HostByBelle</strong></h2>

<p>The gorgeous dark theme <img src="https://lowendspirit.com/plugins/emojiextender/emoji/twitter/smile.png" title=":)" alt=":)" height="18" /> shown in these screenshots comes from the reverse colors engineered by Chrome Browser's High Contrast Accessibility Extension. These screenshots are what I actually saw during sign-up at HostByBelle. If you also wish to see the normal, non-reversed color mode, please look at the above linked FOSSBilling demo.</p>

<ul>
<li><strong>Sign-Up</strong></li>
</ul>

<p><img src="https://lowendspirit.com/uploads/editor/fw/hgest41xrlvj.jpeg" alt="" title="FOSSBilling sign-up dialogue at HostByBelle" /></p>

<ul>
<li><strong>Dashboard</strong></li>
</ul>

<p><img src="https://lowendspirit.com/uploads/editor/iw/dmxxe62njip5.jpeg" alt="" title="FOSSBilling dashboard at HostByBelle" /></p>

<ul>
<li><strong>Ordering</strong></li>
</ul>

<p><img src="https://lowendspirit.com/uploads/editor/7s/puc5lel0kfw8.jpeg" alt="" title="Order Dialog at HostByBelle" /></p>

<ul>
<li><strong>Payment</strong></li>
</ul>

<p><img src="https://lowendspirit.com/uploads/editor/72/newk6qhhpio7.jpeg" alt="" title="Payment Dialog at HostByBelle" /></p>

<ul>
<li><strong>Hestia Control Panel</strong></li>
</ul>

<p><img src="https://lowendspirit.com/uploads/editor/ss/k3koms65ctoe.jpeg" alt="" title="Hestia Conttrol Panel at HostByBelle" /></p>

<ul>
<li><strong>Invoices</strong></li>
</ul>

<p><img src="https://lowendspirit.com/uploads/editor/04/10gz57up70i5.jpeg" alt="" title="Invoice at HostByBelle" /></p>

<ul>
<li><strong>Support Tickets</strong></li>
</ul>

<p><img src="https://lowendspirit.com/uploads/editor/uq/zgfzqanagxl5.jpeg" alt="" title="Support Ticket at HostByBelle" /></p>

<ul>
<li><strong>Quick Ticket Reply</strong></li>
</ul>

<p><img src="https://lowendspirit.com/uploads/editor/4p/8gpnfr0t5dwl.jpeg" alt="" title="Support Ticket Reply at HostByBelle" /></p>

<h2><strong>Additional FOSSBilling Discussion</strong></h2>

<ul>
<li><strong>Emails</strong></li>
</ul>

<p>FOSSBilling sent transactional emails every step of the way, including sign-up, payment, and support tickets. The email setups at HostByBelle and at YetiNode differ slightly. HostByBelle uses a transactional email provider, and YetiNode self-hosts its email MTA.</p>

<ul>
<li><strong>Payment Providers</strong></li>
</ul>

<p>FOSSBilling at HostByBelle offered Paypal and payment from account credit. Payment wasn't involved with YetiNode, because I tested their free tier instead of their paid tier. Paypal payment worked fine at HostByBelle.</p>

<ul>
<li><strong>Provisioning Shared Hosting and VPSes</strong></li>
</ul>

<p>Like most billing panels, FOSSBilling requires the use of another additional software package to provision  hosting services. Sometimes, modules can be added to billing panels to send instructions to the additional provisioning software's API.</p>

<p>As shown at both HostByBelle and at YetiNode, FOSSBilling works well with HestiaCP for shared hosting. FOSSBilling's five (including Hestia) already-working provisioning integrations are <a rel="nofollow" href="https://fossbilling.org/docs/product-types/hosting#working-control-panel-integrations">listed in the FOSSBilling Documentation.</a> Integration of Proxmox also has been <a rel="nofollow" href="https://forum.fossbilling.org/d/42-proxmox-and-fossbilling/7">discussed on the FOSSBilling Forum</a> and, more recently (8/21/2023), <a rel="nofollow" href="https://discord.com/channels/747432407757488179/1083093073233444954/1143157411398565888">on the FOSSBilling Discord.</a></p>

<ul>
<li><strong>FOSSBilling Forum</strong></li>
</ul>

<p>If you have additional questions about FOSSBilling, you might want to check out the <a rel="nofollow" href="https://forum.fossbilling.org/">FOSSBilling Forum.</a></p>

<h2><strong>HestiaCP</strong></h2>

<ul>
<li><strong>App Installation</strong></li>
</ul>

<p>As noted above, both HostByBelle and YetiNode use <a rel="nofollow" href="https://hestiacp.com/">Hestia Control Panel</a> for shared hosting installs. Here is HestiaCP's One Click App Installation Panel as seen at YetiNode.com. As expected, the HestiaCP app installation is similar at HostByBelle.</p>

<p><img src="https://lowendspirit.com/uploads/editor/vo/8za00nyvufop.jpeg" alt="" title="HestiaCP One Click App Installer At YetiNode" /></p>

<ul>
<li><strong>Let's Encrypt Certificates</strong></li>
</ul>

<p>SSL certificates from Let's Encrypt were provisioned with one click at both HostByBelle and YetiNode.</p>

<h2><strong>FOSSBilling Updates</strong></h2>

<p>Both FOSSBilling's client theme and its multiple administrative user permissions hopefully will be updated in the next 0.6.0 release or soon thereafter. Belle posted <a rel="nofollow" href="https://discord.com/channels/747432407757488179/1052282259182460990/1134178573805174846">screenshots of the updated client theme</a> on FOSSBilling's Discord.</p>

<h2><strong>Hints From Belle</strong></h2>

<p>Belle said to me, about FOSSBilling, "If someone is going to use it, they should be technical and ideally be able to handle some PHP development."</p>

<p>Speaking of updates and changes, Belle advises FOSSBilling users to review the <a rel="nofollow" href="https://fossbilling.org/docs/changelog">FOSSBilling changelog</a> before updating. Changes occasionally affect people with customized installations, but people "using FOSSBilling as-is out of the box shouldn't really have such issues."</p>

<p>Last, but not least, Belle also advises reading the <a rel="nofollow" href="https://fossbilling.org/docs/faq">FOSSBilling FAQ.</a></p>

<h2><strong>Conclusion</strong></h2>

<p>FOSSBilling quickly and efficiently handled sign up, ordering, invoicing, and passing me to HestiaCP for provisioning. Support tickets and transactional emails from HostByBelle all worked as expected. FOSSBilling successfully kept track of payment and support transactions and also showed the history of each in clear interfaces. With HestiaCP, I quickly installed my above linked html test pages at HostByBelle and at YetiNode. Security certificates, like everything else, were easy.</p>

<p>Belle was super friendly and helpful via the HostByBelle FOSSBilling Support Tickets. <a href="https://lowendspirit.com/index.php?p=/profile/AuroraZero" rel="nofollow">@AuroraZero</a> was, as always, wonderful, both via LES PMs and via email. Both <a rel="nofollow" href="https://hostbybelle.com">HostByBelle</a> and <a rel="nofollow" href="https://yetinode.com">YetiNode</a> are recommended for shared hosting.</p>

<p>FOSSBilling worked excellently from the perspective of a tester of shared hosting. The new era of a working, free, and open source billing platform has begun!</p>
]]>
        </description>
    </item>
    <item>
        <title>Hard Disks 101 - explained</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/6368/hard-disks-101-explained</link>
        <pubDate>Fri, 25 Aug 2023 23:30:11 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>bikegremlin</dc:creator>
        <guid isPermaLink="false">6368@/index.php?p=/discussions</guid>
        <description><![CDATA[<p>In this article, I’ll explain most of the stuff related to hard disks, also known as HDD (Hard Disk Drive). If you are considering buying one or just wishing to learn about them, this should help.<br />
In a separate article, I've explained <strong><a rel="nofollow" href="https://io.bikegremlin.com/13914/disk-data-refresh/" title="how to refresh data on a hard disk">how to refresh data on a hard disk</a></strong> (BikeGremlin site link).</p>

<p><em>"Exited and prout to be posing my fist ever particle on LES."</em><br />
<img src="https://lowendspirit.com/plugins/emojiextender/emoji/twitter/smile.png" title=":)" alt=":)" height="18" /><br />
<a href="https://lowendspirit.com/index.php?p=/profile/AlwaysSkint" rel="nofollow">@AlwaysSkint</a></p>

<p><img src="https://io.bikegremlin.com/wp-content/uploads/2023/08/hard-disk-101.jpg" alt="" title="" /></p>

<p><a name="toc"></a></p>

<p><strong>Table Of Contents (T.O.C.):</strong></p>

<ol>
<li><a rel="nofollow" href="#1">Introduction and a bit of history</a></li>
<li><a rel="nofollow" href="#2">Hard Disk working principle</a><br />
2.1. <a rel="nofollow" href="#2.1">CMR vs SMR recording technology</a></li>
<li><a rel="nofollow" href="#3">The physical size</a></li>
<li><a rel="nofollow" href="#4">Connection interface standards</a><br />
4.1. <a rel="nofollow" href="#4.1">ATA</a><br />
4.2. <a rel="nofollow" href="#4.2">SCSI and SAS</a><br />
4.3. <a rel="nofollow" href="#4.3">SATA</a><br />
4.4. <a rel="nofollow" href="#4.4">NVMe</a><br />
4.5. <a rel="nofollow" href="#4.5">External drive connection standards</a></li>
<li><a rel="nofollow" href="#5">Hard disk performance basics</a></li>
<li><a rel="nofollow" href="#6">Hard disk technical specs</a><br />
6.1. <a rel="nofollow" href="#6.1">Cache memory size</a><br />
6.2. <a rel="nofollow" href="#6.2">Platter rotation speed</a><br />
6.3. <a rel="nofollow" href="#6.3">Seek time and latency</a><br />
6.4. <a rel="nofollow" href="#6.4">Sequential and random data transfer speed</a><br />
6.5. <a rel="nofollow" href="#6.5">Durability stats</a><br />
6.6. <a rel="nofollow" href="#6.6">Physical characteristics</a><br />
6.7. <a rel="nofollow" href="#6.7">Capacity</a><br />
6.8. <a rel="nofollow" href="#6.8">Air vs Helium</a></li>
<li><a rel="nofollow" href="#7">Hard disk buying recommendations</a></li>
<li><a rel="nofollow" href="#8">Conclusion</a></li>
</ol>

<p><a name="1"></a></p>

<h1>1. Introduction and a bit of history</h1>

<blockquote><div>
  <p>The 10-second attention span people who like to "just skim" articles might want to skip straight to the <a rel="nofollow" href="#2">chapter 2</a>.</p>
  
  <p>Relja BrevityIsNotMyVirtue Novović</p>
</div></blockquote>

<p>There was a time when people used tapes to store large amounts of data. The main downside of using a tape for storage is the difficulty of finding a certain file, without reading the entire tape - (re)winding only gets you so far. It was much like playing a music cassette tape or a gramophone record.</p>

<p>In 1957, IBM built the first commercially available hard disks. HDDs allowed people to read, edit, delete, or add data to any file stored on the drive "right away." This is called "<strong>random access</strong>" and we take it for granted nowadays, but it was a major breakthrough in storage technology.</p>

<p>Over the following two decades, tape storage fought hard, but eventually lost in the vast majority of categories. There still are use cases where tape storage is the optimal choice, but that is a topic for a separate article.</p>

<p>Of course, the first hard disks were behemoths, used in enterprise server rooms and resembling modern day washing machines more than anything else. Their 24 inch large media was spun using powerful motors. Fun fact: my father and I put one such hard disk motor on our lawn mower, back in the 90s when there was a fuel shortage in my country. That thing is still running nicely at the time of writing, using three-phase 50 Hz 220V power.</p>

<p><img src="https://io.bikegremlin.com/wp-content/uploads/2023/08/old-hard-disk-motor-still-working-2.jpg" alt="" title="" /><br />
An old hard disk motor - 1 horsepower, 3-phase power supply.<br />
...For the life of me, I can’t remember if it was from a Sperry-Univac, or a decade younger Honeywell-Bull system...<br />
Picture 1</p>

<p>Compare that to today’s 3.5" hard drives (and their smaller 2.5" laptop-friendly cousins). We’ve certainly come a long way. Nowadays, Solid State Drives (SSD) have replaced the traditional hard drive as the norm for most desktop computers and laptops. However, for storing large amounts of data, the good old <strong>hard disks are pretty much alive and kicking</strong> - with some more tech. improvements over the past few years. They are the stars of this article.  <img src="https://lowendspirit.com/plugins/emojiextender/emoji/twitter/smile.png" title=":)" alt=":)" height="18" /></p>

<p><a rel="nofollow" href="#toc">- T.O.C. -</a></p>

<p><a name="2"></a></p>

<h1>2. Hard Disk working principle</h1>

<blockquote><div>
  <p>I’ve seen programmers who don’t understand these concepts make an application that saves thousands of several-byte-small log files (i.e. very small files), and then get surprised to see the application take a huge amount of storage space. So, despite countless super-fast online programming courses, <strong>it helps to put some effort into understanding the hardware your stuff will be running on</strong>.</p>
  
  <p>Relja Novović - shower thoughts</p>
</div></blockquote>

<p>Let me briefly touch upon how these things work. A minute spent on the following text and pics  should help you more easily understand hard disk technical specs. Ready?</p>

<p>Hard disks, as their name says, have discs covered in magnetic material which can be magnetised to north (N) or south (S) polarity. These discs are also called <strong>platters</strong>. There can be two or more platters in a hard disk drive (modern 3.5" drives can have up to five platters).</p>

<p>Similarly to a gramophone, the platters spin, and there are heads that can move across their surface to perform reading or writing.<br />
Thanks to the damn hipsters, I hope that even the younger readers know what a gramophone is…</p>

<p><a name="p2"></a></p>

<p><img src="https://io.bikegremlin.com/wp-content/uploads/2023/08/hard-disk-parts-sketch.png" alt="" title="" /><br />
Hard disk drive's basic parts drawing<br />
Picture 2</p>

<p>In the picture above, the DISK spins at over 5,000 rpm, while the R/W HEAD moves left-right, floating just about 10nm above its surface (and reading or writing data to it by using electromagnetic induction). When a hard disk drive is turned off, its heads are locked in place so they don’t hit the platters if the drive is transported. This is called <strong>parking</strong> the heads.</p>

<p>This part serves to introduce you to the technical terms you may hear: <strong>cylinders, tracks, and sectors</strong>. Alas, when you <strong>format</strong> a hard disk drive, you are logically dividing each platter into concentric <strong>tracks</strong> (imagine race tracks at the Olympics), and dividing each track into <strong>sectors</strong> (smaller sections along the track).</p>

<p>Every sector contains a set number of bytes (groups of eight digits that can only be a logical one or a logical zero). It’s usually 512 bytes on most file systems. Several sectors are grouped into a <strong>cluster</strong>, <strong>the smallest amount of disk’s storage space that can be taken by one file</strong>. If your cluster is, say 4096 bytes size, and you save a file that is only 1024 bytes large, it will still take up the entire cluster. However, if a file is 8192 bytes large, it will span across two 4094-byte clusters.</p>

<p>Before I totally confuse you by explaining what a cylinder is, a picture will explain it better:  <img src="https://lowendspirit.com/plugins/emojiextender/emoji/twitter/smile.png" title=":)" alt=":)" height="18" /></p>

<p><img src="https://io.bikegremlin.com/wp-content/uploads/2023/08/hard-disk-tracks-sectors-and-cylinders-sketch.png" alt="" title="" /><br />
Hard disk's logical division: cylinders, tracks and sectors<br />
Image source: Wikipedia<br />
Picture 3</p>

<p>So, now you clearly understand what a cylinder is: a set of tracks on the same distance from the platter’s centre, across all the platters in the drive. <strong>Cylinders are no longer used for addressing hard disk storage</strong> - they have been replaced with logical block addressing (LBA), but that's a topic for a separate article.</p>

<p>Here's what that looks like in real life:</p>

<p><img src="https://io.bikegremlin.com/wp-content/uploads/2023/08/hard-disk-internals-shown.jpg" alt="" title="" /><br />
Hard disk internals photo<br />
Picture 4</p>

<p>Well, I hope you are now smarter than you were this morning. <img src="https://lowendspirit.com/plugins/emojiextender/emoji/twitter/smile.png" title=":)" alt=":)" height="18" /> Let us move on to the more “flashy” stuff.</p>

<p><a rel="nofollow" href="#toc">- T.O.C. -</a></p>

<p><a name="2.1"></a></p>

<h2>2.1. CMR vs SMR recording technology</h2>

<p>This one is rather important, especially if you value performance and reliability.</p>

<p>Remember what we’ve just said about tracks and how those are created in concentric circles on the platters when you format a hard drive? Each track contains sectors where bits are written and read from. That’s the old style, called <strong>CMR</strong> (Conventional Magnetic Recording).</p>

<p>Fact: you need more room (more track width) to write a bit to a track (i.e. polarize its magnetisation) than you need to read from it. That is why some genius thought it was a jolly good idea to have the tracks overlap! That is how <strong>SMR</strong> (Shingled Magnetic Recording) drives were born.</p>

<p><img src="https://io.bikegremlin.com/wp-content/uploads/2023/08/cmr-vs-smr-hard-disk-drives.png" alt="" title="" /><br />
CMR vs SMR system of writing and reading data from a hard disk's platter<br />
Picture 5</p>

<p>SMR lets you write about 25% more data on a given platter size, which lets you build larger capacity drives at a lower cost. <strong>What could possibly go wrong?</strong></p>

<p>Well, SMR relies on the fact that the head for reading can work with a narrower track. But when you need to write to a track, you will also rewrite the adjacent tracks. So, if you write data on an SMR drive track, and its adjacent tracks have some data, you would need to first read and rewrite that data too, in order to prevent data corruption. This makes <strong>SMR drives perform awfully poorly when writing if they are loaded with data</strong>.</p>

<p>Some manufacturers don't disclose when their drives are built using the SMR system. Make sure to double check and avoid buying such drives - at least that's what I do and recommend.</p>

<p><a rel="nofollow" href="#toc">- T.O.C. -</a></p>

<p><a name="3"></a></p>

<h1>3. The physical size</h1>

<blockquote><div>
  <p>3.5 inches is quite large.</p>
  
  <p>Japanese proverb</p>
</div></blockquote>

<p>Today, hard disks come in two formats: 2.5" and 3.5".</p>

<p>2.5" are the smaller ones with platters that spin slower, make less noise, heat and use less power. They are designed for use in laptops and portable (external) hard drive cases, and a part of this design is a more rugged mechanism of parking drive heads to avoid any damage in case of bumps or similar. Thanks to their lower power consumption, they can use a USB cable for power supply (handy for portable drives). An <strong>exception</strong> are server-grade 2.5" drives built to be compact, but work 24/7 in servers. Either option is more expensive per TB of storage space compared to 3.5" drives.</p>

<p>3.5" is the usual size for drives designed to be placed in desktop computers and many servers and NAS drives. These are generally faster, louder, require more power, but offer higher storage capacities for the price.</p>

<p><a rel="nofollow" href="#toc">- T.O.C. -</a></p>

<p><a name="4"></a></p>

<h1>4. Connection interface standards</h1>

<blockquote><div>
  <p>The nicest thing about standards is that there are so many of them to choose from.</p>
  
  <p>Ken Olsen</p>
</div></blockquote>

<p>Gotta plug it in somehow, right? Let us go over some of the most widely used standards, starting with a couple of obsolete ones. Note that the given data transfer speed info is related to the connection's capacity, it doesn't mean every (or any compatible) drive can reach that speed.</p>

<p><a rel="nofollow" href="#toc">- T.O.C. -</a></p>

<p><a name="4.1"></a></p>

<h2>4.1. ATA</h2>

<p>An obsolete standard. ATA (Advanced Technology Attachment) is the standardized name for what was also called PATA (Parallel ATA) and IDE (Integrated Drive Electronics). It uses a parallel connection, meaning several bits are transferred all at once. That is why ATA cables are flat and very wide.</p>

<p>ATA data transfer speeds go up to <strong>133 MB/s</strong>.</p>

<p><a rel="nofollow" href="#toc">- T.O.C. -</a></p>

<p><a name="4.2"></a></p>

<h2>4.2. SCSI and SAS</h2>

<p>SCSI (pronounced as “scuzzy”) stands for “Small Computer System Interface.” The standard started gaining popularity during the ‘80s (20th century) as a fast, high-quality standard for enterprise storage, because it allowed a connection of a relatively large number of drives, often placed in RAID (Redundant Array of Inexpensive Disks).</p>

<p>It started as a high-speed parallel connection, but got updated over the years. Its latest version uses a serial connection. It’s called “Modern Serial Attached SCSI” (SAS) and the latest models reach data transfer speeds of up to <strong>1,875 MB/s</strong>. This stuff is (and always has been) expensive, and can be found in servers.</p>

<p>SAS interface can also accept SATA drives (though SATA interface won’t accept any SAS drives).</p>

<p><a rel="nofollow" href="#toc">- T.O.C. -</a></p>

<p><a name="4.3"></a></p>

<h2>4.3. SATA</h2>

<p>SATA (Serial Advanced Technology Attachment). This is the de facto current desktop and laptop storage connection standard. It uses a serial connection at a high frequency (and speed), and allows for thin and long (up to one metre) cables.</p>

<p>SATA data transfer speeds go up to <strong>600 MB/s</strong> (the latest, SATA III standard).</p>

<p>This interface is fast enough for most consumer-grade hard drives. If you are buying a HDD today, and reading this, you are most likely looking for a SATA HDD.</p>

<p><a rel="nofollow" href="#toc">- T.O.C. -</a></p>

<p><a name="4.4"></a></p>

<h2>4.4. NVMe</h2>

<p>NVMe (Non-volatile Memory Express) was originally designed to work with SSDs (Solid State Drives). Unlike other storage media interfaces, NVMe lets you connect your drives directly to the CPU, using the PCIe interface. This allows for very low latencies and huge data transfer speeds of over <strong>10,000 MB/s</strong> over PCIe 5.0.</p>

<p>At the time of writing, it is mostly used for SSDs (using M.2 connection format), though some companies, like Seagate, are working on building a <a rel="nofollow" href="https://blog.seagate.com/enterprises/seagate-unveils-worlds-first-native-nvme-hdd-demo-at-ocp/" title="HDD that natively connects via NVMe">HDD that natively connects via NVMe</a>.</p>

<p>If you’d like to know more, Western Digital’s blog has a <a rel="nofollow" href="https://blog.westerndigital.com/nvme-important-data-driven-businesses/" title="great article on NVMe">great article on NVMe</a>.</p>

<p><a rel="nofollow" href="#toc">- T.O.C. -</a></p>

<p><a name="4.5"></a></p>

<h2>4.5. External drive connection standards</h2>

<p>Let’s do a quick overview of the connection standards for external drives (portable drives, NAS expansion units, and similar).</p>

<p><strong>FireWire</strong><br />
A standard launched by Apple, which has now become obsolete for reasons beyond the scope of this article. FireWire 800 standard could reach data transfer speeds of up to <strong>100 MB/s</strong>.</p>

<p><strong>USB</strong><br />
Current standard for connecting many external 2.5” drives is USB 3.1 with data transfer speeds of up to <strong>1,250 MB/s</strong>, while the newer USB 3.2 can go up to <strong>2,500 MB/s</strong> (older USB 1.0 and 2.0 standards are now practically obsolete).</p>

<p>Even newer USB4 standard comes in 20 Gbps (that is giga<strong>-bits</strong>, not giga-bytes per second) and 40 Gbps (<strong>5,000 MB/s</strong> - that is mega<strong>-bytes</strong> per second) variants (the 40 Gbps version requires the more expensive 40 Gbps cables).</p>

<p>There should also be a USB4 v 2.0 standard with speeds of 80 Gbps (<strong>10,000 MB/s</strong>), but I have never seen any appliances or even cables for that one.</p>

<p>Note, there is a USB C connector (physical connector) standard that often gets confused with the transfer speed standards of USB 3.1, 3.2, USB4 etc, but you technically could have the older, slower USB 3.1 working over a USB C physical connector.</p>

<p>USB is capable of supplying power over the same cable. USB A connector cables can supply up to 7.5W, while USB C connector cables can supply up to 100W or even 240W with the latest USB-C PD connector standard.</p>

<p><strong>Thunderbolt</strong><br />
This standard requires that your motherboard supports it (which is not as commonly the case as it is with USB 3.2 nowadays). It offers speeds of up to 40 Gbit/s (<strong>5,000 MB/s</strong>).</p>

<p>It connects by combining the PCIe and DP (DisplayPort) signals into two serial signals, and also provides the needed power supply of up to 100W - all using the same cable.</p>

<p>In practice, Thunderbolt connectors and equipment are not very widely used, at least in my experience.</p>

<p><strong>eSATA</strong><br />
Another standard that is getting obsolete (though <a rel="nofollow" href="https://www.synology.com/en-global" title="Synology">Synology</a> uses it for connecting some of their NAS expansion units). It doesn’t supply any power (so you need a separate power supply for the eSATA drives), though there is the eSATAp standard which does.</p>

<p>In its latest &amp; greatest version, eSATA standard provides data transfer speeds of up to <strong>600 MB/s</strong>.</p>

<p>I think this covers the standards you are most likely to encounter. Let us move on.</p>

<p><img src="https://io.bikegremlin.com/wp-content/uploads/2023/08/connection-standards-overview.png" alt="" title="" /><br />
Connector types overview<br />
Picture 6</p>

<p><a rel="nofollow" href="#toc">- T.O.C. -</a></p>

<p><a name="5"></a></p>

<h1>5. Hard disk performance basics</h1>

<blockquote><div>
  <p>A child of five would understand this. Send someone to fetch a child of five.</p>
  
  <p>Groucho Marx</p>
</div></blockquote>

<p>Hard disks use spinning platters to store data. A read/write head moves up-down over the platter surface (see <a rel="nofollow" href="#p2">picture 2</a> for details). That is why they can read or write a lot faster if they are doing it all in one go. That is called <strong>sequential access</strong> reading/writing. If, on the other hand, they need to read a file (or files) dispersed over several non-adjacent sectors, that kind of reading/writing, called <strong>random access, is much slower</strong>.</p>

<p>Likewise, because reading only requires to, well, read the magnetic polarity of bits, while writing requires actual magnetisation of each bit, <strong>hard disk read speeds are a lot faster than their write speeds</strong>.</p>

<p>So, even if you buy the latest, greatest and fastest hard disk drive in the world, you should expect its random access speeds to be lower than its sequential access speeds, and its writing speeds to be lower than its reading speeds.</p>

<p>Manufacturers often state the most “optimistic” scenarios in their selling brochures, so it’s good to keep this in mind and double-check.</p>

<p><a rel="nofollow" href="#toc">- T.O.C. -</a></p>

<p><a name="6"></a></p>

<h1>6. Hard disk technical specs</h1>

<blockquote><div>
  <p>There is no amount of memory that human stupidity can’t fill up.</p>
  
  <p>Živojin Novović, when we discussed our home PC’s hard disk upgrade</p>
</div></blockquote>

<p>In this “chapter,” I will cover the basic hard disk drive technical specifications, explain what each one means, how it affects the overall performance, and what its ballpark values are. I’ll use SATA drives as examples, since those are the most popular consumer and “prosumer” drives at the time of writing.</p>

<p>For brevity, I will not discuss every existing aspect of hard drives, but concentrate on the stuff you can quickly check and compare when deciding which drive to purchase.</p>

<p><a name="6.1"></a></p>

<h2>6.1. Cache memory size</h2>

<p>I have already explained <a rel="nofollow" href="https://io.bikegremlin.com/5621/optimization-03-caching/#1" title="what caching is">what caching is</a> (the context of that article was about website page caching, but the principle is the same). It boils down to using fast storage, such as RAM (Random Access Memory), to quickly store and retrieve data.</p>

<p>For a hard disk, this means: when you want to save a file, you just send it to the drive’s cache and call it a day, letting the drive worry about writing it to its platters for a permanent storage.</p>

<p>A similar thing happens when you are reading data from the drive. Say you open the document “pigeon-deliveries-june.doc”. Drives have smart controllers that can predict the likelihood of you requesting a file such as "pigeon-deliveries-july.doc" next, letting them take the time to read that file and load it into the drives cache, so you can retrieve it quickly if you decide to.</p>

<p>Caching, especially for reading files, is a hit-and-miss, but it can often help provide a faster perceived performance - i.e. despite the drive having the same read speed, you will effectively read and write your files faster, thanks to the use of cache.</p>

<p>Of course, cache memory is a lot more expensive than platter storage space, so even 1,048,576MB (about 1TB) large drives often come with only 64 MB of cache. That is why <strong>cache can’t help when reading or writing large amounts of data</strong>. Having said that, since hard disks are the slowest when writing, and most users write (save) a lot of smaller files at irregular intervals, cache helps a lot in practice.</p>

<p>Cache size usually depends on the drive's total storage capacity (larger drives have more cache memory). <strong>Typical cache size ranges from 32MB for lower end 1TB drives, to 256MB for larger capacity or high-end drives</strong>. More cache costs more, but manufacturers usually provide the optimal ratio based on drive’s capacity and intended use.</p>

<p><a rel="nofollow" href="#toc">- T.O.C. -</a></p>

<p><a name="6.2"></a></p>

<h2>6.2. Platter rotation speed</h2>

<p>The faster drive’s platters spin, the faster you can read/write data (sequential read/write), and the less time it takes for the sector with the needed data to reach the reading/writing head (for random access). However, higher rotation speed also requires more power, and creates more heat and noise.</p>

<p><strong>Typical speeds are 5,400 and 7,200 RPM, though some enterprise (SAS) drives spin up to 15,000 RPM</strong>.</p>

<p>Because of the extra noise, <strong>faster needn’t always be better</strong>, it depends on your use case.</p>

<p><a rel="nofollow" href="#toc">- T.O.C. -</a></p>

<p><a name="6.3"></a></p>

<h2>6.3. Seek time and latency</h2>

<p>We know that read/write heads move across the platters. This takes time. Moving from one track to the next is a lot faster than moving from the outermost all the way to the innermost track. So, we have:</p>

<ul>
<li><strong>Track-to-track seek time</strong>: often below <strong>2ms</strong>.</li>
<li><strong>Average seek time</strong>: often about <strong>5ms</strong>.</li>
</ul>

<p>For some reason, seek time specs are next to impossible to get for most modern drives.</p>

<p>Now, since the platters are spinning, it might take some time for the sector you need to come under the reading head. Average time taken for this to happen is called the <strong>average rotational latency</strong>. For a drive that spins at 5,400 RPM, that is 60 (seconds) divided by 5,400, divided by 2 (to get the average). So, about 5.55ms. This goes down to <strong>4.16ms</strong> for 7,200 RPM drives, and as low as 2ms for the 15,000 RPM drives.</p>

<p>Do not mix this rotational latency with the <strong>average read/write latency</strong>, which is:</p>

<ul>
<li>how long it takes for the drive's controller to figure out where the required block of data is on the platters,</li>
<li>move the read/write head to it,</li>
<li>and start data read/write process (transfer).</li>
</ul>

<p>Average read latencies often go to about <strong>30ms</strong> (and max. latencies can be as high as up to one second), while average write latencies can be ten times longer, so about <strong>300ms</strong>.</p>

<p>These stats affect random read/write performance, but don’t affect sequential read/write performance.</p>

<p><a rel="nofollow" href="#toc">- T.O.C. -</a></p>

<p><a name="6.4"></a></p>

<h2>6.4. Sequential and random data transfer speed</h2>

<p><strong>Data transfer speed</strong> provided by manufacturers is basically average sequential read/write speed. It is often around <strong>200 MB/s</strong> for modern drives. Drives that spin faster usually have a bit higher "data transfer speed" (i.e. average sequential read/write data transfer rate).</p>

<p><strong>Random read/write performance</strong> gives data transfer speeds that are about <strong>1%</strong> (one percent) of the sequential read/write speeds (so about 2 MB/s). These are often expressed in IOPS (Inputs and Outputs Per Second). In another article I've <a rel="nofollow" href="https://io.bikegremlin.com/7725/hosting-catches/#1.4" title="explained IOPS">explained IOPS</a> in more detail.</p>

<p>IOPS results differ based on the size of data blocks being read or written, but let's say that ballpark values are in hundreds of IOPS, and that with modern drives, write performance gives more IOPS thanks to the good use of caching. When a disk reads, it needs to read the given files wherever they are, often doing a lot of back-and-forth. When it writes, the data is stored in cache and then written in a more optimized way (less "random" write head movement).</p>

<p><a rel="nofollow" href="#toc">- T.O.C. -</a></p>

<p><a name="6.5"></a></p>

<h2>6.5. Durability stats</h2>

<p>These are the stats related to durability. Note that these stats have more to do with the drive’s intended use than its actual quality (I’ll go to recommend models later on).</p>

<p><strong>Power on hours per year</strong><br />
8,760 is for drives designed to work 24/7 (NAS and enterprise/server drives).<br />
2,400 is for drives intended for personal or business computers (about 8 hours of daily use).</p>

<p><strong>Unrecoverable read errors per bits read (URE)</strong><br />
This is basically the probability of a drive not being able to read a piece of written data (even with error correction attempted). 1 bit errror in 10^14 bits read is the usual number for consumer grade drives, while 1 in 10^15 or 10^16 is more common for NAS and enterprise/server grade drives.</p>

<p>In theory, 1 in 10^14 means there will be an error for every ~ 12 TB of data written, but as I said at the start of this “chapter,” this info has more to do with a drive’s intended use and manufacturer’s warranty, than it does with the actual durability and reliability of the drive.</p>

<p><strong>Workload Rate Limit (WRL)</strong><br />
How many terabytes (TB) per year you can read or write to the drive. Consumer grade stuff is good for about <strong>50TB</strong>, while the enterprise stuff is rated at <strong>150TB</strong> per year or more.</p>

<p><strong>Mean Time Between Failures (MTBF)</strong><br />
The arithmetic mean (average) of time between failures. Usually expressed in hours, and ranges around one million. Based on my knowledge and experience, this metric can be disregarded.</p>

<p>A stat that is actually useful (but it is not provided by drive manufacturers) is the <strong>Average Failure Rate (AFR)</strong>. Unfortunately, to get this data, you would need a ton of input from service centres around the world. Or rely on Backblaze quarterly stats (<a rel="nofollow" href="https://www.backblaze.com/blog/backblaze-drive-stats-for-q2-2023/" title="Backblaze 2023 Q2 stats link">Backblaze 2023 Q2 stats link</a>) if they have used a drive that you are looking to buy.</p>

<p><a rel="nofollow" href="#toc">- T.O.C. -</a></p>

<p><a name="6.6"></a></p>

<h2>6.6. Physical characteristics</h2>

<p>Apart from the size (form factor) explained in <a rel="nofollow" href="#3">chapter 3</a>, these are some other important disk drive physical characteristics.</p>

<p><strong>Power consumption</strong><br />
How many watts the drive consumes when working on <strong>average</strong> (from about <strong>5W to 10W</strong> or more for the larger enterprise grade drives). Faster spinning drives consume more power. Air filled drives (as opposed to helium filled ones) consume more power, since air creates more drag.</p>

<p><strong>Noise (Acoustics)</strong><br />
Drives make noise when they are spinning, and even more noise when they are reading or writing. This noise level is expressed in A-weighted decibels (dBA). dB scale is logarithmic, meaning a 10 dB increase means 10 times louder, while a 20 dB increase means 100 times louder (10 times 10).</p>

<p>For example, 20 dBA is whisper, 60 dBA is normal conversation, and 100 dBA is a loud motorcycle.</p>

<p>Most drives are below 30 dBA when idling, and above 30 dBA when reading. But even a couple of dBA difference is noticeable, as explained in the previous paragraph. 20 dBA idle and 25 dBA when reading/writing is considered to be very quiet for hard drives.</p>

<p><a rel="nofollow" href="#toc">- T.O.C. -</a></p>

<p><a name="6.7"></a></p>

<h2>6.7. Capacity</h2>

<p>Modern hard disk storage capacity is expressed in terabytes (TB). TB is a thousand megabytes (MB). Some smaller models have sizes of 500 MB or similar, but those are getting obsolete. Modern drives range from one to a dozen or more TB.</p>

<p>Larger capacity drives often have more platters, consume more power and cost more.</p>

<p><a rel="nofollow" href="#toc">- T.O.C. -</a></p>

<p><a name="6.8"></a></p>

<h2>6.8. Air vs Helium</h2>

<p>For decades, hard disks had a small hole (with a dust filter) to let the air move in and out (as the inside air temperature changes). Read/write heads float at about a dozen nanometres above the platters. If the air becomes too thin (at high altitudes), air-filled drives will not work properly, their heads will drop and scratch the platters.</p>

<p>Helium, unlike air, is more stable and provides a lot less drag as the drive platters spin (and its read/write head moves).</p>

<p>The problem with helium is that its molecules are so tiny, that it is very difficult to keep it from seeping out of the hard drive’s case. Some extraordinary high tech. advancements over the past decade have allowed manufacturers to seal their hard disk drive units well enough for the damn gas to stay inside. And voila, today we have helium filled drives.</p>

<p>Helium filled drives make less noise, use less power (all thanks to the lower drag), and, because they are completely sealed, can operate safely in low pressure environments. Making the tight seal costs more, so at the time of writing, only high-capacity drives (10TB or more) come helium filled.</p>

<p><a rel="nofollow" href="#toc">- T.O.C. -</a></p>

<p><a name="7"></a></p>

<h1>7. Hard disk buying recommendations</h1>

<blockquote><div>
  <p>I am not rich enough to buy cheap stuff.</p>
  
  <p>English proverb ( <em>if this one doesn't get me banned, nothing will!</em>  <img src="https://lowendspirit.com/plugins/emojiextender/emoji/twitter/smile.png" title=":)" alt=":)" height="18" />  )</p>
</div></blockquote>

<p>In this article I'll say what I would buy (or have bought). I am not in a position to test dozens of models, but I work with computers for a living, and I like listening to people: service technicians, system administrators (and the good folks of the LowEndSpirit forum <img src="https://lowendspirit.com/plugins/emojiextender/emoji/twitter/smile.png" title=":)" alt=":)" height="18" /> ).</p>

<p><strong>How big?</strong><br />
If at all possible, for sizes of 2TB or smaller, do not buy a hard disk drive, get an NVMe or at least a SATA SSD. Today, hard disks make sense for <strong>4TB or larger sizes</strong>.</p>

<blockquote><div>
  <p>For a NVMe SSD, I use and recommend <a rel="nofollow" href="https://www.amazon.com/Samsung-970-EVO-Plus-MZ-V7S2T0B/dp/B07MFZXR1B?content-id=amzn1.sym.7d2e00dd-9358-4f89-aca0-04685eb73811%3Aamzn1.sym.7d2e00dd-9358-4f89-aca0-04685eb73811&amp;crid=11BKNETITYL8V&amp;cv_ct_cx=samsung%2Bevo%2B970&amp;keywords=samsung%2Bevo%2B970&amp;pd_rd_i=B07MFZXR1B&amp;pd_rd_r=a3d5dec9-f62d-4220-9e67-129adab39f11&amp;pd_rd_w=gpL58&amp;pd_rd_wg=4P27z&amp;pf_rd_p=7d2e00dd-9358-4f89-aca0-04685eb73811&amp;pf_rd_r=SKETS09ZGCHKDH9PWAZ1&amp;qid=1692769610&amp;sbo=RZvfv%2F%2FHxDF%2BO5021pAnSA%3D%3D&amp;sprefix=samsung%2Bevo%2B970%2Caps%2C244&amp;sr=1-1-5f457e4f-4cf5-45bd-948b-58563dcb013a&amp;ufe=app_do%3Aamzn1.fos.006c50ae-5d4c-4777-9bc0-4513d670b6bc&amp;th=1&amp;linkCode=ll1&amp;tag=ciklogremlin-20&amp;linkId=0b3e30ccce7b8761402e2f29cf284e81&amp;language=en_US&amp;ref_=as_li_ss_tl" title="Samsung EVO 970 Plus">Samsung EVO 970 Plus</a> (Amazon affiliate link). It costs well under $100 for the 2TB version, it is super-reliable and far from slow, even under high loads. Note that it supports PCIe 3 speeds only, but for most use cases that means less heat, and performance that is more than good enough.</p>
  
  <p>PCIe 4 gives a sequential read/write speed boost due to a higher bandwidth, but for general use (i.e. many random read/write operations) it gives next to no benefits (also, PCIe 3 NVMe drives are also pretty fast even for sequential read/write).</p>
  
  <p><em>My opinion:<br />
  At the time of writing I can not recommend a PCIe 4 (or PCIe 5) NVMe drives in good faith. Many models of many manufacturers have problems with heating and reliability - and as the heat rises, you throttle back to PCIe 3 speeds or lower. Samsung has a price premium which is more than worth it for the above-recommended EVO 970 Plus model, but their PCIe4 drives had problems and I'm still not sure how reliable they are despite the firmware updates published after a public outrage.</em><br />
  <strong>UPDATE, December 2023:</strong><br />
  <a rel="nofollow" href="https://www.amazon.com/gp/product/B0CHHFR1LG?th=1&amp;linkCode=ll1&amp;tag=ciklogremlin-20&amp;linkId=b02b3f0ccec87c40b050eec12787e7e8&amp;language=en_US&amp;ref_=as_li_ss_tl" title="Samsung 990 PRO Heatsink">Samsung 990 PRO Heatsink</a> (Amazon affiliate link) looks promising (I’m yet to test it personally). Hardware-supported encryption, and, as far as I know, no firmware-related problems that plagued some Samsung NVMe models. It comes in a 4TB version (along with the 1TB and 2TB alternatives), and a <strong>built-in heatsink</strong> (good cooling is important for PCIe Gen4 speeds). <strong>If I were buying a new system drive today, I’d go with the 4TB version of this one</strong>.</p>
</div></blockquote>

<p><strong>Which brand (manufacturer)?</strong><br />
I'll start with <strong>Toshiba</strong>. Their drives are on the noisier side, but I've had great results with them in terms of reliability and durability. Batches that are sold in my country (and Hungary for that matter) seem to have the lowest percentage of "lemons."</p>

<p>Seagate is another decent manufacturer I've had good results with.</p>

<p>Western Digital (WD) is a highly renowned manufacturer, but I have not had very good results with them.</p>

<p>The thing is: I am only one person. Sure, decades of experience, but that still doesn't make for a statistically useful data. Also, many manufacturers make a blunder every now and then. So I would argue that the <strong>manufacturer is not nearly as important as the particular model</strong>. At the time of buying, see which models perform well and are reliable. If you can normally go and talk to people who deal with warranties of large hardware stores, they will probably be able to tell you which models get the lowest number of returns (though, keep in mind that expensive models get sold a lot less, so them having fewer returns doesn't always mean they are more reliable).</p>

<p><strong>Concrete model recommendations</strong><br />
See the paragraph above to understand the limitations of recommendations like this. With that out of the way, you should also know that most manufacturers have turned to <a rel="nofollow" href="#2.1">SMR recording technology</a> for their consumer-grade drives. I would recommend you <strong>avoid SMR drives</strong>. They are not worth the savings.</p>

<p><em>My opinion:<br />
That makes perfect sense in capitalism: making the low and mid-priced stuff be less durable and less reliable, and practically "forcing" people to buy the more expensive stuff.</em></p>

<p>For larger storage capacities, I would recommend <a rel="nofollow" href="https://www.amazon.com/Seagate-IronWolf-7200RPM-Internal-3-5-Inch/dp/B07H241VJY?crid=GI5MWRK3JNBV&amp;keywords=seagate%2Bironwolf%2B12%2BTB&amp;qid=1692998571&amp;s=electronics&amp;sbo=RZvfv%2F%2FHxDF%2BO5021pAnSA%3D%3D&amp;sprefix=seagate%2Bironwolf%2B12%2Btb%2Celectronics%2C180&amp;sr=1-4&amp;th=1&amp;linkCode=ll1&amp;tag=ciklogremlin-20&amp;linkId=c77a3f5c63b4b6a3e2f16d4bb861f967&amp;language=en_US&amp;ref_=as_li_ss_tl" title="Seagate IronWolf 12TB NAS">Seagate IronWolf 12TB NAS</a> (Amazon affiliate link - 'cause yachts won't pay for themselves! - though <strong>for the US folks, I would recommend buying directly from the manufacturer to get a better and longer warranty protection</strong>) or higher capacity IronWolf models if you need more storage.</p>

<p><img src="https://io.bikegremlin.com/wp-content/uploads/2023/08/seagate-ironwolf-12tb-nas-drive.jpg" alt="" title="" /></p>

<p>If you wish to save some money or don't need that much storage space, you could go with a smaller, <a rel="nofollow" href="https://www.amazon.com/Seagate-IronWolf-7200RPM-128MB-3-5-Inch/dp/B07H2FPFW5?crid=3MFAAGM234D2Z&amp;keywords=seagate+ironwolf+4tb&amp;qid=1692998344&amp;s=electronics&amp;sprefix=seagate+ironwolf+4tb%2Celectronics%2C191&amp;sr=1-4&amp;ufe=app_do%3Aamzn1.fos.f5122f16-c3e8-4386-bf32-63e904010ad0&amp;linkCode=ll1&amp;tag=ciklogremlin-20&amp;linkId=497766b59566446d5cefe092a4036515&amp;language=en_US&amp;ref_=as_li_ss_tl" title="Seagate IronWolf 4TB NAS">Seagate IronWolf 4TB NAS</a> drive (Amazon affiliate link).</p>

<p>Alternatively, if you don't mind a bit more noise, you can't go wrong with Toshiba N-series drives, like <a rel="nofollow" href="https://www.amazon.com/Toshiba-N300-3-5-Inch-Internal-Drive/dp/B099PB3F5J?crid=19K0J9G138WKX&amp;keywords=toshiba%2BN300%2B4tb&amp;qid=1692999921&amp;s=electronics&amp;sprefix=toshiba%2Bn300%2B4tb%2Celectronics%2C181&amp;sr=1-2&amp;th=1&amp;linkCode=ll1&amp;tag=ciklogremlin-20&amp;linkId=8b159490ce130dfdf8700d83eb6f93b7&amp;language=en_US&amp;ref_=as_li_ss_tl" title="Toshiba N300 4TB NAS">Toshiba N300 4TB NAS</a> (Amazon affiliate link).</p>

<p><img src="https://io.bikegremlin.com/wp-content/uploads/2023/08/toshiba-n300-4tb-nas-hard-disk.jpg" alt="" title="" /></p>

<p><a rel="nofollow" href="#toc">- T.O.C. -</a></p>

<p><a name="8"></a></p>

<h1>8. Conclusion</h1>

<p>As with many of my other articles, this one too serves primarily as my own reminder and reference. I will try to keep it up-to-date and correct any errors - my articles aren't written by AI or "content writers," and English is not my native as you have probably figured out by now.  <img src="https://lowendspirit.com/plugins/emojiextender/emoji/twitter/smile.png" title=":)" alt=":)" height="18" /></p>

<p>If you have questions, additions and, especially, corrections - please post a comment.</p>

<p><a rel="nofollow" href="#toc">- T.O.C. -</a></p>

<p>Relja Novović - about the author:<br />
<a href="https://www.bikegremlin.com/about/" rel="nofollow">https://www.bikegremlin.com/about/</a></p>
]]>
        </description>
    </item>
    <item>
        <title>How to Install and Modify Plan 9 from Bell Labs inside Qemu to see the leftovers from old Unix!</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/9171/how-to-install-and-modify-plan-9-from-bell-labs-inside-qemu-to-see-the-leftovers-from-old-unix</link>
        <pubDate>Sat, 01 Mar 2025 01:08:10 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>Not_Oles</dc:creator>
        <guid isPermaLink="false">9171@/index.php?p=/discussions</guid>
        <description><![CDATA[<p><img src="https://lowendspirit.com/uploads/editor/61/q6yaym054n48.png" alt="" title="" /></p>

<p><strong>What?</strong></p>

<p><a rel="nofollow" href="https://en.wikipedia.org/wiki/Plan_9_from_Bell_Labs">Plan 9 from Bell Labs</a> is an operating system from the creators of the <a rel="nofollow" href="https://en.wikipedia.org/wiki/C_(programming_language)">C Programming Language</a> and the <a rel="nofollow" href="https://en.wikipedia.org/wiki/Unix">Unix operating system.</a></p>

<p>Although Plan 9 revolutionized many aspects of Unix, it nevertheless still remains possible in 2025 for Unix fans to access aspects of old Unix by installing Plan 9 inside <a rel="nofollow" href="https://www.qemu.org/">Qemu</a> and changing the Plan 9 boot procedure so that Plan 9 stays in the terminal rather than starting a graphical monitor.</p>

<p><strong>Why?</strong></p>

<ul>
<li><p>This method provides a text-only terminal with "infinite" scrollback. Infinite scrollback is how <a rel="nofollow" href="https://en.wikipedia.org/wiki/Teletype_Model_33">paper terminals</a> used to work before the <a rel="nofollow" href="https://en.wikipedia.org/wiki/Curses_(programming_library)">curses interface</a> and the <a rel="nofollow" href="https://en.wikipedia.org/wiki/Graphical_user_interface">Graphical User Interface ("GUI")</a> were invented.</p></li>
<li><p>Plan 9 runs on the i386 processor architecture in addition to many other architectures.</p></li>
<li><p>Plan 9 has very few system calls compared to other operating systems.</p></li>
<li><p>Plan 9 comes with full source code and build tools.</p></li>
<li><p>The code for Unix userland utilities which remain in Plan 9 is shorter than later versions.</p></li>
<li><p>Plan 9 is fast!</p></li>
</ul>

<p><strong>Why not?</strong></p>

<ul>
<li>This method, which perhaps involves the conflation of text and terminal, is arguably a complete misunderstanding of everything that's truly the greatest about Plan 9. See <a rel="nofollow" href="https://news.ycombinator.com/item?id=11883092">this excellent discussion</a> (but be a little careful when reading, because possibly not everything that's said is 100% correct).</li>
</ul>

<p><strong>How?</strong></p>

<p>Download Plan 9. Options include the classic Plan 9 from Bell Labs (used here, see links just below), as well as, probably, <a rel="nofollow" href="http://9legacy.org/download.html">9legacy</a> and <a rel="nofollow" href="https://9front.org/iso/">9front</a>, neither of which were tested for this post.</p>

<pre><code>wget http://9p.io/plan9checksums.txt 
wget http://9p.io/plan9/download/plan9.iso.bz2

# md5 sum for the bz2 file used here:
# 5183b2d0f11fded871461416f8c78cfb  plan9.iso.bz2
</code></pre>

<p>Make a qemu disk image for our Plan 9 install.</p>

<pre><code># qemu-img create -f qcow2 plan9-console.qcow2 10G
</code></pre>

<p>Use your favorite VNC app set to localhost:5900. Relaunch the app if it crashes when Plan 9 switches from terminal to grraphics.</p>

<pre><code># ssh tom@toto -L 5900:localhost:5900 # VNC via ssh tunnel to your server from your local machine.
</code></pre>

<p>Install Plan 9. Usually it's easy, just boot the ISO and accept the defaults. There are lots of tutorials and videos about the installing Plan 9. Here below is a qemu command to start the install. This command doesn't use KVM. Not using KVM makes slower output, which is easier to read, but you might need to wait a minute for longer operations. If you wish, add KVM with <code>-enable-kvm</code>.</p>

<pre><code>qemu-system-i386 \ 
  -vnc 127.0.0.1:0 \ 
  -hda plan9-console.qcow2 \
  -cdrom plan9.iso \
  -boot d
</code></pre>

<p>After Plan 9 is installed, you see the graphical Plan 9 (screenshot above). Edit plan9.ini with the <a rel="nofollow" href="https://9p.io/magic/man2html/1/vt">Plan 9 VT-100 emulator</a> and the <a rel="nofollow" href="https://en.wikipedia.org/wiki/Ed_(software)">ed editor.</a></p>

<pre><code># In the Plan 9 rio terminal, type vt
# In the vt terminal, type '9fat:' (Don't forget the colon!)
# ed /n/9fat/plan9.ini : 
#   - remove last two lines (monitor, and size)
#   - add a line which says console=0
</code></pre>

<p>After you change plan9.ini, you don't need VNC, just ssh into your server and run Qemu.</p>

<pre><code>qemu-system-i386 \ # Not using KVM makes slower output, which is easier to read.
  -nographic \
  -hda plan9-console.qcow2 \
  -boot c
</code></pre>

<p>Here below is the output of the above. We can launch the Plan 9 versions of old Unix commands like <code>awk</code> and <code>ed</code>. We can get infinite scrollback, almost like a paper terminal.</p>

<pre><code>tom@toto:~/plan9$ cat 20250228a-boot-messages
# 20250228 Boot Plan9 in Qemu with plan9.ini changed to remain in host node shell

tom@toto:~/plan9$ ./start-plan9-console

SeaBIOS (version 1.16.3-debian-1.16.3-2)


iPXE (https://ipxe.org) 00:03.0 CA00 PCI2.10 PnP PMM+06FC6F60+06F06F60 CA00



Booting from Hard Disk...
MBR...PBS1...
Plan 9 from Bell Labpcirouting: BIOS workaround: PCI.0.1.3 at pin 1 link 96 irq 10 -&gt; 9
 disk loader

cpu0:  3091MHz GenuineIntel Celeron (cpuid: AX 0x0663 DX 0x781ABFD)
ELCR: 0C00
497M memory: 497M kernel data, 0M user, 18M swap
found partition #S/sdC0/data 0 20,971,520
disks: sdC0 sdD0
trying sdC0....found 9pcf
.1121326.....................................................................................................0
entry: 0xf0100020

Plan 9
E820: 00000000 0009fc00 memory
E820: 0009fc00 000a0000 reserved
E820: 000f0000 00100000 reserved
E820: 00100000 07fe0000 memory
E820: 07fe0000 08000000 reserved
E820: fffc0000 100000000 reserved
cpu0:  3096MHz GenuineIntel Celeron (cpuid: AX 0x0663 DX 0x781ABFD)
ELCR: 0C00
igbe: p-&gt;cls 0x0, setting to 0x10
#l0: i82543: 1Gbps port 0xFEB00000 irq 11: 525400123456
128M memory: 54M kernel data, 74M user, 297M swap
usbinit...usbd.../boot/usbd: /dev/usb: no hubs
no /srv/usb...no usb disk...pickmethod...read #e/nobootprompt...read #e/bootargs...outin...root is from (tcp,[ . . . copy paste error] 
pickmethod done
bind #æ...bind #S...partinit...auth...user[none]: glenda
usbinit...usbd.../boot/usbd: /dev/usb: no hubs
no /srv/usb...no usb disk...mount usbd...boot: can't open /srv/usb: '/srv/usb' file does not exist
time...
fossil(#S/sdC0/fossil)...version...can't stat /srv/partfs.sdXX: '/srv/partfs.sdXX' file does not exist

init: starting /bin/rc
rio: can't open display: initdisplay: /dev/draw/new: no frame buffer
init: rc exit status: rio 30: display open

init: starting /bin/rc
term% who am i
glenda
term% awk 
Usage: awk [-F fieldsep] [-mf n] [-mr n] [-v var=value] [-f programfile | 'program'] [file ...]
term% ed
a
hello
.
w hello
6
Q
term% ls -l hello
--rw-rw-r-- M 8 glenda glenda 6 Feb 28 21:07 hello
term% fshalt
syncing.../srv/fscons...prompt: 
halting.../srv/fscons...
prompt: 
done halting
Ctrl-a x # Quit qemu
tom@toto:~/plan9$ 
</code></pre>
]]>
        </description>
    </item>
    <item>
        <title>Quick Recipe For Self-Compiled NetBSD-current On A Linveo VPS</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/8525/quick-recipe-for-self-compiled-netbsd-current-on-a-linveo-vps</link>
        <pubDate>Wed, 06 Nov 2024 00:56:33 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>Not_Oles</dc:creator>
        <guid isPermaLink="false">8525@/index.php?p=/discussions</guid>
        <description><![CDATA[<h2>Quick Recipe For Self-Compiled NetBSD-current On A Linveo VPS</h2>

<p><img src="https://lowendspirit.com/uploads/editor/hy/50xjrfom6n2s.png" alt="" title="" /></p>

<p><a rel="nofollow" href="https://linveo.com">Linveo</a> kindly provided several free VPSes to guys actively posting in the <a rel="nofollow" href="https://lowendspirit.com/discussion/8278/les-bsd-thread/p1">LES BSD Thread.</a> Linveo also kindly added <a href="https://lowendspirit.com/index.php?p=/profile/cmeerw" rel="nofollow">@cmeerw</a>'s NetBSD 10 Minimum image. As shown above, NetBSD 10 Minimum now easily can be installed at Linveo directly from "Other BSD" category on the Rebuild page of vmcontrol.linveo.com.</p>

<p>After installing <a href="https://lowendspirit.com/index.php?p=/profile/cmeerw" rel="nofollow">@cmeerw</a>'s NetBSD 10 Minimum image, with help from the NetBSD Guide references linked below, I followed the steps listed below to upgrade from NetBSD 10 to self-compiled NetBSD-current.</p>

<p>Getting to self-compiled NetBSD-current requires us to add to the NetBSD 10 Minimum VPS a NetBSD 10 compiler, other build tools, and the source code for both the NetBSD-current kernel and the NetBSD-current userland. Then a NetBSD-current compiler and other build tools are compiled by the NetBSD 10 compiler. Next, the newly compiled NetBSD-current build tools are used to build the NetBSD-current kernel and the NetBSD-current userland. The end result is a NetBSD-current VPS running its own code as compiled on itself by its own compiler.</p>

<p>My Linveo VPS seems to reboot and to run normally following the upgrade to NetBSD-current. There seems to be plenty of space remaining available, though the X sources and pkgsrc haven't yet been added:</p>

<pre><code>linveo# df -h .
Filesystem     Size   Used  Avail %Cap Mounted on
/dev/dk2        48G    10G    35G  22% /
linveo# 
</code></pre>

<div>  <p>Installing <code>pkgsrc</code> added 1 G to the usage:</p>

<pre><code>linveo$ CVS_RSH=ssh cvs -danoncvs@anoncvs.NetBSD.org:/cvsroot checkout -P pkgsrc
  [ . . . ]
linveo$ df -h .
Filesystem     Size   Used  Avail %Cap Mounted on
/dev/dk2        48G    11G    35G  24% /
linveo$ 
</code></pre></div>

<ul>
<li>Issue</li>
</ul>

<p>The biggest issue that I know about with respect to the NetBSD-current upgrade proposed here relates to the <code>etcupdate</code> command, which is the last command in the sequence below.</p>

<p><code>etcupdate</code> is an <code>sh</code> shell script. There also is a man page, which mentions that the idea for <code>etcupdate</code> came from FreeBSD's <code>mergemster</code>.</p>

<p>I need to figure out how to set options making <code>etcupdate</code> faster and easier to run within the limited scope of this single CPU architecture NetBSD-current upgrade. The VPS is not attempting to build the full multi-architecture NetBSD panopoly. Perhaps limiting the <code>etcupdate</code> source directory to my VM's amd64 architecture might help. Perhaps -- as recommended in the man page -- running <code>etcupdate</code> on a <code>tar</code> file instead of directly on the sources also might help.</p>

<ul>
<li>NetBSD 10 Image</li>
</ul>

<p>Here are links to <a href="https://lowendspirit.com/index.php?p=/profile/cmeerw" rel="nofollow">@cmeerw</a>'s NetBSD 10 image and to a discussion of how the image was made:</p>

<p><a href="https://lowendspirit.com/discussion/comment/187386/#Comment_187386" rel="nofollow">https://lowendspirit.com/discussion/comment/187386/#Comment_187386</a><br />
<a href="https://lowendspirit.com/discussion/comment/187452/#Comment_187452" rel="nofollow">https://lowendspirit.com/discussion/comment/187452/#Comment_187452</a></p>

<ul>
<li>NetBSD Guide Reference Links</li>
</ul>

<p>Here are reference links to the very helpful NetBSD Guide:</p>

<p><a href="https://www.netbsd.org/docs/guide/en/chap-fetch.html#chap-fetch-cvs-netbsd-release" rel="nofollow">https://www.netbsd.org/docs/guide/en/chap-fetch.html#chap-fetch-cvs-netbsd-release</a><br />
<a href="https://www.netbsd.org/docs/guide/en/chap-updating.html" rel="nofollow">https://www.netbsd.org/docs/guide/en/chap-updating.html</a></p>

<ul>
<li>Adding Compilers To The NetBSD 10 Image</li>
</ul>

<p>Here is the LES comment where <a href="https://lowendspirit.com/index.php?p=/profile/cmeerw" rel="nofollow">@cmeerw</a> showed us the one line command used below to add NetBSD 10 compilers to the NetBSD 10 base image:</p>

<p><a href="https://lowendspirit.com/discussion/comment/186774/#Comment_186774" rel="nofollow">https://lowendspirit.com/discussion/comment/186774/#Comment_186774</a></p>

<ul>
<li>Recipe</li>
</ul>

<p>Here are the steps I followed to convert a clean, new Linveo VPS install of <a href="https://lowendspirit.com/index.php?p=/profile/cmeerw" rel="nofollow">@cmeerw</a>'s NetBSD 10 image to what seems to be self-compiled NetBSD-current:</p>

<ul>
<li>Run as root to install a compiler, create needed directories, and an unprivileged user</li>
</ul>

<pre><code>ftp -o - https://cdn.netbsd.org/pub/NetBSD/NetBSD-10.0/amd64/binary/sets/comp.tar.xz | progress -z tar xpf - -C /
cd /usr
mkdir obj src tools
mkdir /home
useradd -m -G wheel tom
passwd tom
chown tom obj src tools
su tom 
</code></pre>

<ul>
<li>Run as the unprivileged user which owns the <code>obj</code>, <code>src</code>, and <code>tools</code> subdirectories</li>
</ul>

<pre><code>export CVSROOT="anoncvs@anoncvs.NetBSD.org:/cvsroot"
export CVS_RSH="ssh"
cvs checkout -A -P src
cd src
less UPDATING
./build.sh -j 2 -O ../obj -T ../tools -U distribution
./build.sh -j 2 -O ../obj -T ../tools -U kernel=GENERIC
</code></pre>

<ul>
<li>Back to root to install and reboot to use our newly compiled NetBSD-current kernel</li>
</ul>

<pre><code>mv /netbsd /netbsd.old
mv /usr/obj/sys/arch/amd64/compile/GENERIC/netbsd /
shutdown -r now
</code></pre>

<ul>
<li>As root, install and reboot to run the newly compiled NetBSD-current userland</li>
</ul>

<pre><code>cd /usr/src
./build.sh -j 2 -O ../obj -T ../tools -U install=/
shutdown -r now
</code></pre>

<ul>
<li>As root, <code>postinstall</code></li>
</ul>

<pre><code>/usr/sbin/postinstall -s /usr/src check
/usr/sbin/postinstall -s /usr/src fix
</code></pre>

<ul>
<li>As root, <code>etcupdate</code></li>
</ul>

<pre><code>/usr/sbin/etcupdate -s /usr/src
</code></pre>

<p>Please point out any mistakes.</p>

<p>Any questions, please ask.</p>

<p>Thanks <a href="https://lowendspirit.com/index.php?p=/profile/linveo" rel="nofollow">@linveo</a> for the nice VPS! Thanks <a href="https://lowendspirit.com/index.php?p=/profile/cmeerw" rel="nofollow">@cmeerw</a> for the NetBSD 10 Minimum image! Thanks to the <a rel="nofollow" href="https://NetBSD.org">NetBSD project!</a> And thanks to LES!</p>
]]>
        </description>
    </item>
    <item>
        <title>How-to virtualize opnsense on proxmox</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/6682/how-to-virtualize-opnsense-on-proxmox</link>
        <pubDate>Sat, 28 Oct 2023 19:22:43 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>havoc</dc:creator>
        <guid isPermaLink="false">6682@/index.php?p=/discussions</guid>
        <description><![CDATA[<p>Busy re-doing my firewall setup &amp; taking notes. Thought I'd turn that into a mini-tutorial, noting that pieces may be a little <a rel="nofollow" href="https://www.reddit.com/r/funny/comments/eccj2/how_to_draw_an_owl/">rest of the fkin owl</a>. If you spot a gap...ask and I'll fill it in.</p>

<p><strong>Why</strong></p>

<p>The gear I've got for firewall is stupidly overkill (optane drive &amp; 16GB RAM) for something that is 99% idle so I want to stick a couple other things on the same hardware via proxmox.</p>

<p><strong>Assumed knowledge and requirements</strong></p>

<p>Proxmox, linux cli, basic networking, (very basic) firewall knowledge. Nothing here is super hardcore technically as such...just unforgiving in sequence &amp; details if unfamiliar hence notes. i.e. when it doesn't work it's not obvious where you fkd up.</p>

<p>Bring backups &amp; loads of time. Frankly...assume that you'll fu.ck this up if you haven't done this before. So this is a Saturday morning project not a Sunday night one.</p>

<p>Before you start set up a ventoy USB stick adding both proxmox and opnsense ISO on there (plus perhaps a PDF copy of this post). You may not have internet access while doing this so come prepared...</p>

<p>I'm using my own IP ranges etc in post - adjust as needed. Key pieces you need to know to follow my descriptions:</p>

<p>vmbr0 is LAN side<br />
vmbr1 is WAN (internet) side. (Proxmox sticks VMs on 0 by default so you want LAN side being 0)<br />
10.32.0.1 is the opnsense VM [LAN side], 10.31.0.5 is WAN side but that doesn't really matter key part is <em>31</em> makes it separate from our main <em>32</em> LAN<br />
10.32.0.2 is the LAN side IP of proxmox<br />
My device has 5 ports with enp2s0 being internet facing [aka vmbr1], rest of the NICs are bridge to vmbr0<br />
The key networking file on proxmox is at /etc/network/interfaces</p>

<p>Assumes upstream ISP is Eth based and just DHCPs whatever is connected. If you've got something else on ISP side you're on your own (sorry)</p>

<p><strong>Virtualized FW</strong></p>

<p>There are two basic ways to do this. Either pass through the NICs to the FW VM, or do two sets of bridges with one being WAN (internet) side and one LAN side. Passthrough is tricky to get working on a basic linux/bios/hardware level but solves some security issues. I'm doing the bridge approach because my gear (oddly) doesn't seem to support pass through. This guide is bridge only...so abandon ship now if you're going passthrough.</p>

<p>Bridge has one significant security implication. Proxmox gets the external traffic and bridges it to the firewall VM. Grand. Except Proxmox is fond of serving the proxmox management interface on ALL interfaces. So it's serving the damn management GUI before anything gets to our FW. Meaning it is potentially exposed BEFORE our fancy opnsense security gets to it. That's a problem we're trying to get around with below section on messing with the Proxmox firewall...despite setting up a opnsense firewall. [In reality the WAN side has a pvt non-routable IP so should be fine even without rules but I don't 100% trust that]</p>

<p>Keep this in mind when doing say incoming wireguard...you're effectively double-firewalled...and would need to pass through wireguard on both.</p>

<p><strong>Security</strong></p>

<p>The bulk of this guide happens BEFORE anything is connected to the internet, mostly because above "I don't trust this" issue. Just the FW device and a laptop directly connected to it.</p>

<p><strong>GO</strong></p>

<p><strong>Step 1</strong>: Install proxmox &amp; ensure you can access the GUI</p>

<p>On the network section do:<br />
IP 10.32.0.2<br />
Gateway 10.32.0.1<br />
Set DNS to 1.1.1.1<br />
Select a NIC that is LAN side (enp7s0 for me) - this should be whatever your laptop is plug in to</p>

<p>The proxmox interface is on <a href="https://10.32.0.2:8006" rel="nofollow">https://10.32.0.2:8006</a></p>

<p><strong>Step 2</strong>: Set up a second bridge in /etc/network/interfaces with WAN</p>

<pre><code>auto vmbr1
iface vmbr1 inet static
        address 10.31.0.5/24
        bridge-ports enp2s0
        bridge-stp off
        bridge-fd 0

iface enp2s0 inet manual
</code></pre>

<p>Note how it is set to a static unroutable IP despite us aiming for DHCP upstream ISP side. That's because we want the firewall VM to grab the DHCP from ISP, not the proxmox level interface.</p>

<p>Restart to make the 2nd bridge show in GUI.</p>

<p><strong>Step 3</strong>: Set up a opnsense VM</p>

<p>Copy over ISO off USB stick like so:</p>

<pre><code>mkdir /media/usbstick
fdisk -l  [[[to get the /dev/ location for the stick]]]
mount /dev/sda1 /media/usbstick
cp /media/usbstick/OPNSense.sio /var/lib/vz/template/iso/
</code></pre>

<p>If the iso is in that location then proxmox GUI should pick it up.</p>

<p>Set up a VM that has 12GB, 5120mb RAM and 3 cores. Going lower on space &amp; ram works but has consequences downstream on how zfs plays out so if you can do 12 &amp; 5 or more.</p>

<p>Before starting VM add the second bridge (vmbr1). Ideally add the LAN side during VM creation so that the naming 0 &amp; 1 line up consistently. Memorize the MACs on both (sorta...just which is which).</p>

<p><strong>Step 4</strong>: Install opnsense</p>

<p>Where it asks you for a login, use installer as user and opnsense as password</p>

<p>Key point here is you need to line up what opnsense thinks is LAN side and WAN side...with the right MAC per above...which in turn maps to the right bridge...which in turn maps to a physical port.</p>

<p>Finish install, change root pass &amp; unmount the ISO. Reboot.</p>

<p><strong>Step 5</strong>: Initial config of opnsense</p>

<p>Log into console of opnsense (the proxmox built in one). Option 2 - set interface IP. Configure LAN side. This part is a little confusing. We DONT want it to use DHCP as in where it gets it's IP, but we want it to SERVE DHCP...so that other LAN devices can get an IP from it. So in this menu the first time it asks you about DHCP the answer is no, the second time the answer is yes. Set IP to 10.32.0.1 and 24 as subnet bit count. Enable DHCP server. Start clients at 10.32.0.51 and end at 10.32.0.254. That way we've got ~50 IPs for statics. Change GUI to http. Reset to defaults - yes.</p>

<p>...now try to access GUI on <a href="http://10.32.0.1" rel="nofollow">http://10.32.0.1</a></p>

<p>On the GUI you should have an initial setup. Set hostname, domain, and DNS. Go with a public one for now e.g. 1.1.1.1 Leave the WAN side as DHCP - no need to change anything here.</p>

<p><strong>Step 6</strong>: Firewall</p>

<p>Go back to proxmox &amp; navigate to datacenter on left then to firewall. This stuff cascades so the rules you set on datacenter level apply to the device and to VMs below.</p>

<p>The firewall rules use first match principle, starting with zero i.e. top of list. So in general we want a pattern like so</p>

<p>[0] - Allow SSH on LAN side<br />
[1] - Disallow SSH on everything</p>

<p>So lan side incoming SSH hits rule 0 matches that and gets approved, while everything else fails rule 0 then goes to rule 1 and gets dropped.</p>

<pre><code>Direction: In
Action: Accept
Interface: vmbr0 [[[[this is LAN side]]]]
Protocol: TCP
Dest Port: 8006
Enable: Tick

Direction: In
Action: Drop
Interface: [[[[leave empty]]]]
Protocol: TCP
Dest Port: 8006
Enable: Tick
</code></pre>

<p>Do same for 22 TCP and ICMP (protocol, no port). I'd suggest messing with ICMP to experiment and get a better grasp of what blocks when.</p>

<p>Triple check that you've got this right. Next step is enable firewall...and if you fkd this (8006 specifically) up then you're locked out and will need a physically screen &amp; keyboard to sort it out.</p>

<p>You should also block these ports on vmbr1 (internet/wan) for good measure:<br />
TCP 111, UDP 111, UDP 323, TCP 25, TCP 3128. No idea what they all do...but proxmox is listening on them &amp; I don't want them open internet facing. I used command  "lsof -i -P -n" to work out what ports are being listened to.</p>

<p><strong>Step 7</strong>:  Connect device to internet</p>

<p>If all went well then a device plugged into LAN side can now access the internet. First thing you want to do is head over to</p>

<p><a href="https://www.yougetsignal.com/tools/open-ports/" rel="nofollow">https://www.yougetsignal.com/tools/open-ports/</a></p>

<p>And confirm they can't see your port 8006</p>

<p><strong>Trouble shooting</strong></p>

<p>1) You'll need to set a static IP in the right range on your laptop when connecting directly to a device. So when you can't reach the interfaces (proxmox or opnsense) checking that you're on the right net is helpful. Also windows is really shtty on this so sometimes you need to disable and reenable the network adapter to make it pick up things right. Try that before assuming something else is broken. You may also need to restart the laptop entirely...windows tends to get confused easily when rapidly switching networks.</p>

<p>2) Very likely that you'll f up DNS somewhere along the way...so when trying to work out whether a path through the firewall works try to use IPs like 1.1.1.1 with ping rather than google.com.</p>

<p>3) If genuinely stuck do ping device by device. i.e. my laptop is connected to a proxmox device...can i ping that by IP. Yes, ok can I ping opnsense by IP. Yes, can I ping 1.1.1.1. Yes. Can I ping google.com.</p>

<p><strong>Devices</strong></p>

<p>You should point all devices at the opnsense instance for both gateway and DNS [10.32.0.1 for me]. Never point a device at the pihole IP directly...that would work yes but it'll get you into trouble later in unexpected &amp; hard to troubleshoot ways. You want the devices asking opnsense for DNS and opnsense in turn asking the pihole/adguardhome, and that asking 1.1.1.1 in turn. It's under Unbound in opnsense...section called Override...that's where the pihole goes. Also I suggest using Adguard home...it's superior to pihole.</p>

<p><strong>YAY &amp; Thoughts</strong></p>

<p>Once it all sorta works, export the config in opnsense and save a copy of the proxmox /etc/network/interfaces - opnsense has a really nice "one config backup file everything is in it" config thing going...use it.</p>

<p>If anyone finds holes in this post please do tell...I'm running this live so if I'm wrong about something I'd like to find out from you rather than an evil hacker</p>

<p>Full /etc/network/interfaces for completeness</p>

<pre><code>root@firewall:~# cat /etc/network/interfaces
auto lo
iface lo inet loopback

iface enp2s0 inet manual

iface enp3s0 inet manual
iface enp4s0 inet manual
iface enp5s0 inet manual
iface enp6s0 inet manual
iface enp7s0 inet manual

auto vmbr0
iface vmbr0 inet static
        address 10.32.0.2/24
        gateway 10.32.0.1
        bridge-ports enp7s0 enp6s0 enp5s0 enp4s0 enp3s0
        bridge-stp off
        bridge-fd 0

auto vmbr1
iface vmbr1 inet static
        address 10.31.0.5/24
        bridge-ports enp2s0
        bridge-stp off
        bridge-fd 0
</code></pre>

<p>And firewall view:</p>

<p><img src="https://i.imgur.com/NDmFLAc.png" alt="" title="" /></p>
]]>
        </description>
    </item>
    <item>
        <title>How To Install KVM VPSes From The Command Line Using `libvirt` and `virsh`</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/6778/how-to-install-kvm-vpses-from-the-command-line-using-libvirt-and-virsh</link>
        <pubDate>Sun, 19 Nov 2023 20:35:23 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>Not_Oles</dc:creator>
        <guid isPermaLink="false">6778@/index.php?p=/discussions</guid>
        <description><![CDATA[<h2>Notes From Following The Footsteps Of The 大唐 (Great Tang)</h2>

<h2>Introduction</h2>

<p>Back on May 19, 2023, the 大 (big, great) <a href="https://lowendspirit.com/index.php?p=/profile/tang_cn" rel="nofollow">@tang_cn</a> wrote an awesome LES tutorial called <a rel="nofollow" href="https://lowendspirit.com/discussion/5939/how-to-become-an-one-man-nat-vps-provider">How to Become an One-Man NAT VPS Provider?</a></p>

<p><a href="https://lowendspirit.com/index.php?p=/profile/tang_cn" rel="nofollow">@tang_cn</a>'s tutorial covers setting up NAT VPSes using the <a rel="nofollow" href="https://linux.die.net/man/1/virt-install#:~:text=virt%2Dinstall%20is%20a%20command,document%20to%20quickly%20get%20started.">virt-install</a> <a rel="nofollow" href="https://en.wikipedia.org/wiki/Command-line_interface">command line</a> utility from <a rel="nofollow" href="https://libvirt.org/">libvirt.</a></p>

<h2>Trying On A Debian 12.2 Node</h2>

<p>I decided to try following <a href="https://lowendspirit.com/index.php?p=/profile/tang_cn" rel="nofollow">@tang_cn</a>'s tutorial. The Node which <a href="https://lowendspirit.com/index.php?p=/profile/tang_cn" rel="nofollow">@tang_cn</a>'s tutorial had used was running Debian 11. I tried with a Debian 12.2 Node. On Debian 12.2, I ran into two issues:</p>

<ul>
<li><p><a href="https://lowendspirit.com/index.php?p=/profile/tang_cn" rel="nofollow">@tang_cn</a>'s example code did not include a possibly newly required line <code>--osinfo detect=on,name=OSNAME</code>. Adding the <code>osinfo detect=on,name=debian12</code> line resulted in a fatal error.  So, yes, Debian is great, but Debian 12.2's <code>virt-install</code> did not include "debian12" among the list of supported releases shown by <code>virt-install --osinfo list</code>! I bypassed the error with <code>--osinfo detect=on,require=off</code>, but I am unclear on what, if any problems turning off <code>osinfo require</code> might have caused.</p></li>
<li><p>After completing <a href="https://lowendspirit.com/index.php?p=/profile/tang_cn" rel="nofollow">@tang_cn</a>'s install steps, my Debian guest VM worked fine over remote VNC via ssh tunnel into the VM's console. The VM could ping and could be pinged from the WAN over IPv6, but not over IPv4. I didn't solve the NAT IPv4 networking issue, whatever it was.</p></li>
</ul>

<h2>Trying On A Fedora Rawhide Node</h2>

<p>I tried again on a Node runniing Fedora Rawhide. I did find that the more current but much less tested code in Rawhide enabled <code>virt-install</code> to support Debian 12 VMs.</p>

<ul>
<li><strong>The Rawhide Node</strong></li>
</ul>

<p>The Rawhide Node is an Intel E-2276G rented from the <a rel="nofollow" href="https://hetzner.com/sb">Hetzner server auction</a> for €33.70 monthly. This price is at least a couple of Euros above the minimum auction price for this server. Nevertheless, this server is worth keeping long term since it has two new NVMe disks. Not all auction servers have new disks.</p>

<p><img src="https://lowendspirit.com/uploads/editor/0j/nc3wmu0q8qbw.png" alt="" title="" /></p>

<ul>
<li><strong>References</strong></li>
</ul>

<p>Fedora has an introductory <a rel="nofollow" href="https://docs.fedoraproject.org/en-US/quick-docs/virtualization-getting-started/">Virtualization – Getting Started</a> tutorial. The Fedora tutorial links to <code>libvirt's</code> wiki article on <a rel="nofollow" href="https://wiki.libvirt.org/Networking.html">common <code>libvirt</code> networking configurations.</a></p>

<p>Let's start by following the command line versions of the steps in the Fedora tutorial.</p>

<ul>
<li><strong>Step 1: System Requirements</strong></li>
</ul>

<p>Virtualization requires certain minimum RAM amounts and also CPU virtualization extensions, either Intel VT or AMD-V. The minimum RAM amounts are satisfied here since the Node has 64 GB DDR4 ECC RAM. The CPU passes the wiki article's <code>egrep '^flags.*(vmx|svm)' /proc/cpuinfo</code> check.</p>

<ul>
<li><strong>Step 2: Install Virtualization Software</strong></li>
</ul>

<p>The Fedora <code>dnf</code> package manager's virtualization group on our Rawhide server still seems the same as that shown in the Fedora wiki.</p>

<pre><code>[root@polonium ~]# dnf groupinfo virtualization
Last metadata expiration check: 3:24:19 ago on Sun 19 Nov 2023 03:19:10 PM UTC.
Group: Virtualization
 Description: These packages provide a graphical virtualization environment.
 Mandatory Packages:
   virt-install
 Default Packages:
   libvirt-daemon-config-network
   libvirt-daemon-kvm
   qemu-kvm
   virt-manager
   virt-viewer
 Optional Packages:
   guestfs-tools
   python3-libguestfs
   virt-top
[root@polonium ~]# 
</code></pre>

<p>Let's try installing with the optional packages.</p>

<pre><code>dnf group install --with-optional virtualization
</code></pre>

<p>Whew! That was 481 packages, but the install took only about one minute. The entire 2,130 lines of terminal output was saved, so, if you want to see it, please ask.</p>

<p>Let's use <code>systemctl</code> to start and then to enable the <code>libvirt</code> daemon. Enabling the daemon makes it restart automatically when the Node reboots.</p>

<pre><code>[root@polonium ~]# date -u; systemctl start libvirtd
Sun Nov 19 10:49:12 PM UTC 2023
[root@polonium ~]# date -u; systemctl enable libvirtd
Sun Nov 19 10:49:30 PM UTC 2023
Created symlink /etc/systemd/system/multi-user.target.wants/libvirtd.service → /usr/lib/systemd/system/libvirtd.service.
Created symlink /etc/systemd/system/sockets.target.wants/libvirtd.socket → /usr/lib/systemd/system/libvirtd.socket.
Created symlink /etc/systemd/system/sockets.target.wants/libvirtd-ro.socket → /usr/lib/systemd/system/libvirtd-ro.socket.
Created symlink /etc/systemd/system/sockets.target.wants/libvirtd-admin.socket → /usr/lib/systemd/system/libvirtd-admin.socket.
[root@polonium ~]# 
</code></pre>

<p>Verify that KVM is properly loaded.</p>

<pre><code>[root@polonium ~]# lsmod | grep kvm
kvm_intel             425984  0
kvm                  1376256  1 kvm_intel
irqbypass              12288  1 kvm
[root@polonium ~]# 
</code></pre>

<ul>
<li><strong>Step 3: Default Networking Support</strong></li>
</ul>

<p>The Fedora tutorial tells us to expect a 192.168.x.x subnet to be set up by default on the Node. The VM guests should be able to connect out to the WAN by using the Node's main IPv4 as a gateway. Connections from the WAN into the guests require firewall DNAT rules on the Node or a bridged environment.</p>

<p>Let's use the iproute2 suite to see what happened to the default network when we installed the <code>dnf</code> virtualization group.</p>

<pre><code>[root@polonium ~]# ip link show
  [ . . . ]
3: virbr0: &lt;NO-CARRIER,BROADCAST,MULTICAST,UP&gt; mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
[root@polonium ~]# 
</code></pre>

<p>It's apparent that installing the virtualization group added a bridge called <code>virbr0</code>. The bridge is down now, but will be put up when we install and start a VM.</p>

<ul>
<li><strong>Step 4: Create A Guest With <code>virt-install</code></strong></li>
</ul>

<p>Let's install a Debian guest VM. Even though we are following a Fedora tutorial. 🙈🙉🙊</p>

<p>First we get the guest's iso image, SHA512 sum, and signature. The Fedora tutorial put the iso images in <code>/var/lib/libvirt/images/</code>. I began by creating the <code>images</code> directory and then a separate <code>iso</code> directory inside <code>/var/lib/libvirt/images</code>. Libvirt seems flexible about the iso location. Because I use the iso images for additional purposes beyond <code>libvirt</code>, if I were doing this again, I might create the <code>iso</code> directory in <code>/var/lib</code>, independent of and on the same level as the <code>libvirt</code> directory.</p>

<p>Reference: <a href="https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/" rel="nofollow">https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/</a></p>

<pre><code>cd /var/lib/libvirt/images/iso
wget https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-12.2.0-amd64-netinst.iso
wget https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/SHA512SUMS
wget https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/SHA512SUMS.sign
</code></pre>

<p>Next, let's check the SHA512 sum and the signature.</p>

<p>Reference: <a href="https://www.debian.org/CD/verify" rel="nofollow">https://www.debian.org/CD/verify</a></p>

<pre><code>sha512sum -c SHA512SUMS --ignore-missing
gpg --keyserver keyring.debian.org --recv DF9B9C49EAA9298432589D76DA87E80D6294BE9B
gpg --verify SHA512SUMS.sign SHA512SUMS
</code></pre>

<p>Now we get to use <code>virt-install</code> to create our Debian 12 guest. Here is the install command directly from the Fedora tutorial.</p>

<pre><code>virt-install --name Fedora39 \
--description 'Fedora 39 Workstation' \
--ram 4096 \
--vcpus 2 \
--disk path=/var/lib/libvirt/images/Fedora-Workstation-39/Fedora-Workstation-39-20180518.0.x86_64.qcow2,size=20 \
--os-type linux \
--os-variant fedora39 \
--network bridge=virbr0 \
--graphics vnc,listen=127.0.0.1,port=5901 \
--cdrom /var/lib/libvirt/images/Fedora-Workstation-39/Fedora-Workstation-Live-x86-64-39-1.1.iso \
--noautoconsole
</code></pre>

<p>Here is the <code>virt-install</code> command which was used for this test. Note that <code>--os-type</code> has been deprecated, and that the version of <code>virt-install</code>, still numbered 4.1.0 in Rawhide, supports Debian 12.</p>

<pre><code>[root@polonium ~]# cat -n /root/Install-Debian-KVM-Guest.sh
     1  virt-install --name Debian-12-Guest-1 \
     2  --description 'Debian 12 from netinst.iso' \
     3  --ram 4096 \
     4  --vcpus 2 \
     5  --disk path=/var/lib/libvirt/images/Debian-12-20231119.1.x86_64.qcow2,size=20 \
     6  --os-variant debian12 \
     7  --network bridge=virbr0 \
     8  --graphics vnc,listen=127.0.0.1,port=5901 \
     9  --cdrom /var/lib/libvirt/images/iso/debian-12.2.0-amd64-netinst.iso \
    10  --noautoconsole
[root@polonium ~]# /root/Install-Debian-KVM-Guest.sh

Starting install...
Allocating 'Debian-12-20231119.1.x86_64.qcow2'                    |    0 B  00:00:00 ... 
Creating domain...                                                |    0 B  00:00:00     

Domain is still running. Installation may be in progress.
You can reconnect to the console to complete the installation process.
[root@polonium ~]# 
</code></pre>

<p><code>virt-install</code> leaves us with a guest which is running. The guest has a disk image qcow2 file and also is connected to the net-install iso. <code>virt-install</code> boots the guest from the iso. Thus, at this point, we have installed the guest on the Node, but we still need to install the guest OS inside the guest's disk image.</p>

<ul>
<li><strong>Step 5: Install The Guest OS Inside The Guest</strong></li>
</ul>

<p><img src="https://lowendspirit.com/uploads/editor/bh/pg8ioavipe6j.png" alt="" title="" /></p>

<p>We connect to and install the guest in the usual way appropriate to the distribution that the guest is using. Inside the guest, the guest's IPv4 network is automatically configured by DHCP using the subnet IP assigned to the guest and using the IP of the Node as the gateway.</p>

<p>To connect to the guest from our local address, we set up an ssh tunnel from our local machine to the Node.</p>

<pre><code>ssh root@$NODE_IP -L 5901:localhost:5901 
</code></pre>

<p>Then we connect via VNC. In our local VNC client, we enter the localhost IP address followed by the port number which was used in the <code>virt-install</code> <code>--graphics vnc,listen=127.0.0.1,port=5901 \</code> flag. So, here, we would connect to <code>127.0.0.1:5901</code>.</p>

<p>When we are finished installing the guest OS on the guest qcow2 image, we normally remove the iso and click reboot in the installer so that the guest reboots from the qcow2 image rather than from the netinst iso. However, here, with <code>libvirt</code>, the guest shuts down and does not reboot. Instead, we now need to start the guest with <code>virsh</code>.</p>

<ul>
<li><strong>Step 6: Manage The Guest With <code>virsh</code></strong></li>
</ul>

<p><code>virt-install</code> leaves an XML file for each guest in /etc/libvirt/qemu.</p>

<p>To start a virtual machine, use <code>virsh create</code> with the full filename of the guest's XML file.</p>

<pre><code>[root@polonium ~]# cd /etc/libvirt/qemu
[root@polonium qemu]# ls -l
total 16
drwx------. 2 root root 4096 Nov  6 00:00 autostart
-rw-------. 1 root root 7235 Nov 20 03:58 Debian-12-Guest-1.xml
drwx------. 3 root root 4096 Nov 19 22:49 networks
[root@polonium qemu]# virsh create Debian-12-Guest-1.xml
Domain 'Debian-12-Guest-1' created from Debian-12-Guest-1.xml

[root@polonium qemu]# virsh list
 Id   Name                State
-----------------------------------
 1    Debian-12-Guest-1   running

[root@polonium qemu]# 
</code></pre>

<p>To gracefully stop a guest:</p>

<pre><code># virsh shutdown &lt;virtual machine (name | id | uuid)&gt;
</code></pre>

<p>To destroy a guest which already has been stopped. The guest's qcow2 image needs to be removed manually.</p>

<pre><code># virsh undefine &lt;virtual machine (name | id | uuid)&gt;
</code></pre>

<h2>Success!</h2>

<p>Logging into the fully installed and rebooted guest via VNC showed IPv4 WAN connectivity from inside the guest.</p>

<p><img src="https://lowendspirit.com/uploads/editor/iq/6csx1u3mt6qs.png" alt="" title="" /></p>

<p>Also, we can use <code>ssh</code> to log in to the guest from the Node.</p>

<pre><code>[root@polonium ~]# ssh tom@192.168.xxx.xxx
The authenticity of host '192.168.xxx.xxx (192.168.xxx.xxx)' can't be established.
ED25519 key fingerprint is SHA256:0NfbDJkPk5Lt+dsFOlt/tWOq2+Edf/UPn136Yis9Kvo.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.xxx.xxx' (ED25519) to the list of known hosts.
tom@192.168.xxx.xxx's password: 
Linux debian 6.1.0-13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sun Nov 19 22:44:07 2023
tom@debian:~$ 
</code></pre>

<h2>Note: QEMU/KVM Without <code>libvirt</code></h2>

<p>We could have used qemu without libvirt. But that might not be so easy. <img src="https://lowendspirit.com/plugins/emojiextender/emoji/twitter/smile.png" title=":)" alt=":)" height="18" /> Let's see the <code>qemu</code> command that <code>libvirt</code> used.</p>

<pre><code>[root@polonium ~]# ps aux | grep libvirt | grep -v grep
  [ . . . ]
qemu       25641  0.9  0.9 5580140 646992 ?      Sl   04:45   0:27 /usr/bin/qemu-system-x86_64 -name guest=Debian-12-Guest-1,debug-threads=on -S -object {"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain-1-Debian-12-Guest-1/master-key.aes"} -machine pc-q35-8.1,usb=off,dump-guest-core=off,memory-backend=pc.ram,hpet=off,acpi=on -accel kvm -cpu host,migratable=on -m size=4194304k -object {"qom-type":"memory-backend-ram","id":"pc.ram","size":4294967296} -overcommit mem-lock=off -smp 2,sockets=2,cores=1,threads=1 -uuid 2d88e4ec-782f-4da6-961e-0266d08f845a -no-user-config -nodefaults -chardev socket,id=charmonitor,fd=32,server=on,wait=off -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc,driftfix=slew -global kvm-pit.lost_tick_policy=delay -no-shutdown -global ICH9-LPC.disable_s3=1 -global ICH9-LPC.disable_s4=1 -boot strict=on -device {"driver":"pcie-root-port","port":16,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x2"} -device {"driver":"pcie-root-port","port":17,"chassis":2,"id":"pci.2","bus":"pcie.0","addr":"0x2.0x1"} -device {"driver":"pcie-root-port","port":18,"chassis":3,"id":"pci.3","bus":"pcie.0","addr":"0x2.0x2"} -device {"driver":"pcie-root-port","port":19,"chassis":4,"id":"pci.4","bus":"pcie.0","addr":"0x2.0x3"} -device {"driver":"pcie-root-port","port":20,"chassis":5,"id":"pci.5","bus":"pcie.0","addr":"0x2.0x4"} -device {"driver":"pcie-root-port","port":21,"chassis":6,"id":"pci.6","bus":"pcie.0","addr":"0x2.0x5"} -device {"driver":"pcie-root-port","port":22,"chassis":7,"id":"pci.7","bus":"pcie.0","addr":"0x2.0x6"} -device {"driver":"pcie-root-port","port":23,"chassis":8,"id":"pci.8","bus":"pcie.0","addr":"0x2.0x7"} -device {"driver":"pcie-root-port","port":24,"chassis":9,"id":"pci.9","bus":"pcie.0","multifunction":true,"addr":"0x3"} -device {"driver":"pcie-root-port","port":25,"chassis":10,"id":"pci.10","bus":"pcie.0","addr":"0x3.0x1"} -device {"driver":"pcie-root-port","port":26,"chassis":11,"id":"pci.11","bus":"pcie.0","addr":"0x3.0x2"} -device {"driver":"pcie-root-port","port":27,"chassis":12,"id":"pci.12","bus":"pcie.0","addr":"0x3.0x3"} -device {"driver":"pcie-root-port","port":28,"chassis":13,"id":"pci.13","bus":"pcie.0","addr":"0x3.0x4"} -device {"driver":"pcie-root-port","port":29,"chassis":14,"id":"pci.14","bus":"pcie.0","addr":"0x3.0x5"} -device {"driver":"qemu-xhci","p2":15,"p3":15,"id":"usb","bus":"pci.2","addr":"0x0"} -device {"driver":"virtio-serial-pci","id":"virtio-serial0","bus":"pci.3","addr":"0x0"} -blockdev {"driver":"file","filename":"/var/lib/libvirt/images/Debian-12-20231119.1.x86_64.qcow2","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"} -blockdev {"node-name":"libvirt-2-format","read-only":false,"discard":"unmap","driver":"qcow2","file":"libvirt-2-storage","backing":null} -device {"driver":"virtio-blk-pci","bus":"pci.4","addr":"0x0","drive":"libvirt-2-format","id":"virtio-disk0","bootindex":1} -device {"driver":"ide-cd","bus":"ide.0","id":"sata0-0-0"} -netdev {"type":"tap","fd":"34","vhost":true,"vhostfd":"36","id":"hostnet0"} -device {"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:ec:db:35","bus":"pci.1","addr":"0x0"} -chardev pty,id=charserial0 -device {"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0} -chardev socket,id=charchannel0,fd=31,server=on,wait=off -device {"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"} -device {"driver":"usb-tablet","id":"input0","bus":"usb.0","port":"1"} -audiodev {"id":"audio1","driver":"none"} -vnc 127.0.0.1:1,audiodev=audio1 -device {"driver":"virtio-vga","id":"video0","max_outputs":1,"bus":"pcie.0","addr":"0x1"} -global ICH9-LPC.noreboot=off -watchdog-action reset -device {"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.5","addr":"0x0"} -object {"qom-type":"rng-random","id":"objrng0","filename":"/dev/urandom"} -device {"driver":"virtio-rng-pci","rng":"objrng0","id":"rng0","bus":"pci.6","addr":"0x0"} -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny -msg timestamp=on
[root@polonium ~]# 
</code></pre>

<h2>Note: Command Summary</h2>

<p>For cut and paste fiends, here's a list of all the commands run in this post.</p>

<pre><code># egrep '^flags.*(vmx|svm)' /proc/cpuinfo
dnf group install --with-optional virtualization
systemctl start libvirtd
systemctl enable libvirtd
# lsmod | grep kvm
# ip link show
wget https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-12.2.0-amd64-netinst.iso
wget https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/SHA512SUMS
wget https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/SHA512SUMS.sign
sha512sum -c SHA512SUMS --ignore-missing
gpg --keyserver keyring.debian.org --recv DF9B9C49EAA9298432589D76DA87E80D6294BE9B
gpg --verify SHA512SUMS.sign SHA512SUMS

virt-install --name Debian-12-Guest-1 \
--description 'Debian 12 from netinst.iso' \
--ram 4096 \
--vcpus 2 \
--disk path=/var/lib/libvirt/images/Debian-12-20231119.1.x86_64.qcow2,size=20 \
--os-variant debian12 \
--network bridge=virbr0 \
--graphics vnc,listen=127.0.0.1,port=5901 \
--cdrom /var/lib/libvirt/images/iso/debian-12.2.0-amd64-netinst.iso \
--noautoconsole

virsh create Debian-12-Guest-1.xml
# virsh shutdown &lt;virtual machine (name | id | uuid)&gt;
#ps aux | grep qemu | grep -v grep
</code></pre>

<h2>Future Steps</h2>

<ul>
<li>Set up IPv4 NAT and IPv6/48 on the Node.</li>
<li>Add IPv6/64 inside the guest.</li>
<li>Set up <a rel="nofollow" href="https://spice-space.org">Spice.</a></li>
<li>Try other Linux and BSD guests.</li>
</ul>
]]>
        </description>
    </item>
    <item>
        <title>Adventures Installing Python And Django Directly From Source Code!</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/6487/adventures-installing-python-and-django-directly-from-source-code</link>
        <pubDate>Mon, 18 Sep 2023 03:35:27 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>Not_Oles</dc:creator>
        <guid isPermaLink="false">6487@/index.php?p=/discussions</guid>
        <description><![CDATA[<p><img src="https://lowendspirit.com/uploads/editor/bn/45dt1qefw96t.png" alt="" title="" /></p>

<h2><strong>Introduction</strong></h2>

<p>This article presents background information plus a quick and easy to follow recipe for installing, directly from <a rel="nofollow" href="https://github.com">Github</a> source code repositories, the <a rel="nofollow" href="https://www.python.org">Python programming language</a> and the <a rel="nofollow" href="https://www.djangoproject.com/">Django web framework.</a> The operating system used here is <a rel="nofollow" href="https://docs.fedoraproject.org/en-US/releases/rawhide/">Fedora Rawhide.</a>  Also included is a note about using the install steps presented here on <a rel="nofollow" href="https://www.debian.org/News/2023/20230610">Debian 12</a>.</p>

<p>As shown by the above screenshot, the quick, easy to follow, source-based Django install recipe given here actually works on Fedora Rawhide. Of course, the "without optimization" approach taken here is not intended for production. Instead, what we have here is a very fun introduction to building Python and Django from source code.</p>

<h2><strong>What Is Django?</strong></h2>

<p><a rel="nofollow" href="https://www.djangoproject.com/">Django</a> is a <a rel="nofollow" href="https://en.wikipedia.org/wiki/Web_framework">web framework</a> written in <a rel="nofollow" href="https://www.python.org/">Python.</a> The <a rel="nofollow" href="https://www.djangoproject.com/">Django Project's landing page</a> describes Django as "a high-level Python web framework that encourages rapid development and clean, pragmatic design."</p>

<h2><strong>Why Is Django Interesting?</strong></h2>

<p>A while back, I watched one of the <a rel="nofollow" href="https://www.youtube.com/watch?v=w8q0C-C1js4">CS50 lecture videos about Django.</a> The <a rel="nofollow" href="https://pll.harvard.edu/course/cs50-introduction-computer-science">CS50</a> video shows how simple and fast the Django web development process looks and how much Django must do in the background (for example, handling both database and web server functions). Web development using Django code seems cool -- very few lines of Django code are required to make <a rel="nofollow" href="https://en.wikipedia.org/wiki/Dynamic_web_page">dynamic web pages</a> work!</p>

<h2><strong>Django Install Methods</strong></h2>

<p>At first sight, especially for someone coming without a Python background, installing Django seems really complicated! The Django Project's <a rel="nofollow" href="https://docs.djangoproject.com/en/4.2/intro/install/">Quick install guide</a> describes:</p>

<ul>
<li>installing Python,</li>
<li>Optionally setting up a database,</li>
<li>Three Django install methods

<ul>
<li>from an official Django release (recommended),</li>
<li>from your operating system's distribution,</li>
<li>from the latest development code, and</li>
</ul></li>
<li>Verifying the install.</li>
</ul>

<p>The Quick install guide states that the first of the three install methods, installing from an official Django release, is "the best approach for most users."</p>

<p>However, for each of the three install methods, including for the recommended install method, the Django Quick install guide sends its readers to different sections of a significantly more detailed <a rel="nofollow" href="https://docs.djangoproject.com/en/4.2/topics/install/">How to install Django</a> page.</p>

<p>The more detailed How to install Django page explains that the recommended install from an official Django release involves both <a rel="nofollow" href="https://pypi.org/project/pip/"><code>pip</code>, the Package Installer for Python,</a> and <a rel="nofollow" href="https://docs.python.org/3/library/venv.html"><code>venv</code>, the Python Virtual Environment Module.</a></p>

<p>Of course, for a Django install, <a rel="nofollow" href="https://wiki.python.org/moin/BeginnersGuide/Download">Python</a> itself, along with <a rel="nofollow" href="https://pip.pypa.io/en/latest/installation/">pip</a> and <a rel="nofollow" href="https://docs.python.org/3/installing/index.html#installing-index">venv</a> might <a rel="nofollow" href="https://docs.djangoproject.com/en/4.2/topics/install/#installing-an-official-release-with-pip">need to be installed</a> if all three of these are not already present.</p>

<p>People use <a rel="nofollow" href="https://docs.djangoproject.com/en/4.2/topics/install/#get-your-database-running">Django with a database.</a> The database frequently is <a rel="nofollow" href="https://www.sqlite.org">SQLite</a> or <a rel="nofollow" href="https://www.postgresql.org/">PostgreSQL.</a> Precompiled SQLite is installed during the preliminary Fedora development tools install discussed below. Although there is an <a rel="nofollow" href="https://github.com/sqlite/sqlite">official Github SQLite source mirror,</a> SQLite uses <a rel="nofollow" href="https://fossil-scm.org">fossil</a> for source code management. Fossil seems so interesting and fun that it would make a great subject for another article. Thus, and even though PostgreSQL also is enticing, for the time being, on Fedora Rawhide, we can proceed with the distribution-installed SQLite.</p>

<p>Besides a database, Django also needs a web server. The official Django How to install tutorial <a rel="nofollow" href="https://docs.djangoproject.com/en/4.2/topics/install/#install-apache-and-mod-wsgi">recommends Apache web server with mod_wsgi.</a> The web server install also might be another great subject for yet another LES Talk article. Meanwhile, as shown below, we can use Django's built-in Python web server. It is the built-in Python web server which served the page of which the above screenshot was taken.</p>

<p>Reading the Django Quick install guide was super helpful for important context, and reading the more detailed Django How to install guide was even more helpful for learning additional install details. But, the crux is, even after reading both guides, no specific install recipe was provided. Instead, readers of these well meant and helpful guides are in the end left facing a complex puzzle about how to choose among various install methods and sub-methods. Ironically, each of the install methods very kindly is intended to make installing Django easy!</p>

<h2><strong>Simplifying The Django Install</strong></h2>

<p>Having tried all three of the install methods listed in the official Django Quick install guide, and having tried several variations mentioned in the more detailed, official Django How to install guide, I wondered whether the Django install somehow could be easier. I wanted a quick Django install recipe!</p>

<p>Many source repositories have easy to find, basic configuration and compilation instructions. For example, Python's simple, standard build instructions are <a rel="nofollow" href="https://github.com/python/cpython#build-instructions">here.</a> Often the simple, standard, "configure, make, make test, make install" series just works. Trying a source-based install seemed faster and easier, closer to upstream, and more fun than figuring out a specific install recipe based on one among the multiple, non-source-based install methods discussed in the official guides.</p>

<p>Source-based installs require a <a rel="nofollow" href="https://en.wikipedia.org/wiki/Compiler">compiler</a> and other development tools. In an ideal world, both the compiler and the development tools also themselves would be compiled from source by the end user. However, as shown here below, the Fedora distribution's package system can be used to quickly and easily install a compiler and other development tools.</p>

<p>Therefore, because of the simplicity of the standard build instructions and the ease of installing a compiler, I attempted, on Fedora Rawhide, a quick, source-based Django install. It seemed a good idea also to compile Python from C and to add <code>pip</code> and <code>venv</code> from their current development Python sources. That way, we get Django's friends built from their current sources to accompany our current, source-built Django. Of course, <a rel="nofollow" href="https://lowendspirit.com/discussion/6380/in-only-three-days-new-linux-kernel-source-commits-run-live-on-fedora-rawhide/p1">Fedora Rawhide runs on current Linux development kernels,</a> so Rawhide might be an especially fun and good fit for current, source-built userland programs.</p>

<p>Clone, compile, test, and install times mentioned below are from an Intel E3-1275 v5 with 64 GB DDR4 ECC RAM and 2 x 512 GB NVMe disks rented from <a rel="nofollow" href="https://hetzner.com">Hetzner</a> for €26.70 per month (approximately US$28.34). Newer and faster processors with faster memory and faster disks will have shorter times.</p>

<h2><strong>Quick Source-Based Django Install Recipe</strong></h2>

<h2><strong>Part I: Install Development Tools On Fedora Rawhide</strong></h2>

<pre><code>[not_oles@radium ~]$ sudo dnf groupinstall --with-optional "C Development Tools and Libraries"
[not_oles@radium ~]$ sudo dnf groupinstall --with-optional "Development Tools"
[not_oles@radium ~]$ sudo dnf groupinstall --with-optional "Development Libraries"
</code></pre>

<p>That's all, only these three commands. Probably they could be combined into a long, one line command, but I wanted to pause long enough between commands to read the individual output of each.</p>

<p>These three commands do not install Django, but they do install, respectively, 250, 585, and 186 development related software packages. That's 1,021 packages! Most of the newly installed packages are unneeded for our present purpose, but it was quick and easy to install everything. The entire one thousand plus package install took only about 8 minutes!</p>

<p>At least some Python must have been present in Fedora prior to the development tools install because <a rel="nofollow" href="https://docs.fedoraproject.org/en-US/quick-docs/dnf/"><code>dnf</code>, the Fedora install tool,</a> is itself Python based. Therefore, we need a trick to separate <code>dnf</code> installed programs from our own source-built programs. The <a rel="nofollow" href="https://en.wikipedia.org/wiki/PATH_(variable)">PATH environment variable</a> can help keep the <code>dnf</code> and source-built programs separated.</p>

<h2><strong>Part II: Check PATH And Enable Revert</strong></h2>

<ul>
<li><strong>PATH</strong></li>
</ul>

<p>We need to check that both our root and our user PATH environment variables are set for our shell to find our newly installed /usr/local/bin binaries ahead of previously installed package system binaries. Fedora's PATH was okay because <code>/usr/local/bin</code> comes ahead of <code>/usr/bin</code>. Our install won't put anything in <code>/usr/local/sbin</code>, but for additional local installs from source, it's good for <code>usr/local/sbin</code> to come ahead of <code>/usr/sbin</code>.</p>

<pre><code>[root@radium ~]# echo $PATH
/root/.local/bin:/root/bin:/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
[root@radium ~]# 
</code></pre>

<pre><code>[not_oles@radium ~]$ echo $PATH
/home/not_oles/.local/bin:/home/not_oles/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
[not_oles@radium ~]$
</code></pre>

<ul>
<li><strong>Revert</strong></li>
</ul>

<p>Let's set up the ability to revert. We're going to be installing into /usr/local. So, in case we want to revert, we can use <code>tar</code> to back up <code>/usr/local</code> as it is prior to our install.</p>

<p>If we have enough disk space, there's no need for compressing our tar archive. Compression can take significant extra time.</p>

<p><code>tar</code> is an old program! Old enough not to need the "-" before the flags!</p>

<pre><code>[not_oles@radium ~]$ cd /usr
[not_oles@radium usr]$ sudo tar cvf local-revert.tar local
</code></pre>

<h2><strong>Part III: Install Python From Source</strong></h2>

<pre><code>[not_oles@radium ~]$ cd /usr/local/src
[not_oles@radium src]$ time sudo git clone https://github.com/python/cpython.git
[not_oles@radium src]$ sudo mkdir cpython-obj
[not_oles@radium src]$ cd cpython-obj/
[not_oles@radium cpython-obj]$ time sudo ../cpython/configure --prefix="/usr/local" 
[not_oles@radium cpython-obj]$ time sudo make -j `nproc`
[not_oles@radium cpython-obj]$ time sudo make -j `nproc` test
[not_oles@radium cpython-obj]$ time sudo make -j `nproc` install
</code></pre>

<p>The above <code>configure</code>, <code>make</code>, <code>make test</code>, and <code>make install</code> procedure installs <code>pip</code>, as seen in the following snippet from the <code>make install</code> output.</p>

<pre><code>Successfully installed pip-23.2.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour 
with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
</code></pre>

<p>The newly compiled and installed items are:</p>

<pre><code>[not_oles@radium ~]$ ls -l /usr/local/bin
total 28408
lrwxrwxrwx. 1 root root        8 Oct 15 22:09 idle3 -&gt; idle3.13
-rwxr-xr-x. 1 root root      100 Oct 15 22:08 idle3.13
-rwxr-xr-x. 1 root root      230 Oct 15 17:40 pip3
-rwxr-xr-x. 1 root root      230 Oct 15 17:40 pip3.13
lrwxrwxrwx. 1 root root        9 Oct 15 22:09 pydoc3 -&gt; pydoc3.13
-rwxr-xr-x. 1 root root       85 Oct 15 22:08 pydoc3.13
lrwxrwxrwx. 1 root root       10 Oct 15 22:09 python3 -&gt; python3.13
-rwxr-xr-x. 1 root root 29065592 Oct 15 22:08 python3.13
-rwxr-xr-x. 1 root root     3026 Oct 15 22:08 python3.13-config
lrwxrwxrwx. 1 root root       17 Oct 15 22:09 python3-config -&gt; python3.13-config
[not_oles@radium ~]$ 
</code></pre>

<p>Note that the <code>pip</code> described in the warning as successfully installed was installed as <code>pip3</code> and as <code>pip3.13</code>, but not as plain <code>pip</code>. For Python itself, similar to <code>pip</code>, <code>pip3</code>, and <code>pip3.13</code>, the above <code>configure</code>, <code>make</code>, <code>make test</code>, and <code>make install</code> procedure installed <code>python3.13</code> and <code>python3</code> as a <a rel="nofollow" href="https://en.wikipedia.org/wiki/Symbolic_link">symbolic link</a> to <code>python3.13</code>, but not <code>python</code>. <code>sqlite3</code> also is not installed.</p>

<p>On Fedora Rawhide, the complete <code>clone</code>, <code>configure</code>, <code>make</code>, <code>make test</code>, and <code>make install</code> Python procedure took 9 minutes and 51 seconds.</p>

<h2><strong>Part IV: Install <code>nox</code> From Source</strong></h2>

<p><code>nox</code> is a requirement for installing <code>pip</code> from source. The <code>pip</code> development <a rel="nofollow" href="https://pip.pypa.io/en/latest/development/getting-started/">Getting Started page</a> says to install <code>nox</code> inside a virtual environment. However, the <a rel="nofollow" href="https://github.com/wntrblm/nox"><code>nox</code> Github readme.md</a> says, "Nox is designed to be installed globally (not in a project virtual environment)." On Fedora Rawhide, both types of installs seem initially to work. Here is the global <code>nox</code> install.</p>

<pre><code>[not_oles@radium ~]$ cd /usr/local/src
[not_oles@radium src]$ time sudo git clone https://github.com/wntrblm/nox.git
[not_oles@radium src]$ time sudo cd nox
[not_oles@radium nox]$ time sudo python3 -m pip install -e . # Note final posix dot.
</code></pre>

<h2><strong>Part V: Create, Activate, And Enter A Python Virtual Environment</strong></h2>

<pre><code>[not_oles@radium ~]$ time python3 -m venv .venv
[not_oles@radium ~]$ source .venv/bin/activate
(.venv) [not_oles@radium ~]$ cd .venv
(.venv) [not_oles@radium .venv]$
</code></pre>

<h2><strong>Part VI: Install <code>pip</code> From Source In The Virtual Environment</strong></h2>

<pre><code># Reference:  https://pip.pypa.io/en/latest/development/getting-started/
(.venv) [not_oles@radium .venv]$ time git clone https://github.com/pypa/pip
(.venv) [not_oles@radium .venv]$ cd pip
(.venv) [not_oles@radium pip]$ time python3 -m pip install -e . # Note final posix dot.
</code></pre>

<h2><strong>Part VII: Install Django From Source In The Virtual Environment</strong></h2>

<pre><code># Reference: https://docs.djangoproject.com/en/4.2/topics/install/#installing-development-version
(.venv) [not_oles@radium .venv]$ time git clone https://github.com/django/django.git
(.venv) [not_oles@radium .venv]$ cd django/
(.venv) [not_oles@radium django]$ time python3 -m pip install -e .
</code></pre>

<h2><strong>Part VIII: How To Exit The Virtual Environment</strong></h2>

<pre><code>(.venv) [not_oles@radium django]$ deactivate
[not_oles@radium django]$ cd
[not_oles@radium ~]$ 
</code></pre>

<h2><strong>Part IX: Test</strong></h2>

<ul>
<li><strong>Normal Environment</strong></li>
</ul>

<pre><code>[not_oles@radium ~]$ which python
/usr/bin/python
[not_oles@radium ~]$ /usr/bin/python -V
Python 3.12.0
[not_oles@radium ~]$ which python3
/usr/local/bin/python3
[not_oles@radium ~]$ /usr/local/bin/python3 -V
Python 3.13.0a1+
[not_oles@radium ~]$ which nox
/usr/local/bin/nox
[not_oles@radium ~]$ /usr/local/bin/nox --version
2023.4.22
[not_oles@radium ~]$ which pip
/usr/bin/pip
[not_oles@radium ~]$ /usr/bin/pip -V
pip 23.2.1 from /usr/lib/python3.12/site-packages/pip (python 3.12)
[not_oles@radium ~]$ which pip3
/usr/local/bin/pip3
[not_oles@radium ~]$ /usr/local/bin/pip3 -V
pip 23.2.1 from /usr/local/lib/python3.13/site-packages/pip (python 3.13
[not_oles@radium ~]$ which django-admin # PATH in global environment
/usr/bin/which: no django-admin in (/home/not_oles/.local/bin:/home/not_oles/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin)
[not_oles@radium ~]$ which sqlite
/usr/bin/which: no sqlite in (/home/not_oles/.local/bin:/home/not_oles/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin)
[not_oles@radium ~]$ which sqlite3
/usr/bin/sqlite3
[not_oles@radium ~]$ sqlite3 -version
3.43.1 2023-09-11 12:01:27 2d3a40c05c49e1a49264912b1a05bc2143ac0e7c3df588276ce80a4cbc9balt1 (64-bit)
[not_oles@radium ~]$ uname -r
6.6.0-0.rc5.20231013git10a6e5feccb8.44.fc40.x86_64
[not_oles@radium ~]$ cat /etc/fedora-release 
Fedora release 40 (Rawhide)
[not_oles@radium ~]$ 
</code></pre>

<ul>
<li><strong>Virtual Environment</strong></li>
</ul>

<pre><code>(.venv) [not_oles@radium .venv]$ which python
~/.venv/bin/python
(.venv) [not_oles@radium .venv]$ python -V
Python 3.13.0a1+
(.venv) [not_oles@radium .venv]$ which python3
~/.venv/bin/python3
(.venv) [not_oles@radium .venv]$ python3 -V
Python 3.13.0a1+
(.venv) [not_oles@radium .venv]$ which nox
/usr/local/bin/nox
(.venv) [not_oles@radium .venv]$ nox --version
2023.4.22
(.venv) [not_oles@radium .venv]$ which pip
~/.venv/bin/pip
(.venv) [not_oles@radium .venv]$ pip --version
pip 24.0.dev0 from /home/not_oles/.venv/pip/src/pip (python 3.13)
(.venv) [not_oles@radium .venv]$ which pip3
~/.venv/bin/pip3
(.venv) [not_oles@radium .venv]$ pip3 --version
pip 24.0.dev0 from /home/not_oles/.venv/pip/src/pip (python 3.13)
(.venv) [not_oles@radium .venv]$ which django-admin
~/.venv/bin/django-admin
(.venv) [not_oles@radium .venv]$ django-admin --version
5.1.dev20231015082711
(.venv) [not_oles@radium .venv]$ which sqlite # Get PATH inside virtual environment :)
/usr/bin/which: no sqlite in (/home/not_oles/.venv/bin:/home/not_oles/.local/bin:/home/not_oles/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin)
(.venv) [not_oles@radium .venv]$ which sqlite3
/usr/bin/sqlite3
(.venv) [not_oles@radium .venv]$ sqlite3 -version
3.43.1 2023-09-11 12:01:27 2d3a40c05c49e1a49264912b1a05bc2143ac0e7c3df588276ce80a4cbc9balt1 (64-bit)
(.venv) [not_oles@radium .venv]$ uname -r
6.6.0-0.rc5.20231013git10a6e5feccb8.44.fc40.x86_64
(.venv) [not_oles@radium .venv]$ cat /etc/fedora-release 
Fedora release 40 (Rawhide)
(.venv) [not_oles@radium .venv]$ 
</code></pre>

<ul>
<li><strong>Web Server</strong></li>
</ul>

<p>We can launch a web server, and then our browser can see the Django default html index page shown in the screenshot above!</p>

<pre><code>[not_oles@radium ~]$ cd .venv
[not_oles@radium .venv]$ source bin/activate
(.venv) [not_oles@radium .venv]$ time django-admin startproject mysite
(.venv) [not_oles@radium .venv]$ cd mysite/
(.venv) [not_oles@radium mysite]$ python3 manage.py runserver 127.0.0.1:42365
</code></pre>

<h2> <strong>Time Summary</strong></h2>

<table>
<thead>
<tr>
  <th align="left">Item</th>
  <th align="right">Time (minutes)</th>
</tr>
</thead>
<tbody>
<tr>
  <td align="left">Install development tools</td>
  <td align="right">8</td>
</tr>
<tr>
  <td align="left">Clone, compile, test, and install CPython</td>
  <td align="right">10</td>
</tr>
<tr>
  <td align="left">Clone and install <code>nox</code></td>
  <td align="right">0.2</td>
</tr>
<tr>
  <td align="left">Create virtual environment</td>
  <td align="right">0.1</td>
</tr>
<tr>
  <td align="left">Clone and install pip</td>
  <td align="right">0.2</td>
</tr>
<tr>
  <td align="left">Clone and install Django</td>
  <td align="right">0.5</td>
</tr>
<tr>
  <td align="left"></td>
  <td align="right">--------</td>
</tr>
<tr>
  <td align="left">Total</td>
  <td align="right">19.0</td>
</tr>
</tbody>
</table>

<h2><strong>Debian 12</strong></h2>

<p>Newly installed out of its netinstall.iso box, Debian 12 Linux seems to use <code>/usr/local/lib</code> for <code>apt</code> Python installations. In other words, <code>/usr/local/lib</code> comes with subdirectories <code>/python3.11</code> and <code>/python3.11/dist-packages</code> preinstalled.</p>

<p>Moreover, Debian valiantly guards <code>/usr/local</code>. The above CPython "configure, compile, test, install" command sequence does not install any <code>pip</code>. Also, on Debian 12, the above <code>nox</code> install command failed. There was a helpful error message, which explained, "This environment" [that is, I guess, global <code>/usr/local</code>] "is externally managed. . . ."</p>

<h2><strong>Discussion</strong></h2>

<ul>
<li>What are the advantages and disadvantages of installing <code>nox</code> globally versus installing <code>nox</code> inside a virtual environment?</li>
<li>Is using <code>python</code> for the packaged install and <code>python3</code> for the compiled install a good idea?</li>
<li>Should we do something like <code>sudo ln -s /usr/local/bin/python3.13 /usr/local/bin/python</code>?</li>
<li>CPython has a helpful <a rel="nofollow" href="https://devguide.python.org/getting-started/setup-building/">Setup and Building Guide.</a> In addition to configuring and compiling, <code>git</code>, dependencies, several operating systems, and troubleshooting also are discussed.  The Guide says, "There is normally no need to install your built copy of Python! The interpreter will realize where it is being run from and thus use the files found in the working copy."</li>
<li>I need to study up on the cpython configure options, including <code>--with-pydebug</code> and <code>--enable-optimizations</code>.</li>
<li>The Cpython <code>test_dtrace</code> formerly succeeded on Rawhide, but it has failed since about the time earlier this month when Python 3.12 was released. There is an old <a rel="nofollow" href="https://bugs.python.org/issue36702">bug report from 2019</a> which has similar log messages. Configuring Cpython with <code>--with-dtrace</code> did not help.</li>
</ul>
]]>
        </description>
    </item>
    <item>
        <title>Install Llama on a GPU server</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/6399/install-llama-on-a-gpu-server</link>
        <pubDate>Thu, 31 Aug 2023 21:04:44 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>havoc</dc:creator>
        <guid isPermaLink="false">6399@/index.php?p=/discussions</guid>
        <description><![CDATA[<p>Busy testing the GPU servers per <a href="https://lowendspirit.com/index.php?p=/profile/crunchbits" rel="nofollow">@crunchbits</a>  thread, jotted down some notes on how to get a fresh ubuntu server to talking llama model. Note this is on a 16gb GPU - if you're on a smaller one you'll need to change the q8_0 part to q4_0 or even q3_k</p>

<p>Also note that here I'm downloading a fp16 model and converting it to q8 GGUF. In practice you can skip over those steps and just download ready made quantized GGUF models from <a rel="nofollow" href="https://huggingface.co/TheBloke">TheBloke's huggingface repo.</a>. i.e. You'd modify the download model step to point to a quantized GGUF model and skip the generate and quantize step after that.</p>

<p>This assumes Ubuntu 22.04 - you may need to do stuff like install python3 if you're on a different distro</p>

<h1>Check that we have a GPU</h1>

<p>apt update &amp;&amp; apt upgrade<br />
apt install hwinfo -y<br />
hwinfo --gfxcard --short</p>

<h1>Set up nvidia driver and SDK</h1>

<p>apt install nvidia-driver-535-server nvidia-dkms-535-server nvidia-cuda-toolkit -y<br />
reboot<br />
nvidia-smi<br />
nvcc --version</p>

<h1>Grab llama.cpp and build it</h1>

<p>git clone <a href="https://github.com/ggerganov/llama.cpp" rel="nofollow">https://github.com/ggerganov/llama.cpp</a><br />
apt install cmake -y<br />
cd llama.cpp<br />
mkdir build<br />
cd build<br />
cmake .. -DLLAMA_CUBLAS=ON<br />
cmake --build . --config Release<br />
cd ..</p>

<h1>Download a model</h1>

<p>mkdir -p /root/llama.cpp/models/llama2-fp16<br />
python3 -m pip install huggingface_hub<br />
python3<br />
from huggingface_hub import snapshot_download<br />
snapshot_download(repo_id="TheBloke/Llama-2-13B-Chat-fp16", revision="main",local_dir="/root/llama.cpp/models/llama2-fp16/")<br />
quit()</p>

<h1>Generate GGUF file</h1>

<p>python3 -m pip install gguf sentencepiece<br />
python3 convert.py ./models/llama2-fp16/</p>

<h1>Quantize it</h1>

<p>cd ./build/bin<br />
./quantize ../../models/llama2-fp16/ggml-model-f16.gguf ../../models/llama2-q8.gguf q8_0</p>

<h1>Run it</h1>

<p>./main -m ../../models/llama2-q8.gguf -ngl 99 --color -p "Tell me a story about a unicorn!"</p>

<blockquote><div>
  <p><strong>Tell me a story about a unicorn!</strong></p>
  
  <p>Once upon a time, in a far-off land of rolling hills and sparkling streams, there lived a beautiful unicorn named Luna. She had a shimmering coat of silver and white, and her horn was as bright as the stars in the night sky.</p>
  
  <p>Luna lived a peaceful life, roaming the forests and meadows, and making friends with all the creatures she met. She loved to play with the butterflies and dance with the flowers, and she could make the most beautiful music with her horn.</p>
  
  <p>One day, a wicked witch cast a spell on the land, causing all the plants and animals to become sick and tired. The unicorns were especially affected, and their beautiful coats became dull and lifeless.</p>
  
  <p>Luna knew that she had to do something to save her friends and the land they lived in. She set out on a journey to find the witch and break her spell.</p>
  
  <p>As she traveled through the forest, Luna met many creatures who were suffering from the witch's spell. She used her horn to heal them and bring them back to life. She also met a brave knight who had been searching for the witch for many years. Together, they journeyed on, determined to defeat the wicked witch and bring peace back to the land.</p>
  
  <p>Finally, after many days of traveling, they came to the witch's castle. It was a dark and gloomy place, surrounded by a moat of swirling black water. But Luna was not afraid. She knew that her horn could break any spell, no matter how powerful.</p>
  
  <p>She and the knight entered the castle, ready to face whatever dangers lay inside. As they made their way deeper into the castle, they came across the witch herself. She was a terrifying sight, with warts and a crooked nose, and a cackle that sent chills down your spine.</p>
  
  <p>But Luna was not afraid. She raised her horn and pointed it at the witch, ready to break the spell. The witch laughed and tried to stop her, but Luna's horn was too powerful. With one blast of magic, the spell was broken, and the land was once again filled with light and life.</p>
  
  <p>The creatures who had been turned to stone were returned to their true forms, and they cheered and celebrated as Luna and the knight emerged from the castle. The witch was banished from the land forever, and peace was restored.</p>
  
  <p>And Luna, the little unicorn with the powerful horn, lived happily ever after, knowing that she had saved her homeland from the evil witch's spell. The end.</p>
</div></blockquote>
]]>
        </description>
    </item>
    <item>
        <title>Whoa! What Happened To All The Disk Space On My Google Cloud Platform Free Tier Debian VPS?</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/6473/whoa-what-happened-to-all-the-disk-space-on-my-google-cloud-platform-free-tier-debian-vps</link>
        <pubDate>Thu, 14 Sep 2023 04:37:03 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>Not_Oles</dc:creator>
        <guid isPermaLink="false">6473@/index.php?p=/discussions</guid>
        <description><![CDATA[<h2>Introduction</h2>

<p>For over four years now I have been enjoying a <a rel="nofollow" href="https://cloud.google.com/free">Google Cloud Platform (GCP) Free Tier Debian VPS.</a> During this time, Debian's package system cache has grown to use more than half of the VPS's 10 GB of file storage space to cache .deb package files. This post explains the history and the use of this wonderful, free VPS (Thanks, Google!); shows the size of the package cache; and explains how to reclaim the large amount of disk space used for the cache.</p>

<h2>VPS Creation in 2019</h2>

<p>According to the <a rel="nofollow" href="https://cloud.google.com/cloud-console">Google Cloud Console,</a> my e2-micro instance was created on January 27, 2019. That was more than four and a half years ago!</p>

<p><img src="https://lowendspirit.com/uploads/editor/vc/0ji1h0vtk7mp.jpeg" alt="" title="" /></p>

<h2>Larger File System Size Possible Within Current GCP Free Tier Limits</h2>

<p>Looking at the current <a rel="nofollow" href="https://cloud.google.com/free/docs/free-cloud-features#free-tier-usage-limits">GCP Free Tier Resource Limits</a> suggests that the Compute Engine limit is "30 GB-months standard persistent disk." My VPS is only 10 GB, so maybe, when I need it, I could increase the file system size to add an additional 20 GB.</p>

<h2>VPS Use</h2>

<p>This GCP VPS has been in modest, but continuous, steady use throughout more than four years. It serves my tiny personal website, holds a few small backup files, and runs <a rel="nofollow" href="http://tinyproxy.github.io/">TinyProxy.</a> Tinyproxy works great for accessing certain websites in the US when I am in Mexico.</p>

<p>I log in to the VPS frequently. I wouldn't say every week for sure, but, if I am working on something, I log in many times in one week. Of course, to update the VPS's Debian operating system, I regularly run <code>apt-get update</code> and then <code>apt-get upgrade</code>.</p>

<h2>Running EOL Debian 10 Buster</h2>

<p>My GCP VPS is still running Debian 10 Buster <a rel="nofollow" href="https://endoflife.date/debian">(End of Life (EOL) a year ago, September 10, 2022),</a> which might be okay, because the <code>check-support-status</code> utility <a rel="nofollow" href="https://wiki.debian.org/LTS/Using#Check_for_unsupported_packages">doesn't list any installed packages</a> without Long Term Support (LTS).</p>

<pre><code>root@gc:~# man check-support-status
root@gc:~# check-support-status
root@gc:~# echo $?
0
root@gc:~# 
</code></pre>

<h2>Great VPS Uptime!</h2>

<p>Usually I run the <code>w</code> command when I log in. Here's what I saw today. 590 days of uptime isn't bad!</p>

<pre><code>root@gc:~# w
 20:43:01 up 590 days, 16:55,  1 user,  load average: 0.00, 0.00, 0.00
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
tom      pts/0    187.189.238.2    19:30    0.00s  0.08s  0.01s sshd: tom [priv]    
root@gc:~# 
</code></pre>

<h2>Low Free Disk Space</h2>

<p>One thing I have noticed is that free disk space on the VPS has been decreasing. Here is what free disk space looked like earlier today.</p>

<pre><code>root@gc:~# df -h .
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       9.8G  8.7G  673M  93% /
root@gc:~# 
</code></pre>

<p>The VPS image was set up without a swap partition. Since I might want to add more website or backup files, install additional utilities, or even add a swap file, I thought the remaining 673 MB might be a little small. I decided to take a look around and see if I could find a place or a few places where I could remove a big file that no longer was needed.</p>

<pre><code>root@gc:/# du -sh /home/tom /var/www
77M     /home/tom
67M     /var/www
root@gc:/# 
</code></pre>

<p>Hmm! It didn't look like my home directory or even my website files were too piggy! Looking some more, I was surprised to find that <code>/var</code> was using a lot of space!</p>

<pre><code>root@gc:/# du -sh /var
5.9G    /var
root@gc:/# 
</code></pre>

<p>Wow! "Lots of logs?" I wondered.</p>

<pre><code>root@gc:/# du -sh /var/*
1.2M    /var/backups
5.7G    /var/cache
156M    /var/lib
4.0K    /var/local
0       /var/lock
13M     /var/log
3.3M    /var/mail
4.0K    /var/opt
0       /var/run
8.7M    /var/spool
12K     /var/tmp
67M     /var/www
root@gc:/# 
</code></pre>

<p>What's using all that space in <code>/var/cache</code>?</p>

<pre><code>root@gc:/# du -sh /var/cache/*
108K    /var/cache/apparmor
5.7G    /var/cache/apt
3.8M    /var/cache/debconf
20K     /var/cache/ldconfig
2.5M    /var/cache/man
4.0K    /var/cache/private
root@gc:/# 
</code></pre>

<p>Oh! It's the package system! Four years of .deb files live there! 5.7 GB! Looking at the full output of the below command without the pipe to <code>wc</code>, it was instantly clear that all except the first five of the 346 output lines were .deb files. That's 341 .deb files! Together, the 341 cached .deb files used more than half of my VPS's disk space!</p>

<pre><code>root@gc:/# ls -l /var/cache/apt/* | wc
    346    3090   28173
root@gc:/# 
</code></pre>

<h2>About .deb Files</h2>

<p>Binary .deb files are packages containing binaries which are <a rel="nofollow" href="https://www.debian.org/doc/manuals/debian-handbook/packaging-system.da.html">"directly useable by <code>dpkg</code>."</a> Source .deb files <a rel="nofollow" href="https://www.debian.org/doc/manuals/debian-handbook/packaging-system.da.html">contain source code.</a></p>

<p>Luckily for small VPSes, after the system has been updated, the <a rel="nofollow" href="https://www.debian.org/doc/manuals/debian-faq/uptodate.en.html">.deb files may be removed.</a></p>

<h2>How To Reclaim Disk Space</h2>

<p>From <code>man apt-get</code>:</p>

<pre><code>       clean
           clean clears out the local repository of retrieved package files. It removes
           everything but the lock file from /var/cache/apt/archives/ and
           /var/cache/apt/archives/partial/.
</code></pre>

<p>After running <code>apt-get clean</code> the VPS got its empty disk space back! 6.4 GB available instead of 673 MB!</p>

<pre><code>root@gc:~# apt-get clean
root@gc:~# ls -l /var/cache/apt/*
total 4
-rw-r----- 1 root root    0 Jan 24  2019 lock
drwx------ 2 _apt root 4096 Sep 13 21:22 partial
root@gc:~# du -sh /var/cache/apt
64K     /var/cache/apt
root@gc:~# df -h .
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       9.8G  3.0G  6.4G  32% /
root@gc:~# 
</code></pre>

<h2>Disabling The Cache</h2>

<p>One possible way to prevent running out of disk space might be to disable the caching of .deb files. From <a rel="nofollow" href="https://manpages.debian.org/stretch/apt/apt.conf.5.en.html"><code>man 5 apt-conf</code>:</a></p>

<pre><code>DIRECTORIES

       [ . . . ]

       Dir::Cache contains locations pertaining to local cache information, such as the two
       package caches srcpkgcache and pkgcache as well as the location to place downloaded
       archives, Dir::Cache::archives. Generation of caches can be turned off by setting
       pkgcache or srcpkgcache to "".
</code></pre>

<p>Please see also this <a rel="nofollow" href="https://lists.debian.org/deity/2014/07/msg00000.html">old Bug #753531 from 2014,</a> which was very fun to read because it <em>almost</em> said <code>rm -rf /*</code>!</p>

<p>It seems possibly safer and generally less work all around to leave the .deb caching defaults as they are. It's easy to empty the cache once in awhile with <code>apt-get clean</code>.</p>

<h2>Conclusion</h2>

<p>For small Debian VPSes which have been in use a  long time, you might want to run <code>apt-get clean</code> to reclaim the large amount of disk space used by the apt cache.</p>
]]>
        </description>
    </item>
    <item>
        <title>How to Become an One-Man NAT VPS Provider?</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/5939/how-to-become-an-one-man-nat-vps-provider</link>
        <pubDate>Sat, 20 May 2023 06:31:42 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>tang_cn</dc:creator>
        <guid isPermaLink="false">5939@/index.php?p=/discussions</guid>
        <description><![CDATA[<p>Assume you have a dedicated server with /64 IPv6, and your goal is to create some IPv6 NAT VMs. How do you do it? Below is a tutorial about how to install QEMU/KVM and create VMs on Debian via the command line.</p>

<hr />

<h1>0. Advance Notice</h1>

<ul>
<li>Special thanks to <a href="https://lowendspirit.com/index.php?p=/profile/Not_Oles" rel="nofollow">@Not_Oles</a> !</li>
<li>This tutorial has been verified to work with Debian 11 on Hetzner's dedicated server.</li>
<li>All commands are executed as root.</li>
<li><p>In this tutorial the host's network configuration is:<br />
<code>Network Interface: eno1</code><br />
<code>IPv4 Address: 192.0.2.2/26</code><br />
<code>IPv4 Gateway: 192.0.2.1</code><br />
<code>IPv6 Address: 2001:db8:ace:babe::1/64</code><br />
<code>IPv6 Gateway: fe80::1</code></p></li>
<li><p>We want to create a private network <code>192.168.0.0/24</code> for VMs; we want to use <code>192.168.0.1</code> as the IPv4 gateway and <code>2001:db8:ace:babe::1</code> as the IPv6 gateway for VMs.</p></li>
<li>We want to create a VM whose IPv4 address is <code>192.168.0.2</code> and IPv6 address is <code>2001:db8:ace:babe:cafe::1/80</code>.</li>
</ul>

<h1>1. Enable IP Forwarding</h1>

<p>Open <code>/etc/sysctl.conf</code>. Find <code>net.ipv4.ip_forward</code>; uncomment this line and set the value to <code>1</code>. Do the same for <code>net.ipv6.conf.all.forwarding</code>.</p>

<p>Save the file; then run <code>sysctl -p</code> to apply changes.</p>

<h1>2. Install Required Packages</h1>

<p><code>apt install qemu-system qemu-utils libvirt-clients libvirt-daemon-system virtinst bridge-utils</code></p>

<h1>3. Modify the Network Configuration</h1>

<h3>3.1 Make a copy of the original <code>/etc/network/interfaces</code></h3>

<p><code>cp -p /etc/network/interfaces /etc/network/interfaces.backup</code></p>

<h3>3.2 Open <code>/etc/network/interfaces</code> and edit</h3>

<p>Comment out eno1's IPv6 configuration, then add the following line:</p>

<p><code>iface eno1 inet6 manual</code></p>

<p>Continue to add the following lines to create an interface <code>br0</code>  for KVM networking:</p>

<pre><code>auto br0
iface br0 inet static
    address 192.168.0.1/24
    bridge_ports none
    bridge_stp off
    bridge_fd 0
    post-up iptables -t nat -A POSTROUTING -s '192.168.0.0/24' -o eno1 -j MASQUERADE
    post-down iptables -t nat -D POSTROUTING -s '192.168.0.0/24' -o eno1 -j MASQUERADE
iface br0 inet6 static
    address 2001:db8:ace:babe::1/64
    up ip -6 route add default via fe80::1 dev eno1
</code></pre>

<p><code>bridge ports none</code> means br0 is not attached to any physical interface. <code>bridge_stp off</code> disables Spanning Tree Protocol; usually we don't need it in simple cases. <code>bridge_fd 0</code> sets the forwarding delay time to 0; 0 is good in simple cases. The <code>iptables</code> line allows LAN nodes with private IP addresses to communicate with external public networks. The <code>ip -6 route</code> line specifies the IPv6 gateway.</p>

<p>Save the file; then run <code>systemctl restart networking.service</code> to apply changes.</p>

<p></p><details><summary>Example: my ORIGINAL /etc/network/interfaces</summary>

<pre><code>source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback
iface lo inet6 loopback

auto eno1
iface eno1 inet static
    address 192.0.2.2
    netmask 255.255.255.192
    gateway 192.0.2.1
    # route 192.0.2.0/26 via 192.0.2.1
    up route add -net 192.0.2.0 netmask 255.255.255.192 gw 192.0.2.1 dev eno1
iface eno1 inet6 static
    address 2001:db8:ace:babe::1
    netmask 64
    gateway fe80::1
</code></pre>

<p></p></details><br />
<details><summary>Example: my NEW /etc/network/interfaces</summary>

<pre><code>source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback
iface lo inet6 loopback

auto eno1
iface eno1 inet static
    address 192.0.2.2
    netmask 255.255.255.192
    gateway 192.0.2.1
    # route 192.0.2.0/26 via 192.0.2.1
    up route add -net 192.0.2.0 netmask 255.255.255.192 gw 192.0.2.1 dev eno1
iface eno1 inet6 manual

auto br0
iface br0 inet static
    address 192.168.0.1/24
    bridge_ports none
    bridge_stp off
    bridge_fd 0
    post-up iptables -t nat -A POSTROUTING -s '192.168.0.0/24' -o eno1 -j MASQUERADE
    post-down iptables -t nat -D POSTROUTING -s '192.168.0.0/24' -o eno1 -j MASQUERADE
iface br0 inet6 static
    address 2001:db8:ace:babe::1/64
    up ip -6 route add default via fe80::1 dev eno1
</code></pre>

<p></p></details>

<h1>4. Create the VM</h1>

<p><code>virt-install --name YOUR_VM_NAME --ram MEMORY_SIZE_IN_MB --vcpus=NUMBER_OF_CORES --disk /PATH/TO/VIRTUAL/DISK/IMAGE.qcow2,device=disk,bus=virtio,size=DISK_SIZE_IN_GB,format=qcow2 --graphics vnc,listen=0.0.0.0,port=VNC_PORT,password=VNC_PASSWORD --network bridge=br0 --noautoconsole --cdrom /PATH/TO/ISOFILE.iso --boot cdrom,hd</code></p>

<p></p><details><summary>Example</summary><br />
We want to create a VM whose name is TEST with 1GB memory, 1 core, and 10GB disk. TEST will be stored at /var/kvm/TEST.qcow2. The VNC port is 5901 and the VNC password is Hello1. We will use /var/iso/Debian.iso to install Debian on TEST.

<p><code>virt-install --name TEST --ram 1024 --vcpus=1 --disk /var/kvm/TEST.qcow2,device=disk,bus=virtio,size=10,format=qcow2 --graphics vnc,listen=0.0.0.0,port=5901,password=Hello1 --network bridge=br0 --noautoconsole --cdrom /var/iso/Debian.iso --boot cdrom,hd</code><br />
</p></details>

<h1>5. Configure Guest Networking</h1>

<p>Because we haven't configured the DHCP service on the host, we have to manually set the VM network settings. If you are using a netinst image to install the OS, then you need to set the IP address to 192.168.0.2/24 and the gateway to 192.168.0.1 during the installation.</p>

<p></p><details><summary>Example: Debain guest /etc/network/interfaces</summary>

<pre><code>source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

allow-hotplug ens3
iface ens3 inet static
    address 192.168.0.2/24
    gateway 192.168.0.1
iface ens3 inet6 static
    address 2001:db8:ace:babe:cafe::1/80
    dns-nameservers 2606:4700:4700::1001
    gateway 2001:db8:ace:babe::1
</code></pre>

<p></p></details>
]]>
        </description>
    </item>
    <item>
        <title>How To Setup A Mail Relay Server To Relay Mail Through MXRoute [CentOS, Alma, Rocky]</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/5288/how-to-setup-a-mail-relay-server-to-relay-mail-through-mxroute-centos-alma-rocky</link>
        <pubDate>Thu, 19 Jan 2023 04:28:15 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>FrankZ</dc:creator>
        <guid isPermaLink="false">5288@/index.php?p=/discussions</guid>
        <description><![CDATA[<p>This is a guide on how to set up a sendmail mail relay server to relay outbound mail via MXRoute.  You will not need to have a reverse DNS (ptr) record for this VM's IPv4 address or worry about IP reputation. You can use this relay server to relay mail through MXRoute from any other VPS as well.<br />
If you're sending a limited amount of mail this outbound only mail relay server can be setup on a small VM with as little as 1 core, 512MB Ram, 5GB disk. If you send a lot of mail than you should up size your VM accordingly.</p>

<p>In part one of this guide we will set up an outbound only mail relay server that will connect and send mail via MXRoute.<br />
In part two we will show how to set up sendmail on any VPS that you want to relay mail through the outbound only mail relay server that you set up in part one.  You can also use postfix or any other mail service on the secondary servers to relay through the outbound only mail relay server.</p>

<p>NOTE: In an effort to make this rather long guide a more reasonable size I have put many of the code blocks that you will need to copy into display pull downs. You will need to click the <img src="https://i.postimg.cc/Jhq82hGP/display-pointer.png" alt="" title="" /> to see this information.</p>

<hr />

<h1> Part One</h1>

<h3>Install required packages </h3>

<p>CentOS 7: <br />
<code>yum -y install sendmail sendmail-cf cyrus-sasl cyrus-sasl-plain</code><br />
<code>yum -y remove postfix</code></p>

<p>CentOS 8, Alma8linux, Rockylinux:<br />
<code>dnf -y install sendmail sendmail-cf cyrus-sasl cyrus-sasl-plain</code><br />
<code>dnf -y remove postfix</code></p>

<h3>Make sure your hostname is set </h3>

<p>Edit <code>/etc/hosts</code> and ensure there is a line <code>[your IPv4]</code> tab <code>[your host name]</code><br />
Edit <code>/etc/sysconfig/network</code> and ensure there is a line <code>HOSTNAME=[your host name]</code></p>

<h3> Setup the certificates </h3>

<p>Get a cert from Let's Encrypt for your mail relay server (I am not showing how to do this here)<br />
Make a subdirectory called "certs" under /etc/mail/:<br />
<code>mkdir /etc/mail/certs</code></p>

<p></p><details><br />
<summary>Copy the cert template in this drop down to <code>/etc/mail/certs/sendmail.pem</code> using a text editor </summary>

<table>
 <tr><td>
-----BEGIN PRIVATE KEY-----<br />
Put your mail relay host private key here<br />
-----END PRIVATE KEY-----<br />
-----BEGIN CERTIFICATE-----<br />
Put your mail relay host certificate here<br />
-----END CERTIFICATE-----<br />
-----BEGIN CERTIFICATE-----<br />
MIIFFjCCAv6gAwIBAgIRAJErCErPDBinU/bWLiWnX1owDQYJKoZIhvcNAQELBQAw
TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh
cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMjAwOTA0MDAwMDAw
WhcNMjUwOTE1MTYwMDAwWjAyMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNTGV0J3Mg
RW5jcnlwdDELMAkGA1UEAxMCUjMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
AoIBAQC7AhUozPaglNMPEuyNVZLD+ILxmaZ6QoinXSaqtSu5xUyxr45r+XXIo9cP
R5QUVTVXjJ6oojkZ9YI8QqlObvU7wy7bjcCwXPNZOOftz2nwWgsbvsCUJCWH+jdx
sxPnHKzhm+/b5DtFUkWWqcFTzjTIUu61ru2P3mBw4qVUq7ZtDpelQDRrK9O8Zutm
NHz6a4uPVymZ+DAXXbpyb/uBxa3Shlg9F8fnCbvxK/eG3MHacV3URuPMrSXBiLxg
Z3Vms/EY96Jc5lP/Ooi2R6X/ExjqmAl3P51T+c8B5fWmcBcUr2Ok/5mzk53cU6cG
/kiFHaFpriV1uxPMUgP17VGhi9sVAgMBAAGjggEIMIIBBDAOBgNVHQ8BAf8EBAMC
AYYwHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMBMBIGA1UdEwEB/wQIMAYB
Af8CAQAwHQYDVR0OBBYEFBQusxe3WFbLrlAJQOYfr52LFMLGMB8GA1UdIwQYMBaA
FHm0WeZ7tuXkAXOACIjIGlj26ZtuMDIGCCsGAQUFBwEBBCYwJDAiBggrBgEFBQcw
AoYWaHR0cDovL3gxLmkubGVuY3Iub3JnLzAnBgNVHR8EIDAeMBygGqAYhhZodHRw
Oi8veDEuYy5sZW5jci5vcmcvMCIGA1UdIAQbMBkwCAYGZ4EMAQIBMA0GCysGAQQB
gt8TAQEBMA0GCSqGSIb3DQEBCwUAA4ICAQCFyk5HPqP3hUSFvNVneLKYY611TR6W
PTNlclQtgaDqw+34IL9fzLdwALduO/ZelN7kIJ+m74uyA+eitRY8kc607TkC53wl
ikfmZW4/RvTZ8M6UK+5UzhK8jCdLuMGYL6KvzXGRSgi3yLgjewQtCPkIVz6D2QQz
CkcheAmCJ8MqyJu5zlzyZMjAvnnAT45tRAxekrsu94sQ4egdRCnbWSDtY7kh+BIm
lJNXoB1lBMEKIq4QDUOXoRgffuDghje1WrG9ML+Hbisq/yFOGwXD9RiX8F6sw6W4
avAuvDszue5L3sz85K+EC4Y/wFVDNvZo4TYXao6Z0f+lQKc0t8DQYzk1OXVu8rp2
yJMC6alLbBfODALZvYH7n7do1AZls4I9d1P4jnkDrQoxB3UqQ9hVl3LEKQ73xF1O
yK5GhDDX8oVfGKF5u+decIsH4YaTw7mP3GFxJSqv3+0lUFJoi5Lc5da149p90Ids
hCExroL1+7mryIkXPeFM5TgO9r0rvZaBFOvV2z0gp35Z0+L4WPlbuEjN/lxPFin+
HlUjr8gRsI3qfJOQFy/9rKIJR0Y/8Omwt/8oTWgy1mdeHmmjk7j1nYsvC9JSQ6Zv
MldlTTKB3zhThV1+XWYp6rjd5JW1zbVWEkLNxE7GJThEUG3szgBVGP7pSWTUTsqX
nLRbwHOoq7hHwg==<br />
-----END CERTIFICATE-----<br />
-----BEGIN CERTIFICATE-----<br />
MIIFYDCCBEigAwIBAgIQQAF3ITfU6UK47naqPGQKtzANBgkqhkiG9w0BAQsFADA/
MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT
DkRTVCBSb290IENBIFgzMB4XDTIxMDEyMDE5MTQwM1oXDTI0MDkzMDE4MTQwM1ow
TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh
cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwggIiMA0GCSqGSIb3DQEB
AQUAA4ICDwAwggIKAoICAQCt6CRz9BQ385ueK1coHIe+3LffOJCMbjzmV6B493XC
ov71am72AE8o295ohmxEk7axY/0UEmu/H9LqMZshftEzPLpI9d1537O4/xLxIZpL
wYqGcWlKZmZsj348cL+tKSIG8+TA5oCu4kuPt5l+lAOf00eXfJlII1PoOK5PCm+D
LtFJV4yAdLbaL9A4jXsDcCEbdfIwPPqPrt3aY6vrFk/CjhFLfs8L6P+1dy70sntK
4EwSJQxwjQMpoOFTJOwT2e4ZvxCzSow/iaNhUd6shweU9GNx7C7ib1uYgeGJXDR5
bHbvO5BieebbpJovJsXQEOEO3tkQjhb7t/eo98flAgeYjzYIlefiN5YNNnWe+w5y
sR2bvAP5SQXYgd0FtCrWQemsAXaVCg/Y39W9Eh81LygXbNKYwagJZHduRze6zqxZ
Xmidf3LWicUGQSk+WT7dJvUkyRGnWqNMQB9GoZm1pzpRboY7nn1ypxIFeFntPlF4
FQsDj43QLwWyPntKHEtzBRL8xurgUBN8Q5N0s8p0544fAQjQMNRbcTa0B7rBMDBc
SLeCO5imfWCKoqMpgsy6vYMEG6KDA0Gh1gXxG8K28Kh8hjtGqEgqiNx2mna/H2ql
PRmP6zjzZN7IKw0KKP/32+IVQtQi0Cdd4Xn+GOdwiK1O5tmLOsbdJ1Fu/7xk9TND
TwIDAQABo4IBRjCCAUIwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYw
SwYIKwYBBQUHAQEEPzA9MDsGCCsGAQUFBzAChi9odHRwOi8vYXBwcy5pZGVudHJ1
c3QuY29tL3Jvb3RzL2RzdHJvb3RjYXgzLnA3YzAfBgNVHSMEGDAWgBTEp7Gkeyxx
+tvhS5B1/8QVYIWJEDBUBgNVHSAETTBLMAgGBmeBDAECATA/BgsrBgEEAYLfEwEB
ATAwMC4GCCsGAQUFBwIBFiJodHRwOi8vY3BzLnJvb3QteDEubGV0c2VuY3J5cHQu
b3JnMDwGA1UdHwQ1MDMwMaAvoC2GK2h0dHA6Ly9jcmwuaWRlbnRydXN0LmNvbS9E
U1RST09UQ0FYM0NSTC5jcmwwHQYDVR0OBBYEFHm0WeZ7tuXkAXOACIjIGlj26Ztu
MA0GCSqGSIb3DQEBCwUAA4IBAQAKcwBslm7/DlLQrt2M51oGrS+o44+/yQoDFVDC
5WxCu2+b9LRPwkSICHXM6webFGJueN7sJ7o5XPWioW5WlHAQU7G75K/QosMrAdSW
9MUgNTP52GE24HGNtLi1qoJFlcDyqSMo59ahy2cI2qBDLKobkx/J3vWraV0T9VuG
WCLKTVXkcGdtwlfFRjlBz4pYg1htmf5X6DYO8A4jqv2Il9DjXA6USbW1FzXSLr9O
he8Y4IWS6wY7bCkjCWDcRQJMEhg76fsO3txE+FiYruq9RUWhiF1myv4Q6W+CyBFC
Dfvp7OOGAN6dEOM4+qR9sdjoSYKEBpsr6GtPAQw4dy753ec5<br />
-----END CERTIFICATE-----</td></tr> </table>

<p></p></details><br />
After copying the cert template to <code>/etc/mail/certs/sendmail.pem</code> you will need to modify the following: <br />
1. Replace <code>Put your mail relay host private key here</code> with the private key you received with your certificate from Let's Encrypt for your relay mail server host name.<br />
2. Replace <code>Put your mail relay host certificate here</code> with the certificate you received from Let's Encrypt for your relay mail server host name.

<p>While in the directory <code>/etc/mail/certs</code> execute the commands:<br />
<code>openssl dhparam -out dhparam.pem 4096</code><br />
and <br />
<code>ln -s /etc/ssl/certs/ca-bundle.crt ca-bundle.crt</code><br />
and <br />
<code>chmod 600 dhparam.pem sendmail.pem</code></p>

<p>You should now have three files in your <code>/etc/mail/certs</code> directory</p>

<blockquote><div>
  <p>ca-bundle.crt   [a soft link]<br />
  dhparam.pem<br />
  sendmail.pem</p>
</div></blockquote>

<p>The certificate will need to be undated before it expires.<br />
I should add a script to auto update the mail server cert from LetsEncrypt. (coming soon&trade;)</p>

<h3>Configure sendmail.mc </h3>

<p>Move the original sendmail.mc to sendmail.mc.org: <br />
<code>mv /etc/mail/sendmail.mc /etc/mail/sendmail.mc.org</code></p>

<p></p><details><br />
 <summary>Copy the code in this drop down to <code>/etc/mail/sendmail.mc</code> using a text editor </summary>

<table>
 <tr><td>divert(-1)dnl</td></tr>
 <tr><td>dnl #</td></tr>
 <tr><td>include(`/usr/share/sendmail-cf/m4/cf.m4')dnl</td></tr>
 <tr><td>VERSIONID(`setup for linux')dnl</td></tr>
 <tr><td>OSTYPE(`linux')dnl</td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>dnl # Do not advertize sendmail version.</td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>define(`confSMTP_LOGIN_MSG', `$j Sendmail; $b')dnl</td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>dnl # default logging level is 9, you might want to set it higher to</td></tr>
 <tr><td>dnl # debug the configuration </td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>dnl define(`confLOG_LEVEL', `9')dnl </td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>dnl #  Your outgoing mail will be sent out through an external MXRoute server</td></tr>
 <tr><td>dnl #  Change the friday.mxlogin.com to the MXRoute server to which you have been assigned</td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>define(`SMART_HOST',`friday.mxlogin.com')dnl</td></tr>
 <tr><td>define(`RELAY_MAILER_ARGS',`TCP $h 587')</td></tr>
 <tr><td>define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl</td></tr>
 <tr><td>FEATURE(`authinfo',`hash /etc/mail/authinfo')dnl</td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>define(`confDEF_USER_ID', ``8:12'')dnl</td></tr>
 <tr><td>define(`confTO_CONNECT', `1m')dnl</td></tr>
 <tr><td>define(`confTRY_NULL_MX_LIST', `True')dnl</td></tr>
 <tr><td>define(`confDONT_PROBE_INTERFACES', `True')dnl</td></tr>
 <tr><td>define(`PROCMAIL_MAILER_PATH', `/usr/bin/procmail')dnl</td></tr>
 <tr><td>define(`ALIAS_FILE', `/etc/aliases')dnl</td></tr>
 <tr><td>define(`STATUS_FILE', `/var/log/mail/statistics')dnl</td></tr>
 <tr><td>define(`UUCP_MAILER_MAX', `2000000')dnl</td></tr>
 <tr><td>define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl</td></tr>
 <tr><td>define(`confPRIVACY_FLAGS', `goaway,restrictqrun')dnl</td></tr>
 <tr><td>define(`confAUTH_OPTIONS', `A')dnl</td></tr>
 <tr><td>PrivacyOptions=nobodyreturn</td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>define(`confCACERT_PATH', `/etc/mail/certs')dnl</td></tr>
 <tr><td>define(`confCACERT', `/etc/mail/certs/ca-bundle.crt')dnl</td></tr>
 <tr><td>define(`confSERVER_CERT', `/etc/mail/certs/sendmail.pem')dnl</td></tr>
 <tr><td>define(`confSERVER_KEY', `/etc/mail/certs/sendmail.pem')dnl</td></tr>
 <tr><td>define(`confCLIENT_CERT', `/etc/mail/certs/sendmail.pem')dnl</td></tr>
 <tr><td>define(`confCLIENT_KEY', `/etc/mail/certs/sendmail.pem')dnl</td></tr>
 <tr><td>define(`confDH_PARAMETERS', `/etc/mail/certs/dhparam.pem')dnl</td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>define(`confTO_IDENT', `0')dnl</td></tr>
 <tr><td>FEATURE(`no_default_msa', `dnl')dnl</td></tr>
 <tr><td>FEATURE(`smrsh', `/usr/sbin/smrsh')dnl</td></tr>
 <tr><td>FEATURE(`mailertable', `hash -o /etc/mail/mailertable.db')dnl</td></tr>
 <tr><td>FEATURE(`virtusertable', `hash -o /etc/mail/virtusertable.db')dnl</td></tr>
 <tr><td>FEATURE(redirect)dnl</td></tr>
 <tr><td>FEATURE(always_add_domain)dnl</td></tr>
 <tr><td>FEATURE(use_cw_file)dnl</td></tr>
 <tr><td>FEATURE(use_ct_file)dnl</td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>dnl # The following limits the number of processes sendmail can fork to accept</td></tr>
 <tr><td>dnl # incoming messages or process its message queues to 20.) sendmail refuses</td></tr>
 <tr><td>dnl # to accept connections once it has reached its quota of child processes.</td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>define(`confMAX_DAEMON_CHILDREN', `20')dnl</td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>dnl # Limits the number of new connections per second. This caps the overhead</td></tr>
 <tr><td>dnl # incurred due to forking new sendmail processes. May be useful against</td></tr>
 <tr><td>dnl # DoS attacks or barrages of spam. (As mentioned below, a per-IP address</td></tr>
 <tr><td>dnl # limit would be useful but is not available as an option at this writing.)</td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>define(`confCONNECTION_RATE_THROTTLE', `3')dnl</td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>dnl # The -t option will retry delivery if e.g. the user runs over his quota.</td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>FEATURE(local_procmail, `', `procmail -t -Y -a $h -d $u')dnl</td></tr>
 <tr><td>FEATURE(`access_db', `hash -T&lt;TMPF&gt; -o /etc/mail/access.db')dnl</td></tr>
 <tr><td>FEATURE(`blacklist_recipients')dnl</td></tr>
 <tr><td>EXPOSED_USER(`root')dnl</td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>dnl # The following causes sendmail to only listen on the IPv4 loopback address</td></tr>
 <tr><td>dnl # 127.0.0.1 and not on any other network devices. Remove the loopback</td></tr>
 <tr><td>dnl # address restriction to accept email from the internet or intranet.</td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl</td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>dnl # The following causes sendmail to additionally listen to port 587 for</td></tr>
 <tr><td>dnl # mail from MUAs that authenticate. Roaming users who can't reach their</td></tr>
 <tr><td>dnl # preferred sendmail daemon due to port 25 being blocked or redirected find</td></tr>
 <tr><td>dnl # this useful.</td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>DAEMON_OPTIONS(`Port=submission,Addr=127.0.0.1, Name=MSA, M=Ea')dnl</td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>dnl # The following causes sendmail to additionally listen to port 465, but</td></tr>
 <tr><td>dnl # starting immediately in TLS mode upon connecting. Port 25 or 587 followed</td></tr>
 <tr><td>dnl # by STARTTLS is preferred, but roaming clients using Outlook Express can't</td></tr>
 <tr><td>dnl # do STARTTLS on ports other than 25. Mozilla Mail can ONLY use STARTTLS</td></tr>
 <tr><td>dnl # and doesn't support the deprecated smtps; Evolution &lt;1.1.1 uses smtps&lt;/td&gt;</td></tr>
 <tr><td>dnl # when SSL is enabled-- STARTTLS support is available in version 1.1.1.</td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>dnl # For this to work your OpenSSL certificates must be configured.</td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>DAEMON_OPTIONS(`Port=smtps, Name=TLSMTA,Family=inet,Addr=127.0.0.1,M=s')dnl</td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>dnl # The following causes sendmail to additionally listen on the IPv6 loopback</td></tr>
 <tr><td>dnl # device. Remove the loopback address restriction listen to the network.</td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>dnl DAEMON_OPTIONS(`port=smtp,Addr=::1, Name=MTA-v6, Family=inet6')dnl</td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>dnl # enable both ipv6 and ipv4 in sendmail:</td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>dnl DAEMON_OPTIONS(`Name=MTA-v4, Family=inet, Name=MTA-v6, Family=inet6')</td></tr>
 <tr><td>dnl # </td></tr> 
 <tr><td>dnl # We strongly recommend not accepting unresolvable domains if you want to</td></tr>
 <tr><td>dnl # protect yourself from spam. However, the laptop and users on computers</td></tr>
 <tr><td>dnl # that do not have 24x7 DNS do need this.</td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>dnl # FEATURE(`accept_unresolvable_domains')dnl</td></tr>
 <tr><td>dnl #</td></tr>
 <tr><td>dnl # Also accept email sent to "localhost.localdomain" as local email.</td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>LOCAL_DOMAIN(`localhost.localdomain')dnl</td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>dnl # The following example makes mail from this host and any additional</td></tr>
 <tr><td>dnl # specified domains appear to be sent from mydomain.com</td></tr>
 <tr><td>dnl #</td></tr>
 <tr><td>dnl MASQUERADE_AS(`mydomain.com')dnl</td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>dnl # masquerade not just the headers, but the envelope as well</td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>dnl FEATURE(masquerade_envelope)dnl</td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>dnl # masquerade not just <a href="https://lowendspirit.com/index.php?p=/profile/mydomainalias" rel="nofollow">@mydomainalias</a>.com, but <a href="https://lowendspirit.com/index.php?p=/profile/%2A" rel="nofollow">@*</a>.mydomainalias.com as well</td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>dnl FEATURE(masquerade_entire_domain)dnl</td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>dnl MASQUERADE_DOMAIN(localhost)dnl</td></tr>
 <tr><td>dnl MASQUERADE_DOMAIN(localhost.localdomain)dnl</td></tr>
 <tr><td>dnl MASQUERADE_DOMAIN(mydomainalias.com)dnl</td></tr>
 <tr><td>dnl MASQUERADE_DOMAIN(mydomain.lan)dnl</td></tr>
 <tr><td>define(`confHELO_NAME',`myhost.mydomain')</td></tr>
 <tr><td>define(`confDOMAIN_NAME',`myhost.mydomain')</td></tr>
 <tr><td>CLIENT_OPTIONS(`Addr=Family=inet,Addr=123.123.123.123')</td></tr>
 <tr><td>CLIENT_OPTIONS(`Family=inet6,Addr=::ffff:123.123.123.123')dnl</td></tr>
 <tr><td>dnl # FEATURE(`require_rdns')</td></tr>
 <tr><td>DAEMON_OPTIONS(`Name=MTARelay,Family=inet,Port=2525')</td></tr>
 <tr><td>dnl # </td></tr>
 <tr><td>LOCAL_CONFIG</td></tr>
 <tr><td>dnl # Certificates and keys must also have been configured</td></tr>
 <tr><td>O CipherList=ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:!DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA</td></tr>
 <tr><td>dnl # Disable SSLv2, SSLv3, TLSv1.0 (TLSv1.1 and TLSv1.2 should be supported)</td></tr>
 <tr><td>O ServerSSLOptions=+SSL_OP_NO_SSLv2 +SSL_OP_NO_SSLv3 +SSL_OP_NO_TLSv1 +SSL_OP_CIPHER_SERVER_PREFERENCE</td></tr>
 <tr><td>dnl # Set options required when operating as client to remote servers</td></tr>
 <tr><td>O ClientSSLOptions=+SSL_OP_NO_SSLv2 +SSL_OP_NO_SSLv3 +SSL_OP_NO_TLSv1</td></tr>
 <tr><td>MAILER(smtp)dnl</td></tr>
 <tr><td>MAILER(procmail)dnl</td></tr>
 <tr><td>dnl MAILER(cyrusv2)dnl</td></tr> </table>

<p></p></details><br />
After copying the code to <code>/etc/mail/sendmail.mc</code> you will need to modify the following: <br />
1. Change <code>friday.mxlogin.com</code> to the mail server you were assigned by MXRoute.<br />
2. Change both occurances of <code>123.123.123.123</code> to the IPv4 of your mail relay server.<br />
3. Change both occurances of <code>myhost.mydomain</code> to the hostname.domainname of your mail relay server.

<p>After making the above changes execute the command: <br />
<code>m4 /etc/mail/sendmail.mc &gt; /etc/mail/sendmail.cf</code></p>

<h3>Setup MXRoute authinfo</h3>

<p></p><details><br />
 <summary>Copy the code in this drop down to <code>/etc/mail/authinfo</code> using a text editor </summary>

<table>
 <tr><td>
AuthInfo:friday.mxlogin.com "U:[your user name]<a href="https://lowendspirit.com/index.php?p=/profile/friday" rel="nofollow">@friday</a>.mxlogin.com" "I:[your user name]<a href="https://lowendspirit.com/index.php?p=/profile/friday" rel="nofollow">@friday</a>.mxlogin.com" "P:[your password]" "M:LOGIN PLAIN"
</td></tr> </table>

<p></p></details><br />
After copying the code to <code>/etc/mail/authinfo</code> you will need to modify the following: <br />
1. Change both occurances of <code>[your user name]</code> to the username that you were assigned by MXRoute.<br />
2. Change all occurances of <code>friday.mxlogin.com</code> to the mail server you were assigned by MXRoute.<br />
3. Change <code>[your password]</code> to the password that you were assigned by MXRoute.

<p>After making the above changes ensure that you are in the directory <code>/etc/mail</code> and execute the command:<br />
<code>makemap hash authinfo &lt; authinfo</code></p>

<h3>Enable sendmail, saslauthd, and reboot</h3>

<p>Execute the following commands to enable sendmail and saslauthd to start on boot and then reboot: <br />
<code>/usr/bin/systemctl enable sendmail.service</code><br />
<code>/usr/bin/systemctl enable saslauthd.service</code><br />
<code>reboot</code></p>

<h3>Set SPF DNS record </h3>

<p>Add the IPv4 address of this mail relay server and MXRoute to your DNS spf record:<br />
<code>TXT     "v=spf1 +ip4:[IPv4 address of this mail relay server] include:mxlogin.com -all"</code></p>

<h3>Is it working ? </h3>

<p>Test if everything works as expected by running this command:<br />
  <code>echo "Subject: hello" | sendmail you@yourdomain</code> <br />
(replace <code>you@yourdomain</code> with your email address)</p>

<p>Check the log file:<br />
<code>cat /var/log/maillog</code></p>

<p>If you see <strong>stat=Sent (OK</strong>, you are sending your mail through MXRoute:</p>

<blockquote><div>
  <p>Jan  9 16:40:55 f sendmail[2246]: 309KF3K5001390: to=&lt;you@yourdomain&gt;, ctladdr=&lt;root@[your relay mail server]&gt; (0/0), delay=01:25:51, xdelay=00:00:01, mailer=relay, pri=750282, relay=friday.mxlogin.com. [159.69.65.104], dsn=2.0.0, <strong>stat=Sent (OK</strong> id=1pEzt1-0004Nf-UP)</p>
</div></blockquote>

<p>If you see <strong>stat=Deferred</strong>, it is not working:</p>

<blockquote><div>
  <p>Jan  9 15:30:02 f sendmail[1848]: 309KF3K5001390: to=&lt;you@yourdomain&gt;, ctladdr=&lt;root@[your relay mail server]&gt; (0/0), delay=00:14:58, xdelay=00:00:00, mailer=relay, pri=390282, relay=friday.mxlogin.com., dsn=4.0.0, <strong>stat=Deferred</strong></p>
</div></blockquote>

<h3>NOTES</h3>

<p>If you make any revisions to <code>/etc/mail/sendmail.mc</code> you will need to execute:<br />
<code>m4 /etc/mail/sendmail.mc &gt; /etc/mail/sendmail.cf</code></p>

<p>If you make any revisions to <code>/etc/mail/authinfo</code> you will need to execute:<br />
<code>makemap hash authinfo &lt; authinfo</code></p>

<p>Then restart sendmail:<br />
<code>/usr/bin/systemctl restart sendmail.service</code></p>

<p>So that the changes you made will take effect.</p>

<h3>Are we done yet ? </h3>

<p>If you are NOT planning to have any other VMs relay through this mail relay server you are done. All mail from this VM will relay via MXRoute. While sendmail is listening on port 2525 no mail will be relayed except from localhost.</p>

<p>If you DO want to relay other VMs mail through this mail server to also send their mail via MXRoute then continue below.</p>

<h3>Allow other VMs to relay through this server</h3>

<p>Open <code>/etc/mail/access</code> in your favorite text editor and add each of the VMs that you want to allow mail to relay through this server by adding their IP address, each on a seperate line, at the bottom of the file as  <code>Connect:123.123.123.123          RELAY</code>.</p>

<p></p><details><br />
 <summary>An example file is shown in this drop down. Change 123.123.123.123 to the IPv4 of the VM you wish to allow to relay via your mail relay server.</summary>

<table>
 <tr><td>
# Check the /usr/share/doc/sendmail/README.cf file for a description <br />
# of the format of this file. (search for access_db in that file)<br />
# The /usr/share/doc/sendmail/README.cf is part of the sendmail-doc<br />
# package.<br />
#<br />
# If you want to use AuthInfo with "M:PLAIN LOGIN", make sure to have the<br />
# cyrus-sasl-plain package installed.<br />
#<br />
# By default we allow relaying from localhost...<br />
Connect:localhost.localdomain           RELAY<br />
Connect:localhost                       RELAY<br />
Connect:127.0.0.1                       RELAY<br />
#<br />
Connect:123.123.123.123          RELAY<br />
</td></tr> </table>

<p></p></details>

<p>After you have added all the VMs you wish to allow to relay to MXRoute via this mail server, and saved the file, execute this command:<br />
 <code>makemap hash /etc/mail/access.db &lt; /etc/mail/access</code></p>

<p>Restart sendmail:<br />
<code>/usr/bin/systemctl restart sendmail.service</code></p>

<p>You will need to execute the two commands above anytime you make any additions or subtractions to the <code>/etc/mail/access</code> file for the changes to take effect.</p>

<h3>Don't forget to open your firewall</h3>

<p>To relay mail via your outbound only mail server from other VMs you must open your firewall for port 2525 access.</p>

<p>For firewalld: <br />
<code>firewall-cmd --permanent --zone=public --add-port=2525/tcp</code><br />
<code>service firewalld stop</code><br />
<code>service firewalld start</code></p>

<hr />

<h1>Part Two</h1>

<p>In part two we will show how to set up sendmail on any VPS that you want to relay mail through the mail relay server that you set up in part one.  It's much easier and faster.</p>

<h3>Install required packages </h3>

<p>CentOS 7: <br />
<code>yum -y install sendmail sendmail-cf</code><br />
<code>yum -y remove postfix</code></p>

<p>CentOS 8, Alma8linux, Rockylinux:<br />
<code>dnf -y install sendmail sendmail-cf</code><br />
<code>dnf -y remove postfix</code></p>

<h3>Make sure your hostname is set </h3>

<p>Edit <code>/etc/hosts</code> and ensure there is a line <code>[your IPv4]</code> tab <code>[your host name]</code><br />
Edit <code>/etc/sysconfig/network</code> and ensure there is a line <code>HOSTNAME=[your host name]</code></p>

<h3>Edit the sendmail.mc file </h3>

<p>Open <code>/etc/mail/sendmail.mc</code> with your favorite text editor and add the lines in the pull down near the bottom of the file between the quoted lines shown above and below the pull down box.</p>

<blockquote><div>
  <p>dnl MASQUERADE_DOMAIN(mydomain.lan)dnl</p>
</div></blockquote>

<p></p><details><summary></summary>

<table> <tr><td>
CLIENT_OPTIONS(`Family=inet6,Addr=::ffff:123.123.123.123')dnl<br />
define(`SMART_HOST',`myrelay.mydomain')dnl<br />
define(`RELAY_MAILER_ARGS', `TCP $h 2525')dnl<br />
</td></tr> </table>

<p></p></details>

<blockquote><div>
  <p>MAILER(smtp)dnl<br />
  MAILER(procmail)dnl<br />
  dnl MAILER(cyrusv2)dnl</p>
</div></blockquote>

<p>After copying the code to <code>/etc/mail/sendmail.mc</code> you will need to modify the following: <br />
1. Change 123.123.123.123 to the IPv4 of the server that is being installed.<br />
2. Change myrelay.mydomain to the hostname.domainname of your mail relay server from part one.</p>

<p>After making the above changes execute the command: <br />
<code>m4 /etc/mail/sendmail.mc &gt; /etc/mail/sendmail.cf</code></p>

<h3>Enable sendmail and reboot</h3>

<p>Execute the following commands to enable sendmail to start on boot and start now : <br />
<code>/usr/bin/systemctl enable sendmail.service</code><br />
<code>reboot</code></p>

<h3>Set SPF DNS record </h3>

<p>If you have not done so previously, add the IPv4 address of the mail relay server and MXRoute to your DNS spf record of the domains for which this VM will be sending mail:<br />
<code>TXT     "v=spf1 +ip4:[IPv4 address of mail relay server] include:mxlogin.com -all"</code></p>

<h3>Is it working ? </h3>

<p>Test if everything works as expected by running this command:<br />
  <code>echo "Subject: hello" | sendmail you@yourdomain</code> <br />
(replace <code>you@yourdomain</code> with your email address)</p>

<p>Check the log file:<br />
<code>cat /var/log/maillog</code></p>

<p>If you see <strong>stat=Sent</strong>, and <strong>Message accepted for delivery</strong> you are sending your mail through your mail relay server:</p>

<blockquote><div>
  <p>Jan 10 04:27:12 localhost sendmail[2993586]: STARTTLS=client, relay=my.relayserver., version=TLSv1.3, verify=OK, cipher=TLS_AES_256_GCM_SHA384, bits=256/256<br />
  Jan 10 04:27:13 localhost sendmail[2993586]: 30A9RCpK2993585: to=you@yourdomain, ctladdr=&lt;root@localhost&gt; (0/0), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=149367, relay=my.relayserver. [IPv4 for my.relayserver], dsn=2.0.0, <strong>stat=Sent</strong> (30A9RCkP001947 <strong>Message accepted for delivery)</strong></p>
</div></blockquote>

<p>On the mail relay server from part one these are the logs of the same email message successfully being relayed through to MXRoute:</p>

<blockquote><div>
  <p>Jan 10 04:27:13 my sendmail[1947]: 30A9RCkP001947: from=&lt;root@the1stvps&gt;, size=11346, class=-60, nrcpts=1, msgid=&lt;202301100927.30A9R2jw2993246@the1stvps&gt;, proto=ESMTPS, daemon=MTARelay, relay=the1stvps [IPv4 of 1st vps]<br />
  Jan 10 04:27:16 my sendmail[1949]: STARTTLS=client, relay=friday.mxlogin.com., version=TLSv1.2, verify=OK, cipher=ECDHE-RSA-AES128-GCM-SHA256, bits=128/128<br />
  Jan 10 04:27:17 my sendmail[1949]: 30A9RCkP001947: to=&lt;you@yourdomain&gt;, delay=00:00:04, xdelay=00:00:04, mailer=relay, pri=239346, <strong>relay=friday.mxlogin.com.</strong> [159.69.65.104], dsn=2.0.0, <strong>stat=Sent (OK</strong> id=1pFAuc-0004BM-Uh)</p>
</div></blockquote>

<p>If you see <strong>stat=Deferred Connection timed out</strong> , it is not working. <br />
In this case the firewall was not open for port 2525 on mail relay server:</p>

<blockquote><div>
  <p>Jan 10 04:24:01 localhost sendmail[2987677]: 30A8S7uH2987677: to=&lt;you@yourdomain&gt;, delay=08:45:57, xdelay=00:00:00, mailer=relay, pri=931045, relay=my.mailrelayserver., dsn=4.0.0, <strong>stat=Deferred:Connection timed out with my.mailrelayserver.</strong></p>
</div></blockquote>

<p>If you see <strong>stat=User unknown</strong> , it is not working. <br />
In this case the IPv4 of this server was not in the <code>/etc/mail/access file</code> on the mail relay server:</p>

<blockquote><div>
  <p>Jan 10 22:30:47 localhost sendmail[3093806]: 30B3UkCR3093806: to=you@yourdomain, delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=32612, relay=my.relayserver. [IPv4 of my.relaysever], dsn=5.7.1, <strong>stat=User unknown</strong></p>
</div></blockquote>

<p>This will be shown on the mail relay server as the following <strong>Relaying denied</strong> error.</p>

<blockquote><div>
  <p>Jan 10 22:30:47 my sendmail[1363]: 30B3UjUR001363: ruleset=check_rcpt, arg1=&lt;you@yourdomain&gt;, relay=the1stvps [IPv4 of 1st VPS], reject=550 5.7.1 &lt;you@yourdomain&gt;... <strong>Relaying denied</strong></p>
</div></blockquote>

<h2>Are we done yet ? </h2>

<p>Yes, for this guide that is it for now.....<br />
But no you are not done yet.  At a minumum servers that send outbound mail should use DKIM in addition to having SPF records and all the good stuff that MXRoute provides.</p>

<hr />

<p><br /></p>

<h2> A warning from MXRoute so as to not cause problems</h2>

<blockquote><div>
  <p><a href="https://lowendspirit.com/index.php?p=/profile/jarland" rel="nofollow">@jarland</a> said:<br />
  It’s worth noting that a slight variation on this kind of setup consumes a significant amount of my time trying to protect the infrastructure from being overwhelmed by pure junk that drags down IP reputation by increasing the association between our IPs and spam folders. These are the big line items:</p>
  
  <ol>
  <li>Almost no one who does this cares that their hostname isn’t an actual valid domain, forcing me to locate all of their server hostnames and add them to a banned sender list so they get errors instead of flooding the queue with junk I can’t deliver or bounce.</li>
  <li>That cron job you have set to run every minute sends a notification, and the person who sets this up commonly has all of these emails sent to their Gmail address.</li>
  <li>A simple command line interface or a cron job notification lacks the required headers that a legitimate email client would add without the user noticing.</li>
  </ol>
  
  <p>Number 1 causes our mail queues to be packed full of “root@vps{1..999}” emails that I can’t and won’t deliver because they’re not from valid envelope senders. But I can’t say that these are inherently bad and prevent them from going out before I identify each one of them because temporary DNS issues could cause a sending address to appear invalid that isn’t later. So I queue them, but then I audit the queues every day for this junk and use it to build my banned sender list (ex. *<a href="https://lowendspirit.com/index.php?p=/profile/localhost" rel="nofollow">@localhost</a>, *<a href="https://lowendspirit.com/index.php?p=/profile/vps1" rel="nofollow">@vps1</a>, *<a href="https://lowendspirit.com/index.php?p=/profile/vps" rel="nofollow">@vps</a>.local, etc.).</p>
  
  <p>Number 2 loops in with #1, and the two items work hand in hand to try to overly associate our IP addresses with Gmail’s spam folder, and number 3 comes in here as part of that. A bad sending address, a cron job notification that the user never meant for human consumption (and will never read, save for the 1 in a million user who might), and a lack of valid headers combined with Gmail’s threading feature mean you see one little junk email in your Spam folder, but you actually sent 1,440 junk emails per cron job to Gmail that were all destined to the spam folder. Combine that with the 600 other users doing the same thing, and you then have 864,000 emails from our platform daily, which are guaranteed to land in Gmail’s spam folder. Almost none of those users even meant to send those emails. The users rarely have any idea that they sent them, and they have no plan of gaining anything from it. It’s hard to let all of that through and then tell people I’m focused on doing everything I can to ensure inbox delivery.</p>
  
  <p>All this to say, it’s good to be able to configure your systems to do this, but please keep one thing in mind: The MXroute platform is designed to send emails that are intended for either human consumption or automatic processing. It is not intended to be used as a garbage delivery system for Gmail. It also can’t be used as a garbage delivery system for Gmail, expecting that intentionally sent emails have a high probability of landing in the inbox. It can be one or the other. It can’t be both. Doing everything I can to get intentional emails into the inbox has always been my top focus. So please, if you do this, take a moment to consider what your server is doing and how it may use this configuration in ways you weren’t thinking of at the time.</p>
  
  <p>Do make sure that your sending addresses are always valid. If your hostname isn’t valid, has no MX or SPF records itself, then your cron jobs and other system emails are going to be sending as invalid envelope senders. Think “root@localhost” that’s not valid, even “root@myvps.mydomain.tld” is invalid if myvps.mydomain.tld lacks valid MX/SPF. Most of that is fine if you’re sending to yourself to be delivered to an inbox on the same MXroute server that your service is hosted on, but if you’re sending these out to remote recipients that’s when you really need to dot your I’s and cross your T’s, making sure you have everything done properly.</p>
</div></blockquote>
]]>
        </description>
    </item>
    <item>
        <title>Five Ways to Keep Your Hosting Costs Under Control - Part II</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/5355/five-ways-to-keep-your-hosting-costs-under-control-part-ii</link>
        <pubDate>Thu, 26 Jan 2023 15:49:57 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>vyas</dc:creator>
        <guid isPermaLink="false">5355@/index.php?p=/discussions</guid>
        <description><![CDATA[<h2>Five Ways to Keep Your Hosting Costs Under Control - Part II</h2>

<p>-By <a rel="nofollow" href="https://blog.amarvyas.in">A. Vyas</a>, January 2023</p>

<p>Read Part I here: <a rel="nofollow" href="https://lowendspirit.com/discussion/5233/five-ways-to-keep-your-hosting-costs-under-control-part-i" title="Five Ways to Keep Your Hosting Costs Under Control - Part I">Five Ways to Keep Your Hosting Costs Under Control - Part I</a></p>

<p></p><div><img src="https://lowendspirit.com/uploads/editor/88/qttdntujv8g4.png" alt="" title="" /></div>

<h3>Introduction</h3>

<p>This is the second and concluding part of a two part series on how you can reduce your web hosting costs in times of high inflation and increasing web hosting fees. In the previous part, we saw how a person "Lata" was able to save nearly 30 US dollars a month by adopting three different approaches to manage her web hosting plans.</p>

<p>To summarise, the three approaches she adopted so far were:<br />
I. Consolidate the hosting plans<br />
II. Moving the hosting to a cheaper location(s)<br />
III. Lower the specifications a notch or two</p>

<p>In this part, let us explore some more ways that she followed, and determine how much savings she was able to achieve in practical terms.</p>

<h4>IV. Check those idlers and duplicates</h4>

<p>Idlers are the bane of the Low End aficionados. Lata's case was no different. She had multiple idlers in her webhosting "Empire", and quite a collection of hosting services were in Singapore. From Lata's home location, Singapore offered the greatest set of options and a reasonable ping ~ 45 ms. It was not the fastest or the best latency she could get, but it was much better than locations in Western Europe (~ 150 ms) or the East Coast, USA (~ 220 ms).</p>

<p>Over the past couple of years Lata kept subscribing to newer plans in <a rel="nofollow" href="https://blog.amarvyas.in/web-hosting/vps-offers-singapore/">Singapore</a>, it almost became a habit of sorts. Recently, she decided to cut the number of plans to half. Gone was a small server, a larger KVM, and a reseller hosting plan. All three were mostly idling.</p>

<p>Lata also had multiple KVM plans in Western Europe. Some could be transferred out, but the renewal for these plans was only a few weeks away. She set them to be terminated at the conclusion of their respective periods.</p>

<p>Scheduling to terminate the service at the end of the billing period also gave her an opportunity to backup and migrate her data in a planned manner, instead of rushing things at the last minute.</p>

<blockquote><div>
  <p>Tip: You can consider transferring out the plans out to other users in the LE community. However, the level of effort and transfer fees in many cases may outweigh the savings.</p>
</div></blockquote>

<p><em>Estimated savings till March 2023 : about 30 US Dollars</em></p>

<blockquote><div>
  <p>Tip: Do you have a few extra idlers that are higher than your comfort level? Do you see an opportunity to cut down on a few plans? A great place to start would be to check if you have multiple plans in the same location.</p>
</div></blockquote>

<h4>V. Check the pricing terms, mode of payment, and currency</h4>

<p>Lata, who is based in Bengaluru in India, was paying for most services in US Dollars through <a rel="nofollow" href="https://paypal.com">PayPal</a>. She began to explore providers who accepted payment in Indian Rupees (INR). The reason for preferring PayPal will be highlighted in a different post, since it involves a deep dive into regulation, tax implications, as well as other technicalities.</p>

<p>She switched some of her services to providers who accepted payment in INR, and paid them using services such as Razorpay. Paying for longer terms (6 months or higher) helped her and the web host save some percentage points in processing fees as well.</p>

<blockquote><div>
  <p>The downside of this approach is that sometimes, this method may not be practical.</p>
</div></blockquote>

<p>For example, Lata had VPS plan with one host from India, for a VPS located in Mumbai. Their monthly charges were 4 US dollars. For annual payment, they offered a 8 dollar discount, that is 40 US Dollars per year. However, Lata was required to pay in US Dollars.</p>

<p>Typically, INR: US Dollar exchange rate is between 70 and 72 (i.e. 70 INR = 1 US Dollar). In recent months, it is hovering closer to INR 80-83 range. Adding Paypal fees, etc- the rate climbs to 85 or 86 INR per US Dollar. In other words, Paypal adds an overhead that negates any potential cost savings. In Lata's case, it resulted in savings of only 2 US Dollars. She dropped the idea of switching the currency and payment terms altogether, and decided to opt for monthly subscription.</p>

<p><em>Estimated savings till March 2023: Nil</em></p>

<blockquote><div>
  <p>Tip: Are you paying month to month, or a slightly longer term? Does your host offer discounts if you pay for six months or annually? Many hosts, in fact, do!</p>
</div></blockquote>

<h3>The savings add up</h3>

<p>Needless to say, the steps taken by Lata helped her save some money. In the first part of this series, we saw how Lata was able to save 87 US dollars. In this part, we saw that her proactive steps yielded savings of another 30 US Dollars.</p>

<p>All in all around 120 US dollars saved upto March 2023, or about 40 US dollars a month, is quite a bit of money saved! Maybe she should get a hot, tempting hosting plan during a future sale this year to reward herself for her efforts. Just kidding.</p>

<h3>Wrapping it all up</h3>

<p>Under normal circumstances, a cost increase due to inflation is expected and mostly a given. Inflation may vary from low single digits to high teens, depending on the country in which one lives. But present times are challenging and dynamic, where double digit inflation is prevalent in many countries at the same time, even those who have not seen such costs in 20 or even 30 years!</p>

<p>Add to this the falling value of the <a rel="nofollow" href="https://www.xe.com/currencyconverter/convert/?Amount=1&amp;From=GBP&amp;To=USD">British Pound</a>, <a rel="nofollow" href="https://www.xe.com/currencyconverter/convert/?Amount=1&amp;From=USD&amp;To=EUR">or the Euro</a>, in comparison to the US Dollar. I already mentioned INR's fall compared to the US Dollar earlier. The story may not be too different where you live.</p>

<p>But these times also present an opportunity to reflect on the hosting situation and think of ways to keep a tab on the hosting costs. I hope Lata's approach gave you an idea or two. However, the story does not end there.</p>

<p>Some questions that may arise such as:</p>

<ul>
<li><p>Has this post covered most of the practical approaches? (i.e. ones that can be considered as low hanging fruits)?</p></li>
<li><p>Did Lata miss something obvious?</p></li>
<li><p>Can she optimize the costs further?</p></li>
</ul>

<p>I leave you with these questions as food for thought, and may the Low End Spirit in you figure out the best way(s) for you.</p>

<hr />

<p>Author's Note: Thanks to the two reviewers, who shall remain unnamed, for their feedback and suggestions for this post.</p>
]]>
        </description>
    </item>
    <item>
        <title>Five Ways to Keep Your Hosting Costs Under Control - Part I</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/5233/five-ways-to-keep-your-hosting-costs-under-control-part-i</link>
        <pubDate>Tue, 10 Jan 2023 05:41:42 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>vyas</dc:creator>
        <guid isPermaLink="false">5233@/index.php?p=/discussions</guid>
        <description><![CDATA[<h1>Five Ways to Keep Your Hosting Costs Under Control - Part I</h1>

<p>-By <a rel="nofollow" href="https://blog.amarvyas.in">A. Vyas</a>, January 2023</p>

<p></p><div><img src="https://lowendspirit.com/uploads/editor/88/qttdntujv8g4.png" alt="" title="" /></div>

<p>(This is a two part series that is aimed to help customers looking to optimize their web hosting costs, although many of the suggestions may apply to the web hosts themselves)</p>

<h4>Introduction</h4>

<p>It is early January 2023 as I write this post. The 2022 end of the year Holiday season has just concluded, the Black Friday/ Cyber Monday and Christmas/ New Year Sales have concluded, and hopefully many of you still have some money left over to pay for your renewing your web hosting plans! This period becomes allows some time to reflect on how much one is spending on subscriptions in general and web hosting services in particular. The possibility of an economic downturn is one reason. The other factor, which I have mentioned below, is already a reality.</p>

<p>Over the past few months, many web hosting providers have increased their hosting fees on account of rising costs. European countries in particular have witnessed very high energy costs, which has added to the problem of high inflation. This has resulted in higher costs for running their business. In most cases, they have no choice other than passing on these increases to their customers.</p>

<p>In such a situation, how can a user, who is say a typical customer of Low End hosting, keep the hosting costs low? Let us take a look at five different ways to help you keep a tight leash over your hosting costs in the coming months.</p>

<h4>Web Hosting Plans- The Problem of Plenty</h4>

<p>Before we get down to business, let us try and answer this all important question:</p>

<blockquote><div>
  <p>Do you have too many hosting plans, or do you have a large collection of hosting subscriptions?</p>
</div></blockquote>

<p>If the answer is yes, you are in a perfect position to take a deep, hard look at your respective hosting collections. There may be some impulse purchases, and some plans that do not make any sense now. Those are ripe to be dropped or culled. For example,</p>

<p>Is there a 2 GB shared hosting plan that you purchased during last Black Friday? Or an older OVZ server that is still active?</p>

<p>If the answer is no, you are in a good position to start optimizing further- maybe switch a plan or two to a lower tier. We will discuss that option in Part II of this series.</p>

<h3>Where and How to begin reducing your web hosting costs?</h3>

<h4>Lata's Approach to Saving on Web Hosting</h4>

<p>Let us take a look at the Web Hosting "Empire" of a person called Lata. She has gathered quite a number of webhosting plans over the years. When she was thinking of reducing these expenses she adopted the following approach.</p>

<p>First, she prepared a chart that lists all the hosting plans she actively subscribed to. In Lata's case, as might be the situation with many of you, this presented quite a collection of Shared hosting, Reseller, NAT, OVZ, KVM and Storage servers. In addition, she also has subscriptions for many SaaS (Software as a Service) based hosting plans from providers like <a rel="nofollow" href="https://jimdo.com">Jimdo</a> and <a rel="nofollow" href="https://shopify.com">Shopify</a>.</p>

<p>In other words, short of a Dedicated server, Lata had subscribed to practically every sort of hosting plan one may typically find here on Lowend Spirit(<a href="https://lowendspirit.com/" rel="nofollow">https://lowendspirit.com/</a>). While some of the hosting plans have been procured for friends and family, others are for her customers. Finally, a few plans are for her own personal or hobby projects.</p>

<p><img src="https://lowendspirit.com/uploads/editor/kl/up6fu6kvx8sr.png" alt="" title="" /></p>

<p><sub>Lata's Webhosting collection</sub></p>

<p>Let us see how Lata began to arrive at optimizing her costs.You can also develop a method that suits your situation the best. Lata tried five different approaches to arrive at some cost savings. In this first part of the series, we will look at three approaches. The balance will be covered in the second installment.</p>

<blockquote><div>
  <p>For sake of simplicity, all costs are mentioned in US Dollar terms, and any savings are projected to occur between January and March 2023.</p>
</div></blockquote>

<h4>I. Consolidate the hosting plans</h4>

<p>Once Lata drew up her "hosting empire", she added up the fees for these plans. She sorted them by fees incurred, starting from the highest to lowest. Most of her plans were paid annually or for a longer duration. Many were up for renewal over the next couple of months. This helped her to start prioritizing which hosting plans she should close. Terminating the most expensive plans alone could have added to her savings quite a bit, had it been a practical approach.</p>

<p><em>Estimated savings till March 2023 : about 40 US Dollars</em></p>

<blockquote><div>
  <p>Tip: List down the pricing for all the plans you have, that alone will be a great starting point before you start looking at savings.</p>
</div></blockquote>

<h4>II. Moving the hosting to a cheaper location(s)</h4>

<p>Hosting in Europe typically used to be cheaper till recent months. Generally speaking, this is likely to remain for some time, depending on how the current energy crisis evolves. However, these times also present an opportunity to move the hosting to a different location - say North America. And, in some (very rare cases) also Asia.</p>

<p>Lata followed this approach and reached out to some of her hosting providers who had services across multiple regions. She asked them,</p>

<blockquote><div>
  <p>"Would they consider moving some of her services to cheaper locations?"</p>
</div></blockquote>

<p>Some providers agreed, others refused, a couple of them offered to move her for a fee. Lata did a quick cost to benefit analysis, and decided that some non-critical service(s) could be moved to cheaper locations. However, the mission critical stuff that required the lowest latency or higher reliability remained at their present locations.</p>

<p><em>Estimated savings till March 2023 : about 35 US Dollars</em></p>

<blockquote><div>
  <p>Tip: Do you have hosting plans with provides who have services across multiple regions? Maybe a chat with the support team could help you figure out some savings.</p>
</div></blockquote>

<h4>III. Lower the specifications a notch or two</h4>

<p>The third approach Lata adopted involved asking an all-important question:</p>

<blockquote><div>
  <p>Did she really needed the plans with higher specifications- hosting she had subscribed to "Just in case"? </p>
</div></blockquote>

<p>For example, she had a shared hosting plan in North America with about 20 GB of Storage space, with a maximum of 10 domains, and 1 TB bandwidth per month. Most of this capacity was lying unused. She decided to move to a lower plan that had half the specifications. This resulted in nearly 30 percent savings.</p>

<p><em>Estimated savings till March 2023: about 12 US Dollars</em></p>

<blockquote><div>
  <p>Tip: In times of tightening the belt, scaling down a plan or two can help save some costs.</p>
</div></blockquote>

<h3>The savings do add up, and the journey is not yet complete.</h3>

<p>By adopting the above three approaches, (consolidating the hosting plans, moving the hosting plans to cheaper locations, and lowering the specifications on the plans) Lata is projected to save around 87 US Dollars over three months (or about 30 US dollars a month) in hosting fees. And she was not done yet! In the second part of this series, let us explore some more ways in which you can learn form Lata's experience and determine ways to lower your own web hosting costs.</p>

<p>Note: This article was originally written in October 2022, the estimated savings and timelines have been revised to reflect the costs at the time of publication.</p>
]]>
        </description>
    </item>
    <item>
        <title>Alternatives to CentOS -- After The Storm</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/4049/alternatives-to-centos-after-the-storm</link>
        <pubDate>Thu, 14 Apr 2022 03:47:38 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>vyas</dc:creator>
        <guid isPermaLink="false">4049@/index.php?p=/discussions</guid>
        <description><![CDATA[<h1>Alternatives to CentOs- After The Storm</h1>

<p>Welcome to this first post of 2022 on the LES Blog!</p>

<p>Nearly 14 months have passed since the seminal announcement by Red Hat about the End of Life (EOL) for CentOs8. The much loved server oriented Linux distribution did reach it EOL on December 31, 2021. Over this period, how have the users coped up? What are the alternatives they have settled for? Did the predictions of doom and gloom really come true? Finally, which of the several alternative projects have made the greatest headway or found  the highest user acceptance? Read on to learn more. <br /><br />
<img src="https://talk.lowendspirit.com/uploads/editor/2h/lcz0t11ueysb.jpg" width="400x" alt="CentOS logo- Wikimedia Commons" /><br /><br />
Source: Wikimedia Commons</p>

<blockquote><div>
  <p>You can listen to the audio version of this post at (<a rel="nofollow" href="https://studio.lovo.ai/share/o/61227312-55da-4eef-a759-13e6cdecd6c8/60d4551aab24d20012ab6216">External Link</a>)</p>
</div></blockquote>

<h3>In This Post</h3>

<ol>
<li><a rel="nofollow" href="#Background">Background: RedHat Discontinues development for CentOs8</a></li>
<li><a rel="nofollow" href="#Adversity-Opportunity">Every Adversity is an Opportunity</a></li>
<li><a rel="nofollow" href="#Alternatives-CentOs8">Do We Have "Good" Alternatives?</a></li>
<li><a rel="nofollow" href="#Alma-Rocky">Alma Linux and Rocky Linux</a></li>
<li><a rel="nofollow" href="#Other-Alternatives">Other Alternatives to CentOs8</a></li>
<li><a rel="nofollow" href="#CentOs-Stream">What About CentOs Stream and CentOs7?</a></li>
<li><a rel="nofollow" href="#End-CentOs8-Era">Wrapping Up: End of CentOs8 Era</a></li>
<li><a rel="nofollow" href="#Fun-Reading">Optional reading - For Fun's Sake</a></li>
</ol>

<h2>Background: December 2020- CentOs project closing its doors <a name="Background"></a></h2>

<p>In early December 2020, the folks at Red Hat Linux had made the announcement that CentOS 8, the latest version of the open source server oriented operating system, <a rel="nofollow" href="https://blog.centos.org/2020/12/future-is-centos-stream/">would reach its end of life on December 31, 2021</a>. Development of Centos 9 would stop. CentOs project would focus on something called <a rel="nofollow" href="https://www.centos.org/centos-stream/">CentOs Stream</a>, instead of  a server distribution that was <em>downstream</em> of Read Hat Linux.</p>

<p>Naturally, there was a lot of hue and cry among the users of CentOS in particular, and  the open source community in general. The recurring view expressed was that an open source project that was backed by a large company, which decided to shut it down, leaving the users abandoned. The large company, Red Hat Linux, <a rel="nofollow" href="https://www.redhat.com/en/about/press-releases/ibm-closes-landmark-acquisition-red-hat-34-billion-defines-open-hybrid-cloud-future">had itself been acquired by a much bigger tech company</a>, - none other than Big Blue  a.k.a IBM.</p>

<h2>Every Adversity is an opportunity? <a name="Adversity-Opportunity"></a></h2>

<p>Since the day of the announcement, several expected and un-expected things happened.</p>

<p>a. There was an uproar in the tech community, and discussions on Reddit and web hosting forums, including this one.</p>

<p>b. Two new major projects were announced: Rocky Linux and Alma Linux. Both are backed by well known names in the Linux world. The trend of announcing new alternatives to CentOS continues. As recently as January 2022, SuSe Linux have proposed their own alternative to CentOs, <a rel="nofollow" href="https://talk.lowendspirit.com/discussion/3716/liberty-linux-yaca-yet-another-centos-alternative/">called Liberty Linux</a>. And if you scroll below to the "Piece De Resistance" section below, you may be in for a surprise.</p>

<p>c. Media houses, publications, bloggers and YouTubers all began to come up with "<a rel="nofollow" href="https://duckduckgo.com/?q=alternatives+to+cent0s+2022">Alternatives to CentOs</a>" type of posts. Some posted good alternatives, others simply drew up a  random lists of operating systems <a rel="nofollow" href="https://www.g2.com/products/centos/competitors/alternatives">which included Windows 10!</a></p>

<p>d. Competitors such as Oracle began to run promotions trying to woo away users into the fold of Oracle Linux.</p>

<blockquote><div>
  <p>They say, every adversity is an opportunity. Maybe for the real change makers over the long run. In reality, in the short term, it is the opportunists who can also benefit.</p>
</div></blockquote>

<p>What turns out to be true in this case? Read on to find out...</p>

<h3>It's good to have alternatives... but do we have "Good" alternatives?<a name="Alternatives-CentOs8"></a></h3>

<p>My main intention here is to see where things stand nearly 14 months after the Red Hat announcement was made. In early February 2022, we will be in the fifth or sixth week since CentOs 8 reached its end of life. given this timeline, some of the questions I was keen to understand were:</p>

<p>a. Many alternatives to CentOs were proposed as in the multiple lists prepared by different publications. You can read some of them <a rel="nofollow" href="https://www.zdnet.com/article/where-centos-linux-users-can-go-from-here/">here</a> and <a rel="nofollow" href="https://www.makeuseof.com/best-centos-alternatives/">here</a>. Have the users really migrated to one of the many alternatives that are that were proposed?</p>

<p>b. What made them choose one option over another? Did any move to CentOs Stream?</p>

<p>c. What is the feedback about these alternatives? Which one really gained traction among the users?</p>

<h2>Taking a Look: User feedback and beyond</h2>

<h3>Alma Linux and Rocky Linux - The Dynamic Duo<a name="Alma-Rocky"></a></h3>

<blockquote><div>
  <p>While researching for this article, it has become evident that the two most popular CentOS alternatives are <a rel="nofollow" href="https://almalinux.org/">AlmaLinux</a> and <a rel="nofollow" href="https://rockylinux.org/">Rocky Linux</a>. The former is created by the folks at <a rel="nofollow" href="https://cloudlinux.com">Cloud Linux</a>, while the latter is set up by one of the original co-founders of CentOS.</p>
</div></blockquote>

<p>No matter which publication or resource once one looks at, these two names keep coming up right at the top.</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/lq/vxbixr2p5o2g.png" width="400" alt="Logo of Alma Linux" /> <br /><br />
Source: Alma Linux</p>

<p>Alma Linux has a very good comparison of features, organizational structure, etc. for some of the alternative If you scroll below, you will find a table comparing the different alternative: CentOs, Alma Linux, Rocky Linux, Oracle Linux and Red Hat . Alma Linux is an open a community based distribution from the folks at Cloud Linux. Rocky Linux is a private limited company started by one of the original co founders of CentOS. The former is a nonprofit, latter is a for profit setup.  They both offer scripts that help the users migrate from CentOS to their respective distributions. Compatibility with Red Hat Enterprise Linux support, end of life cycles etc are pretty much identical.</p>

<p>Source: <a rel="nofollow" href="https://wiki.almalinux.org/Comparison.html">Alma Linux</a><br />
<img src="https://talk.lowendspirit.com/uploads/editor/5l/64k85bxcq7s8.jpg" alt="Comparison of alternatives to CentOs. Source: Alma Linux" /><br /></p>

<p>Some of the limitations of the alternatives were discussed extensively across Reddit, HackerNews and other sources. Some of the below also came up <a rel="nofollow" href="https://talk.lowendspirit.com/discussion/3751/call-for-inputs-from-providers-users-centos-alternatives-2022">in this discussion right here on LES</a>. They include, in no particular order,</p>

<ul>
<li>Community, or lack of</li>
<li>Longevity of the teams or support from the organizations behind the projects</li>
<li>Maturity of the products</li>
<li>Backing by large Corporates. Some people were not happy with Corporate support for some of the newer projects- the Red Hat experience probably left a bad taste.</li>
</ul>

<p>Computingforgeeks has a good list of features that discusses the pro's and con's of the different <a rel="nofollow" href="https://computingforgeeks.com/rocky-linux-vs-centos-stream-vs-rhel-vs-oracle-linux/">alternatives to CentOs</a>. You can also read this <a rel="nofollow" href="https://www.reddit.com/r/linuxadmin/comments/r55u96/alma_or_rocky_linux_and_why/">discussion on Reddit</a> and on <a rel="nofollow" href="https://news.ycombinator.com/item?id=28213775">Hackernews</a>. For those who prefer the Video version, here is a decent resource that explains the difference between Rocky and Alma Linux.</p>

<blockquote><div>
  <p><span data-youtube="youtube-Iwafps4PnPI?autoplay=1"><a rel="nofollow" href="https://www.youtube.com/watch?v=Iwafps4PnPI"><img src="https://img.youtube.com/vi/Iwafps4PnPI/0.jpg" width="640" height="385" border="0" alt="image" /></a></span></p>
</div></blockquote>

<p><strong>Update April 2022</strong>: <a rel="nofollow" href="Distrowatch.com">Distrowatch.com</a> in their <a rel="nofollow" href="https://distrowatch.com/weekly.php?issue=20220404#news">April 4, 2022 edition of weekly newsletter (Issue 962)</a> mentions an article by FOSS Force which talks about Alma Linux as the most favored replacement for CentOs.</p>

<h3>The Next most discussed/ talked about alternatives to CentOs <a name="Other-Alternatives"></a></h3>

<p>Based on anecdotal experience and discussion with the LES community, I did  not encounter many users who have taken up any of the other alternatives. This includes Oracle Linux. Granted this is a small subset of the user base, it does give a data point to be considered.  With that in mind, I am listing a few alternatives that I have come across nonetheless.</p>

<h5>Oracle Linux</h5>

<p>Oracle Linux is based on Red Hat Enterprise Linux. Oracle even created a page on its website targeting CentOS users. They have developed a script that can convert existing CentOS installations to Oracle Linux. This distribution is free to use, but support contract is available for a charge.<br />
<img src="https://talk.lowendspirit.com/uploads/editor/hw/5kzdhgcowav7.png" alt="Screenshot of Oracle Linux" /><br /><br />
Source:Wikimedia commons</p>

<p>According to the <a rel="nofollow" href="https://en.wikipedia.org/wiki/Oracle_Linux">Wikipedia page for this distribution</a>,</p>

<blockquote><div>
  <p>Oracle Linux is ..."available partially under the GNU General Public License since late 2006.[4] It is compiled from Red Hat Enterprise Linux (RHEL) source code, replacing Red Hat branding with Oracle's."</p>
</div></blockquote>

<h4>Liberty Linux (project by Suse Linux)</h4>

<p>This is the newest kid on the block, I had posted about it in the LES forum. Too early to discuss or comment, pending further updates, I will <a rel="nofollow" href="https://talk.lowendspirit.com/discussion/3716/liberty-linux-yaca-yet-another-centos-alternative/p1">leave you with the link to the LES discussion</a>.</p>

<h4>Springdale Linux</h4>

<p>This is a project by the  members of the computing staff of Princeton University and the Institute for Advanced Study, this was earlier known as PUIAS Linux. They describe themselves as a "Custom Red Hat based Distribution and Mirror." Among other things they have an Interesting Webpage !!  The design reminds us of the early years of the World Wide Web.</p>

<blockquote><div>
  <p>visit <a rel="nofollow" href="https://springdale.math.ias.edu/timeline">Springdale Linux</a> to learn more.</p>
</div></blockquote>

<h4>ClearOS</h4>

<p>ClearOs offer commercial and community edition, as per the discussion on ClearOS forums, this <a rel="nofollow" href="https://www.clearos.com/clearfoundation/social/community/is-clearos-still-under-active-development">may not be a long term viable alternative </a></p>

<h3>VZLinux</h3>

<p>This is a CentOs based distribution from folks at Virtuozzo. You can download the image files from: <br />
<a href="https://repo.virtuozzo.com/vzlinux/8/iso/" rel="nofollow">https://repo.virtuozzo.com/vzlinux/8/iso/</a></p>

<p>Other than the above, I did not find much written or talked about this alternative to CentOs.</p>

<h4>Fedora Server</h4>

<p>Fedora is primarily a desktop oriented distribution, and a server version of Fedora, while possible and even capable, does not make a lot of sense. Atleast to me. According to one of the posts I came across on the topic,</p>

<blockquote><div>
  <p>Fedora server also follows short lifecycle. It is a community-supported operating system. Paid or commercial support option does not exist, and the lifecycle makes it less appealing as an alternative.</p>
</div></blockquote>

<h3>What about CentOs Stream? <a name="CentOs-Stream"></a></h3>

<p>Would you really consider moving to CentOS Stream for your servers? I have not found a definitive "Heck Yes" or "Hell, No!" answer to this query. Nor have, it appears <a rel="nofollow" href="https://thenewstack.io/centos-9-stream-is-now-available-but-should-you-use-it/">these guys</a>.<br /><br />
<img src="https://talk.lowendspirit.com/uploads/editor/ux/hs77wp8k2myh.png" width="400" alt="CentOS Stream" /><br /><br />
Source: Postgresweb</p>

<h4>Are you perfectly happy with CentOs 7?</h4>

<p>If you are happy with CentOs7, or belong to the <em>if-it-ain't-broke-don't-fix-it</em> school, then you have atleast 30 plus months of updates for CentOs coming from Red Hat. The Frequently Asked Question page on CentOs site <a rel="nofollow" href="https://www.redhat.com/en/blog/faq-centos-stream-updates">confirms the same</a>. In that case, should the <a rel="nofollow" href="https://talk.lowendspirit.com/discussion/3751/call-for-inputs-from-providers-users-centos-alternatives-2022">EOL for CentOs 8creally be a concern for you</a>?</p>

<hr />

<h3>And now, the pièce de résistance: A server Linux distribution from Microsoft</h3>

<p>This one is real guys, and no more a joke in the Linux and open source communities. (Anybody remember Lindows.. er.. <a rel="nofollow" href="https://www.linspirelinux.com/">Linspire</a>?)<br />
edit: The project is still alive! That's cool.</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/b6/b9de0a2lvvus.png" alt="Linspire Desktop" /><br /><br />
Source: Wikipedia</p>

<p>The Linux distribution from Microsoft, called CBL-Mariner, is based off Fedora and Linux From Scratch.  Form the github page for CBL-Mariner, <a href="https://github.com/microsoft/CBL-Mariner" rel="nofollow">https://github.com/microsoft/CBL-Mariner</a></p>

<blockquote><div>
  <p>CBL-Mariner is an internal Linux distribution for Microsoft’s cloud infrastructure and edge products and services. CBL-Mariner is designed to provide a consistent platform for these devices and services and will enhance Microsoft’s ability to stay current on Linux updates. This initiative is part of Microsoft’s increasing investment in a wide range of Linux technologies, such as SONiC, Azure Sphere OS and Windows Subsystem for Linux (WSL). CBL-Mariner is being shared publicly as part of Microsoft’s commitment to Open Source and to contribute back to the Linux community. CBL-Mariner does not change our approach or commitment to any existing third-party Linux distribution offerings.</p>
</div></blockquote>

<h3>Wrapping it up: Nearing the end of the CentOS Era <a name="End-CentOs8-Era"></a></h3>

<p>It is great to see several alternatives for CentOs, which is one of the beauties of the Open Source world. The challenge, as always, is that it presents a problem of plenty. Many folks in the LES Community- web hosts or the advanced users who used CentOs previously, seem to have converged towards Alma Linux or Rocky Linux. Among the rest of the list- Oracle Linux might have some users, given that many members on both the green forums have atleast one instance of <a rel="nofollow" href="https://blogs.oracle.com/cloud-infrastructure/post/oracle-builds-out-their-portfolio-of-oracle-cloud-infrastructure-always-free-services">Oracle Free tier</a>.</p>

<p>I hope that this post has captured the "After the Storm" scenario since CentOS8 reached EOL. Over the long run, I intend it will offer a handy resource for the LES community. In addition to the top two alternatives (Rocky Linux and Alma Linux), there is a long tail of "also consider" alternatives. Which is one of the real beautiful things about the Linux and Open Source world.</p>

<hr />

<h2>Further (Optional) reading: FFs (For Fun's Sake)<a name="Fun-Reading"></a></h2>

<p>While researching for this post, the search results threw some junk posts. I am adding a few of them below to add a flavor of humor. For example, <strong>really useless practices by some of the reviewers and authors</strong>. These included:</p>

<blockquote><div>
  <p>Some reviewers did a desktop review of Alma Linux, as in literally installing graphical interfaces. They spent a lot of time talking about how GNOME performed on this distribution versus KDE. One person even, did a screen capture of games being played on Alma Linux. Not sure if any server admins run GUI or play Steam games on their production servers.</p>
</div></blockquote>

<p><img src="https://www.how2shout.com/linux/wp-content/uploads/2021/03/command-to-install-KDE-plasma-desktop-GUI-AlmaLinux.jpg" alt="How To Shout article showing Alma Linux Desktop" /><br /><br />
Source: HowtoShout</p>

<p>The Techmint guys aren't too far behind : <a href="https://www.tecmint.com/wp-content/uploads/2021/06/AlmaLinux-Desktop.png" rel="nofollow">https://www.tecmint.com/wp-content/uploads/2021/06/AlmaLinux-Desktop.png</a></p>

<p><strong>Windows 10 as an alternative to CentOS? Really??</strong><br />
<a rel="nofollow" href="https://www.g2.com/products/centos/competitors/alternatives">g2 smokes some cheap stuff.</a></p>

<p><strong>The Roll your eyeballs version</strong><br />
Simply copy and paste names of popular Linux distributions, and not really doing any favor to the reader.  <a rel="nofollow" href="https://www.hostingseekers.com/blog/centos-alternatives/">Hostingseekers, you need therapy</a></p>

<hr />

<p><strong>Author's Note</strong>:</p>

<p>I put together this post with the intention of creating a handy resource for readers here on the Low End Spirit blog. I am not a user of CentOS or any of its derivatives. Even though I began my Linux Journey with Red Hat 6 (Zoot), my poison of choice for many years has been Debian. Or, grudgingly, I use Ubuntu LTS where the Software as a Service (SaaS) vendors require me to use it.</p>

<p>This post presented an opportunity first and foremost to understand what is going on in the CentOS world, or the CentOS extended universe. (To borrow a phrase from the Marvel Universe). I have not done any installation or testing of my own for the purposes of this article.My interest was mainly in understanding what has been the market acceptance over the past few months. One hopes that has been served well.</p>

<p>For any questions or comments, write to me at <a rel="nofollow" href="http://" title="contact+les@amarvyas.in">contact+les@amarvyas.in</a></p>
]]>
        </description>
    </item>
    <item>
        <title>Tip: Install OS via netboot.xyz without ISO support</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/2210/tip-install-os-via-netboot-xyz-without-iso-support</link>
        <pubDate>Sat, 05 Dec 2020 19:07:54 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>ehab</dc:creator>
        <guid isPermaLink="false">2210@/index.php?p=/discussions</guid>
        <description><![CDATA[<p>It can happen your vm provider has a broken iso mount or does not support it at all. You can install your OS using netboot.xyz the following way:</p>

<p>1- Have your vm already installed with one of the provided templates e.g: <strong>debian 9</strong>.  ssh into your vm as root install the ipxe package:</p>

<p><code># apt-get install ipxe</code><br />
<code># update-grub</code></p>

<p>Get your ip, gateway from your vm info email, provider cp or on debian this way and store it as it will be needed later.</p>

<p><code># cat /etc/network/interfaces</code><br />
or <br />
<code># ip r</code></p>

<p><code># reboot</code></p>

<p>2-  From your vnc or console, you should be able to see similar grub menu</p>

<p><img src="http://talk.lowendspirit.com/uploads/editor/89/p5ref5ubzzkz.png" alt="" title="" /></p>

<p>after you press enter then quickly keep pressing <strong>CTRL+B</strong>  ,or you can set to boot from CD only in you cp... then you should</p>

<p><img src="http://talk.lowendspirit.com/uploads/editor/gp/yvf6khru9zp1.png" alt="" title="" /></p>

<p>enter your ip info you stored from the above step 1 like show in next image</p>

<p><img src="http://talk.lowendspirit.com/uploads/editor/85/nmyulta4p1o1.png" alt="" title="" /></p>

<p>if your vm supports ipv6 then it may try to configure it so you press enter like shown:</p>

<p><img src="http://talk.lowendspirit.com/uploads/editor/zn/ecukkfl0pmi6.png" alt="" title="" /></p>

<p>let it boot and should be good <img src="https://lowendspirit.com/plugins/emojiextender/emoji/twitter/smile.png" title=":)" alt=":)" height="18" /></p>

<p><img src="http://talk.lowendspirit.com/uploads/editor/ey/cms1cy48k78r.png" alt="" title="" /></p>

<p>I wrote this article when i got a HH vm and uploading iso is broken at time of this article.</p>

<p><strong>References :</strong><br />
1- <a href="https://unix.stackexchange.com/questions/190865/is-it-possible-to-add-some-pxe-network-boot-option-to-grub" rel="nofollow">https://unix.stackexchange.com/questions/190865/is-it-possible-to-add-some-pxe-network-boot-option-to-grub</a><br />
2- <a href="http://www.panticz.de/Install-GRUB-iPXE-netboot" rel="nofollow">http://www.panticz.de/Install-GRUB-iPXE-netboot</a></p>
]]>
        </description>
    </item>
    <item>
        <title>Alpine Linux - Install wireguard-go for OpenVZ 7 and wireguard on a KVM - IPv4 only</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/4753/alpine-linux-install-wireguard-go-for-openvz-7-and-wireguard-on-a-kvm-ipv4-only</link>
        <pubDate>Mon, 24 Oct 2022 02:34:28 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>ehab</dc:creator>
        <guid isPermaLink="false">4753@/index.php?p=/discussions</guid>
        <description><![CDATA[<h1>Alpine Linux - Install wireguard-go for OpenVZ 7 and wireguard on a KVM - IPv4 only</h1>

<p>There are couple of providers offerings NAT vps such as <a rel="nofollow" href="https://clients.inceptionhosting.com/cart.php?gid=13" title="inceptionhosting">inceptionhosting</a> , <a rel="nofollow" href="https://clients.mrvm.net/cart.php?gid=11" title="mrvm">mrvm</a> and <a rel="nofollow" href="https://my.webhorizon.in/order/main/index/nat" title="webhorizon">webhorizon</a> .</p>

<p>Thanks to <strong>webhorizon</strong> for sponsoring this guide and offered to bump my ram.</p>

<p>NAT VPSs are affordable and useful for practical small apps.  In this guide we will setup a docker swarm cluster with a mix of single KVM manager and couple of OpenVZ7 NATs workers. For high availability it is recommend to have an odd number &lt; 5 managers.</p>

<p><strong>Minimum requirements</strong>: <br />
- 1 KVM and 1 NAT nodes with at least 512MB Ram and a minimum of 5GB disk<br />
- using <strong>IPv4</strong> on all nodes.<br />
- The host OS is Alpine Linux version 3.15 which is latest at time of writing this guide. Webhorizon already provides alpine as an os template on their NAT range.</p>

<hr />

<h2><strong>Section 1</strong>: ( Host setup and applications install )</h2>

<p><strong>Host kernel settings</strong>:<br />
- All hosts should have those kernel settings on ; For NATs if not enabled then open a ticket and nicely ask.</p>

<blockquote><div>
<pre><code># cat /proc/sys/net/ipv4/ip_forward
1
# cat /proc/sys/net/bridge/bridge-nf-call-iptables
1
</code></pre>
</div></blockquote>

<p>for KVM you can add that by</p>

<blockquote><div>
<pre><code>cat &gt; /etc/sysctl.d/01-configs.conf &lt;&lt;EOF
# alpine
net.ipv4.ip_forward=1
net.bridge.bridge-nf-call-iptables=1
EOF
</code></pre>
</div></blockquote>

<p>If your NAT provider does not include Alpine Linux template then one can install it using this <a rel="nofollow" href="https://gist.github.com/pexcn/dc3ebe60393cc4ede40b30e180d40ac5" title="script">script</a> and my slightly modified version <a rel="nofollow" href="https://gist.github.com/ehab2012/304e11cccd1683099d899e28ab6c4941" title="script">script</a>.</p>

<p>On your NAT vps cp make sure you enabled</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/3h/v7chcqtn1em0.png" alt="" title="" /></p>

<p><strong>OpenVZ7 Install wireguard-go</strong></p>

<blockquote><div>
<pre><code># apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing wireguard-go
# apk add wireguard-tools
</code></pre>
</div></blockquote>

<p>while the above is a testing repo so far it has been stable. You can always compile your own version.</p>

<p><strong>KVM Install wireguard</strong></p>

<blockquote><div>
<pre><code># apk add wireguard-tools
</code></pre>
</div></blockquote>

<p><strong>Install and enable Docker</strong></p>

<blockquote><div>
<pre><code># apk add docker
# service enable docker
</code></pre>
</div></blockquote>

<hr />

<h2><strong>Section 2</strong>: Nodes details</h2>

<ol>
<li><p>Server "kvm"</p>

<ul>
<li>Main Interface IP       = 185.253.47.54</li>
<li>Wireguard Private IP = 192.168.1.2</li>
</ul></li>
<li><p>Client "OpenVZ NAT"</p>

<ul>
<li>Main Interface IP = 10.37.136.225</li>
<li>Wireguard Private IP = 192.168.1.10</li>
</ul></li>
</ol>

<hr />

<h2><strong>Section 3</strong>: ( Generate keys and Conf file )</h2>

<p>Wireguard requires key generation and setting up the network interface in a certain way. There are scripts and quick command lines to accomplish this task. The next details describe the manual method. Take a note of the cat outputs tp add in wg0.conf file.</p>

<p>generate keys those way on both nodes</p>

<blockquote><div>
<pre><code># wg genkey | tee privatekey | wg pubkey &gt; publickey
# cat publickey
     OaJ6KDPdgOs+aOJh7oEnaQYs/w9aIuHd0LfFgyx3ORw=
# cat privatekey
     WH8fN46zIMIXCxt2m5+I75vI+31oehh6aHte3qYYIys=
# # presharedkey is only needed for client node
#  wg genpsk &gt; presharedkey
     Gg9HaCMkeEzUNl5zz9fUEzaDKIO2MNUKeG3D+ihchS8=
</code></pre>
</div></blockquote>

<p>Server side config</p>

<blockquote><div>
<pre><code># mkdir -p /etc/wireguard
# nano /etc/wireguard/wg0.conf
     [Interface]
     ListenPort = 51820
     PrivateKey = WH8fN46zIMIXCxt2m5+I75vI+31oehh6aHte3qYYIys=
     
     [Peer]
     PublicKey = OaJ6KDPdgOs+aOJh7oEnaQYs/w9aIuHd0LfFgyx3ORw=
     PresharedKey = Gg9HaCMkeEzUNl5zz9fUEzaDKIO2MNUKeG3D+ihchS8=
     AllowedIPs = 192.168.1.10/32
</code></pre>
</div></blockquote>

<p>Client side config ; change port number to one in the range given to you, in my example ist 22520</p>

<blockquote><div>
<pre><code># nano /etc/wireguard/wg0.conf
     [Interface]
     ListenPort = 22520
     PrivateKey = +KoN0pd30I6WERz2s9itHlIoikZBh1q2cbhB88UsnlI=
     
    [Peer]
    PublicKey = OaJ6KDPdgOs+aOJh7oEnaQYs/w9aIuHd0LfFgyx3ORw=
    PresharedKey = Gg9HaCMkeEzUNl5zz9fUEzaDKIO2MNUKeG3D+ihchS8=
    AllowedIPs = 0.0.0.0/0
    Endpoint = 185.253.47.54:51820
    PersistentKeepalive = 25
</code></pre>
</div></blockquote>

<hr />

<h2><strong>Section 4</strong>: (  Update network configuration )</h2>

<p>Server side interface file</p>

<blockquote><div>
<pre><code># nano /etc/network/interfaces
    ...
    auto wg0
    iface wg0 inet static
            address 192.168.1.2/24
            netmask 255.255.255.0
            pre-up ip link add dev wg0 type wireguard
            pre-up wg setconf wg0 /etc/wireguard/wg0.conf
            post-up ip route add 192.168.1.0/24 dev wg0; /sbin/iptables -A FORWARD -i wg0 -j ACCEPT;/sbin/iptables -A FORWARD -o wg0 -j ACCEPT;/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
            post-down ip link delete dev wg0
            post-down  /sbin/iptables -D FORWARD -i wg0 -j ACCEPT;/sbin/iptables -D FORWARD -o wg0 -j ACCEPT;/sbin/iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
</code></pre>
</div></blockquote>

<p>Client side interface file</p>

<blockquote><div>
<pre><code># nano /etc/network/interfaces
    ...
    auto wg0
    iface wg0 inet static
        address 192.168.1.10/24
        pre-up /usr/bin/wireguard-go wg0
        post-up /usr/bin/wg setconf wg0 /etc/wireguard/wg0.conf
        post-up /sbin/ip route add 192.168.1.0/24 dev wg0;
        post-down /sbin/ip link del wg0
        post-down rm -f /var/run/wireguard/wg0.sock
</code></pre>
</div></blockquote>

<hr />

<h2><strong>Section 5</strong>: (  Reboot and Test )</h2>

<p>Do a reboot and start testing the connection for both server and client, yours will be different when changing the ips, ports and keys etc...</p>

<blockquote><div>
<pre><code># ip a
</code></pre>
</div></blockquote>

<p><img src="https://lowendspirit.com/uploads/editor/5h/7wjq8g5gtdjf.png" alt="" title="" /><br />
<img src="https://lowendspirit.com/uploads/editor/bg/k6gq10x36114.png" alt="" title="" /></p>

<blockquote><div>
<pre><code># wg show
</code></pre>
</div></blockquote>

<p><img src="https://lowendspirit.com/uploads/editor/si/9y919si9piab.png" alt="" title="" /><br />
<img src="https://lowendspirit.com/uploads/editor/h0/kiw92vkfy2b8.png" alt="" title="" /></p>

<p><img src="https://lowendspirit.com/uploads/editor/0e/urntemz808vt.png" alt="" title="" /><br />
<img src="https://lowendspirit.com/uploads/editor/h0/0m7418f4fgc3.png" alt="" title="" /></p>

<p>above test show connection is made and our wireguard nodes are reachable.</p>
]]>
        </description>
    </item>
    <item>
        <title>Migrate a KVM VPS from one host to another – Easy Mode.</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/3840/migrate-a-kvm-vps-from-one-host-to-another-easy-mode</link>
        <pubDate>Wed, 27 May 2020 12:00:00 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>LES_Blog</dc:creator>
        <guid isPermaLink="false">3840@/index.php?p=/discussions</guid>
        <description><![CDATA[<p><em>Written by Anthony Smith, 27 May 2020</em><br />
<small>Article was migrated from WordPress to Vanilla in March 2022</small></p>

<p>
  <img src="https://talk.lowendspirit.com/uploads/editor/d7/jyyx3ynmtdki.png" alt="image" />
</p>

<p>This is the first in a series of posts in the "Easy Mode" series</p>

<p>I thought I would write this up as a super easy basic guide to an almost no-effort method of migrating a KVM VPS from one host to another without having to worry about any minor changes in software stacks that could cause your backup and restore to fail or not restore as expected.</p>

<p>As a host one of the unfortunate realities is that sometimes it is just necessary to have migrations either due to end of life of an OS major version or impending hardware failure etc and on the rare occasion you need people to migrate their own server, this usually results in a 10% panic rate and a desperate cry for help.</p>

<p>With all that in mind I thought I would illustrate possibly one of the most simple server migration methods possible, I have done this based on KVM to KVM as that is likely to be the most common method however this method should also work for Xen HVM to Xen HVM or KVM to Xen HVM or Xen HVM to KVM and finally VMware to VMware should also work fine.</p>

<p>I can't cover the huge amount of different control panels and access methods out there but all that I have used either have access to an ISO mount or a rescue mode so it should be easy for you to use this guide as long as your host's control panel provides at least an ISO mount option or a rescue mode.</p>

<p>In this example, I have used a KVM VPS on a host that uses SolusVM and migrated it to a host that uses Virtualizor.</p>

<p>Requirements and additional info before we get started.</p>

<ul>
<li>The <strong>destination</strong> VPS should have the same size hard disk (bigger is fine).</li>
<li>This will only go as fast as the link between the 2 locations, latency is a huge factor, moving a 50GB Disk image from India to New York is no fun.</li>
<li>Some attention to detail is required, it is possible to lose your data if you mess up the commands.</li>
<li>If the destination control panel does not provide a 'reconfigure networking' button or a serial console/VNC option you can use to reconfigure networking yourself you may want to consider configuring but not activating the network settings for the destination VPS on the source prior to shutdown, SolusVM, however, will do this for you and in some cases depending on the Hosts configuration options in Virtualizor it will also.</li>
<li>Source VPS, in this case, was at Inception Hosting - London, the destination VPS was with Nexus Bytes - New York</li>
</ul>

<hr />

<p>First of all, I created a quick KVM VPS as the source on the SolusVM based host, installed apache2 and slightly modified the test page which you can see loading on the source IP:</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/2l/zniyu73dxmiz.png" alt="" title="" /></p>

<p>Then I shut down the Source VPS and put both the source and destination VPS into rescue mode.</p>

<p>For SolusVM (Source):</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/k3/8croozaarz9i.png" alt="" title="" /></p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/hy/862j55bwxlgd.png" alt="" title="" /></p>

<p>For Virtualizor (Destination):</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/n9/xz54kkp15j1d.png" alt="" title="" /></p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/xm/g9js7othui9n.png" alt="" title="" /></p>

<p><em>note: I noticed virtualizer has a tendency to just lock out all options even those for coming out of rescue mode when you do this which is resolved by simply refreshing the page, don't worry it does not resubmit the action</em></p>

<p>Now you should have both the source and destination in rescue mode and you should be able to login to both over ssh:</p>

<p>SolusVM VPS (Source)</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/51/woe0o6h22h5n.png" alt="" title="" /></p>

<p>Virtualizor VPS (Destination)</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/7j/wvotolqgra4z.png" alt="" title="" /></p>

<p>Next, you need to examine your disks to make sure you get the right one, the rescue modes will create a ramdisk so what was vda or sda on your VPS when it was running may not be now, this is the part you need to be sure you get correct, I have shown a side by side below using <code>fdisk -l</code> to check which disk I want to migrate to which disk on the other end.</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/hf/iwojrxcezml7.png" alt="" title="" /></p>

<p>From the image above we can see that the 5GiB disk is the one I want <code>/dev/vda</code> because I know my source disk is 5GiB and on the destination side I can see that it is actually <code>/dev/vdb</code> I want to copy the disk to, the 10 GiB disk. It is <strong>very</strong> important that you check this before going any further as it could well be different.</p>

<p>Because we now know I want to copy <code>vda</code> on the source to <code>vdb</code> on the destination we can structure the command to do this.</p>

<pre><code>dd if=/dev/vda bs=32M status=progress | ssh root@45.61.123.123 "dd of=/dev/vdb"
</code></pre>

<p>let us break this down so it is better understood as there is nothing worse than knowing which buttons to press to achieve a goal, but having no idea why they work, or what they actually do:</p>

<ul>
<li>dd - Short for "data duplicator" a common commend used for copying or duplicating data.</li>
<li>if=/dev/vda - The input or what we are reading, in this case, the entire virtual hard disk image</li>
<li>bs=32M - BYTES, the number of BYTES to read per block when copying, you can set this yourself, I have found 32M is a good average.</li>
<li>status=progress - This shows the progress of the copy, it has a very small overhead but without it you get nothing in terms of a progress indicator</li>
<li>| - The pipe, in very simple terms, lets you pass the result of one command or set of commands to the next</li>
<li>ssh root@45.61.123.123 - Because this is after the pipe | it takes what was done before and sends it over an ssh session as root to the destination IP 45.61.123.123 (fake)</li>
<li>"dd of=/dev/vdb" - Finally the instruction on what to do at the other side which is to use dd "data duplicator" to write the blocks it is receiving over ssh to <code>/dev/vdb</code></li>
</ul>

<p>Once that command is issued you will see something like this:</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/p7/7n4y6jib6bcv.png" alt="" title="" /></p>

<p>And when it completes you will see:</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/9h/s05ejnapmj0e.png" alt="" title="" /></p>

<p>As we can see that took 634 seconds or a little over 10 minutes to complete and now the disk image on the destination should be identical to the source.</p>

<p>The next step is to cancel rescue mode on the destination via the control panel and then boot the destination VPS, going to the new IP address once it is finished booting shows that it was a success as the same page loads on the new IP:</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/lc/uetq2jiio6f9.png" alt="" title="" /></p>

<p>If your destination VPS has a bigger disk size than the source you will not instantly gain the extra space by following the above process, you will need to either expand your partitions or extend your logical volume if using LVM, that however is beyond the scope of this particular tutorial but if you are also looking for easy mode for that then just boot the VPS with a GParted ISO or a rescue cd that contains GParted which will give you a simple UI to expand your partitions or look up vgextend and lvextend if using LVM.</p>

<p>If having read this you discover that your host does not have a built-in rescue mode then I would suggest requesting they supply a SystemRescueCd ISO (Also contains GParted) <a rel="nofollow" href="https://www.system-rescue-cd.org/">https://www.system-rescue-cd.org/</a> so you can mount it and boot into rescue mode.</p>
]]>
        </description>
    </item>
    <item>
        <title>How to Create and Setup a Debian KVM VPS with Proxmox VE 6 -- Part III -- Network Configuration</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/3933/how-to-create-and-setup-a-debian-kvm-vps-with-proxmox-ve-6-part-iii-network-configuration</link>
        <pubDate>Fri, 23 Jul 2021 12:00:00 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>Not_Oles</dc:creator>
        <guid isPermaLink="false">3933@/index.php?p=/discussions</guid>
        <description><![CDATA[<p><em>Written by <a href="https://lowendspirit.com/index.php?p=/profile/Not_Oles" rel="nofollow">@Not_Oles</a>, 23 Jul 2021</em><br />
<small>Article was migrated from WordPress to Vanilla in March 2022</small></p>

<p>
  <img src="https://talk.lowendspirit.com/uploads/editor/n9/cixat1djj0ag.png" alt="image" />
</p>

<h2>I. Before We Start</h2>

<p>We need to obtain our basic network configuration from our provider. Or, if we are running our own host node, we need to assign basic network configuration to ourselves. Our basic network configuration might look something like this:</p>

<table>
<thead>
<tr>
  <th><strong>Item</strong></th>
  <th><strong>Value</strong></th>
</tr>
</thead>
<tbody>
<tr>
  <td>IPv4 address</td>
  <td>172.16.165.97/28</td>
</tr>
<tr>
  <td>Netmask</td>
  <td>255.255.255.240</td>
</tr>
<tr>
  <td>Broadcast</td>
  <td>172.16.165.111</td>
</tr>
<tr>
  <td>Gateway</td>
  <td>172.16.164.1</td>
</tr>
</tbody>
</table>

<p>For IPv6, one might expect something like:</p>

<table>
<thead>
<tr>
  <th><strong>Item</strong></th>
  <th><strong>Value</strong></th>
</tr>
</thead>
<tbody>
<tr>
  <td>IPv6 address</td>
  <td>fe80::/64</td>
</tr>
</tbody>
</table>

<p>But occasionally, IPv6 could be something like:</p>

<table>
<thead>
<tr>
  <th><strong>Item</strong></th>
  <th><strong>Value</strong></th>
</tr>
</thead>
<tbody>
<tr>
  <td>IPv6 address</td>
  <td>fe80:xxxx:xxxx:xxxx::97/128</td>
</tr>
<tr>
  <td>Gateway6</td>
  <td>fe80:xxxx:xxxx:xxxx::3</td>
</tr>
</tbody>
</table>

<p>Notes:</p>

<ul>
<li>The /28 in the IPv4 address and the longer netmask are <a rel="nofollow" href="https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#:~:text=CIDR%20notation%20is%20a%20compact,bits%20in%20the%20network%20mask.">different ways of providing the same information about the size of the local, directly connected network.</a> It suffices for us to have this information in one format or the other. We don't need both formats because the information is the same. Also, the broadcast IP might not be provided, since it isn't strictly necessary.</li>
<li>For the second format of the IPv6 address, <strong>what happened to the /64</strong>? 😱 The /128 in the second form of the IPv6 address might seem <strong><em>clueless</em></strong> to IPv6 fans expecting a /64. Also, the second format of the IPv6 address includes a gateway6 address. The gateway6 address might seem strange to some IPv6 fans, but we need the gateway6 for our minimal, static configuration. More on all this below.</li>
</ul>

<h2>II. Introduction</h2>

<p>In <a rel="nofollow" href="https://lowendspirit.com/how-to-create-and-setup-a-debian-kvm-vps-with-proxmox-ve-6-part-ii-debian-install/">the previous post of this series</a> we finished using the Proxmox web GUI to install our new Debian KVM VPS via the <a rel="nofollow" href="https://www.debian.org/CD/netinst/">Debian netinst installer iso image.</a> The final step in Part II was removing the netinst install iso image from the emulated cdrom and then reooting our new VM, which came up from its own internal filesystem:</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/hs/2qx8afaew937.png" alt="" title="" /></p>

<p>In today's post, we continue from this exact place where we left Part II -- connected to our newly installed and newly rebooted KVM via the Proxmox web GUI. In this post, we will accomplish the networking configuration which was skipped in Part II because the <a rel="nofollow" href="https://talk.lowendspirit.com/discussion/comment/63101/#Comment_63101">Debian netinst iso doesn't automatically configure out of band IP addresses.</a></p>

<p>There are three network configuration and related tasks we will accomplish today:</p>

<ul>
<li>First, we go "inside" our VM through the Proxmox web GUI's emulated "physical" console connection and set up networking. In Debian, networking setup requires that we adjust the file /etc/network/interfaces to tell our VM its network address and the address of its gateway to the internet.</li>
<li>Second, we edit the file /etc/resolv.conf to tell our VM the numerical addresses of <a rel="nofollow" href="https://en.wikipedia.org/wiki/Domain_Name_System">Domain Name System ("DNS")</a> servers it can use to translate human readable <a rel="nofollow" href="https://en.wikipedia.org/wiki/Uniform_Resource_Identifier">Uniform Resource Identifiers (URI)</a> into numerical <a rel="nofollow" href="https://en.wikipedia.org/wiki/IP_address">Internet Protocaol ("IP") addresses.</a></li>
<li>Third, we set up /etc/apt/sources.list to tell our system's <a rel="nofollow" href="https://www.debian.org/doc/manuals/debian-faq/uptodate.en.html">Aptitude software package manager ("APT")</a> where to get software updates and the additional software packages we will want to install.</li>
</ul>

<p>Section III, Quick Setup, runs quickly through all three of today's tasks in "recipe style."</p>

<p>Section IV offers additional context on our setup environment.</p>

<p>Sections V, VI, and VII provide additional details on today's three setup tasks.</p>

<p>Section VIII discusses security.</p>

<p>Section IX discusses backup.</p>

<p>When we finish the Quick Setup, our new Debian KVM VPS should be connected to the internet, DNS should work, and we should be able to use the Debian package system to add whatever additional software we want.</p>

<p>When we finish all of today's post, we should have reasonable context within which to understand our Debian VM's networking setup.</p>

<h2>III. Quick Setup</h2>

<p>Logged into our VM through the Proxmox web GUI, we run the command <code>ip link show</code>. This command will give us the name of our network interface, probably something like "ens18."</p>

<p>As root or with <code>sudo</code>, we edit the text of the file /etc/network/interfaces so that it contains the minimum necessary information:</p>

<pre><code>auto ens18
iface ens18 inet static
  address IPv4_ADDRESS/CIDR
  gateway GATEWAY_ADDRESS

iface ens18 inet6 static
  address IPv6_ADDRESS/CIDR
  gateway GATEWAY6_ADDRESS
</code></pre>

<p>Using our example network configuration, our minimal /etc/network/interfaces looks like this:</p>

<pre><code>auto ens18
iface ens18 inet static
  address 172.16.165.97/28
  gateway 172.16.164.1

iface ens18 inet6 static
  address fe80:xxxx:xxxx:xxxx::97/128
  gateway fe80:xxxx:xxxx:xxxx::3
</code></pre>

<p>Second, we edit the /etc/resolv.conf file so that it looks like this:</p>

<pre><code>nameserver 1.1.1.1
nameserver 8.8.8.8
nameserver 2606:4700:4700::1111
nameserver 2001:4860:4860::8888
</code></pre>

<p>Third, we edit /etc/apt/sources.list so that it looks like this:</p>

<pre><code>deb http://deb.debian.org/debian buster main contrib non-free

deb http://deb.debian.org/debian-security/ buster/updates main contrib non-free

deb http://deb.debian.org/debian buster-updates main contrib non-free
</code></pre>

<p>Finally, we restart networking so that our new configuration takes effect:</p>

<pre><code>systemctl restart networking
</code></pre>

<p>At this point, we should have both IPv4 and IPv6 connectivity, and DNS and APT both should work.</p>

<h2>IV. More Context</h2>

<ul>
<li><strong>Virtualized Console Connection</strong></li>
</ul>

<p>The Proxmox web GUI virtualizes a wired console connection. In other words, our web browser does connect over the internet to our Proxmox server, but, the view from inside our new KVM is the same as though a wired connection was attached. Our new KVM thinks it's talking over a wired connection to a physical console. From inside our new KVM, there is, as yet, no network connection.</p>

<p>By default, the Proxmox web GUI works via <a rel="nofollow" href="https://en.wikipedia.org/wiki/Virtual_Network_Computing">VNC.</a> <a rel="nofollow" href="https://pve.proxmox.com/wiki/Serial_Terminal">In the Proxmox wiki on serial terminal</a> Proxmox warns that VNC might</p>

<blockquote><div>
  <p>not have the features you need (i.e. easy copy/paste between other terminals)</p>
</div></blockquote>

<p>or it might be</p>

<blockquote><div>
  <p>impossible to capture all &#91;kernel messages, standard output, or error&#93; messages on &#91;the&#93; VNC screen.</p>
</div></blockquote>

<p>Yep, copy / paste commands <a rel="nofollow" href="https://forum.proxmox.com/threads/copy-paste-keys-commands-for-ct-kvm-vnc-console.28037/">do not seem to work in the Proxmox KVM virtual console.</a></p>

<p>Also, if you enjoy using the vi editor, you might find what looks like a "Send-Esc" button among the set of choices within the set exposed by the top button on the console VNC control bar. Use of the real keyboard Escape key results in exiting full screen. However, a second real Esc seems to produce the expected mode change, despite that maybe we no longer can see too well without returning to full screen.</p>

<ul>
<li><strong>No DHCP, No SLAAC</strong></li>
</ul>

<p>These days most network setups use <a rel="nofollow" href="https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol">Dynamic Host Configuration Protocol (DHCP)</a> to autoconfigure IPv4 networking. The machine on which networking is to be configured asks for and receives from a DHCP server all the needed information for the networking setup.</p>

<p>It is possible to configure DHCP so that it always returns the same IP address to each VM, but, since our entire Proxmox network is static, it may be simpler to set up networking manually--the traditional way for servers.</p>

<p><a rel="nofollow" href="https://en.wikipedia.org/wiki/IPv6#Stateless_address_autoconfiguration_(SLAAC)">Stateless Address Autoconfiguration ("SLAAC")</a> provides automatic configuration of IPv6 addresses. SLAAC requires a /64, which is why people say, for IPv6, that a /64 is expected and that less than a /64 is <em>clueless.</em> However, it remains possible to hand configure a single static IPv6 address, as we are doing here.</p>

<p>What if, for whatever reason, we simply do not want to use SLAAC? What if our provider doesn't receive enough IPv6 addresses from <em>his</em> provider to allow passing on to each VPS its own /64? What if our provider's provider charges an extra fee for extra IPv6 addresses, but we do not want to pay our provider's pass through of his provider's extra fee? What if we simply choose to use single, static IPs as is traditional for servers?</p>

<ul>
<li><strong>No Cloud-Init</strong></li>
</ul>

<p>As mentioned in <a rel="nofollow" href="https://lowendspirit.com/how-to-create-and-setup-a-debian-kvm-vps-with-proxmox-ve-6-part-ii-debian-install/">the previous post of this series,</a> most VM network setups these days are done with <a rel="nofollow" href="https://github.com/canonical/cloud-init">Cloud-Init.</a> Proxmox <a rel="nofollow" href="https://pve.proxmox.com/wiki/Cloud-Init_Support">supports Cloud-Init,</a> which enables both networking and ssh access to virtual machines to be set up on the Proxmox hypervisor and outside of the VM. Cloud-init can use DHCP. Here, however, we have chosen the simplest possible manual configuration with static IPs.</p>

<ul>
<li><strong>Our Static, Routed Configuration And Out of Band Gateway From Our Provider's Provider</strong></li>
</ul>

<p>Here, our single, static IPv4 and single, static IPv6 are each derived from a <a rel="nofollow" href="https://en.wikipedia.org/wiki/Routing">routed subnet</a> assigned to our server node. However, our internet gateway IPv4 address is not included among our server's routed group of IPv4s. This is called an "out of band" gateway.</p>

<p>Besides routed subnets, it also is possible for a datacenter to assign to servers non-routed, individual IP addresses. Data for these non-routed IPs moves between the datacenter switch and server nodes via <a rel="nofollow" href="https://en.wikipedia.org/wiki/Network_layer">the "link layer."</a> Hetzner has a <a rel="nofollow" href="https://docs.hetzner.com/robot/dedicated-server/network/net-config-debian/">tutorial on Debian network configuration</a> which includes discussion of "bridged configuration" for non-routed IPs.</p>

<ul>
<li><strong>Systemd in Debian Networking</strong></li>
</ul>

<p><a rel="nofollow" href="https://lwn.net/Articles/585319/">Since about 2014,</a> networking is setup on Debian with <a rel="nofollow" href="https://en.wikipedia.org/wiki/Systemd">systemd.</a> The choice of systemd <a rel="nofollow" href="https://lwn.net/Articles/585363/">initially was</a> and <a rel="nofollow" href="https://www.howtogeek.com/675569/why-linuxs-systemd-is-still-divisive-after-all-these-years/">has continued to be divisive.</a> Nevertheless systemd has remained as the Debian default.</p>

<p>There are at least two basic variations of Debian's systemd network arrangement. The first--which seems to be the default variation for Debian systemd network configuration--at least with the netinst iso--is using systemd's networking.service. For example, by using <code>systemctl</code>, we can confirm that networking.service is what is being used on our Node:</p>

<pre><code>root@Proxmox-VE ~ # systemctl status networking.service
● networking.service - Raise network interfaces
   Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: 
   Active: active (exited) since Wed 2021-06-02 19:13:13 UTC; 1 weeks 2 days ago
     Docs: man:interfaces(5)
 Main PID: 791 (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 4915)
   Memory: 0B
   CGroup: /system.slice/networking.service

 [ . . . ]
root@Proxmox-VE ~ # 
</code></pre>

<p>Our test KVM also seems to think its networking is controlled by systemd:</p>

<pre><code>root@debian-kvm:~# systemctl status networking
● networking.service - Raise network interfaces
   Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
   Active: active (exited) since Wed 2021-06-16 01:20:45 UTC; 4min 51s ago
     Docs: man:interfaces(5)
  Process: 448 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=0/SUCCESS)
 Main PID: 448 (code=exited, status=0/SUCCESS)

Jun 16 01:20:45 debian-kvm systemd[1]: Starting Raise network interfaces...
Jun 16 01:20:45 debian-kvm systemd[1]: Started Raise network interfaces.
root@debian-kvm:~#
</code></pre>

<p>As we can see, systemd networking.service calls the traditional debian <code>ifup</code> and <code>ifdown</code>.</p>

<pre><code>root@debian-kvm:~# cat /lib/systemd/system/networking.service
[Unit]
Description=Raise network interfaces
Documentation=man:interfaces(5)
DefaultDependencies=no
Requires=ifupdown-pre.service
Wants=network.target
After=local-fs.target network-pre.target apparmor.service systemd-sysctl.service systemd-modules-load.service ifupdown-pre.service
Before=network.target shutdown.target network-online.target
Conflicts=shutdown.target

[Install]
WantedBy=multi-user.target
WantedBy=network-online.target

[Service]
Type=oneshot
EnvironmentFile=-/etc/default/networking
ExecStart=/sbin/ifup -a --read-environment
ExecStop=/sbin/ifdown -a --read-environment --exclude=lo
RemainAfterExit=true
TimeoutStartSec=5min
root@debian-kvm:~# 
</code></pre>

<p>The second Debian systemd possibility--not the default on Debian netinst.iso and not used here--is systemd-networkd. Sahitya Maruvada has a simple, clear, Debian systemd-networkd introduction, <a rel="nofollow" href="https://medium.com/100-days-of-linux/working-with-systemd-networkd-e461cfe80e6d">Working with systemd-networkd.</a> The <a rel="nofollow" href="https://wiki.debian.org/SystemdNetworkd">systemd-networkd wiki page</a> and the <a rel="nofollow" href="https://manpages.debian.org/buster/systemd/systemd.network.5.en.html">systemd.network manpage</a> also are available.</p>

<ul>
<li><strong>Official Debian Network Setup Instructions</strong></li>
</ul>

<p>Official Debian network setup instructions include the <a rel="nofollow" href="https://wiki.debian.org/NetworkConfiguration">Wiki,</a> the <a rel="nofollow" href="https://www.debian.org/doc/manuals/debian-reference/ch05.en.html">Handbook,</a> manual pages such as <code>man interfaces</code>, /etc/network/interfaces examples <a rel="nofollow" href="https://salsa.debian.org/debian/ifupdown/-/blob/master/examples/network-interfaces">online,</a> and sometimes locally:</p>

<pre><code># less /usr/share/doc/ifupdown/examples/network-interfaces
</code></pre>

<ul>
<li><strong>The <code>ip</code> Command Usually Is Available Even Though Networking Setup Varies Among Linux Distributions</strong></li>
</ul>

<p>Setting up networking, DNS name resolution, and software package management is very different in different Linux distributions. Therefore, we should not assume that the steps taken below would be exactly the same with a different Linux distribution than Debian.</p>

<p>Nevertheless, despite the different distributions' differing network setup systems, the <code>ip</code> command, <a rel="nofollow" href="https://en.wikipedia.org/wiki/Iproute2">supplied by the iproute2 collection,</a> usually is available these days. Please see also Red Hat's <a rel="nofollow" href="https://access.redhat.com/sites/default/files/attachments/rh_ip_command_cheatsheet_1214_jcs_print.pdf">IP Command Cheat Sheet</a></p>

<p>Because the <code>ip</code> command often is available, networking can be configured in many distributions, including Debian, by running a sequence of <code>ip</code> commands. The net effect <img src="https://lowendspirit.com/plugins/emojiextender/emoji/twitter/smile.png" title=":)" alt=":)" height="18" /> of the sequence of <code>ip</code> commands can be to get the network functioning on most distributions without touching that individual distribution's network setup scheme.</p>

<p>Here's <a rel="nofollow" href="https://talk.lowendspirit.com/discussion/comment/63067/#Comment_63067">an example</a> of the <code>ip</code> command used in the context of an <a rel="nofollow" href="https://en.wikipedia.org/wiki/IPXE">iPXE boot.</a> Note that the first command in the linked example requires knowledge of the name of the interface. We can list the names of the interfaces on our system by running the <code>ip link show</code> command.</p>

<p>One issue with using a sequence of <code>ip</code> commands is that the network setup fails to persist across reboots. However, we can place the <code>ip</code> command sequence inside a script which will be run automagically every time the server reboots. The sequence of <code>ip</code> commands in a script reminds us of the days before systemd, when scripts controlled all parts of the boot process including network setup.</p>

<p>Our KVM VPS's internal network configuration that we will be using below is similar to <a rel="nofollow" href="https://lowendspirit.com/creating-our-first-lxc-vps-with-proxmox-ve-6-2-at-soyoustart/">how LXC containers are configured in Proxmox.</a> As will be seen below, Proxmox's LXC containers' network configuration adopts a variant of the "scripted <code>ip</code> command" approach, which also works inside Proxmox's KVM VPSes.</p>

<h2>V. Our VM's Network Setup</h2>

<ul>
<li><strong>Interfaces</strong></li>
</ul>

<p>Our original /etc/network/interfaces file, the one installed by the netinst.iso, might look like this:</p>

<pre><code>debian@debian-kvm:~$ cd /etc/network
debian@debian-kvm:/etc/network$ cat interfaces.original
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback
debian@debian-kvm:/etc/network$ 
</code></pre>

<p>Note that, in the default from the netinst.iso, /etc/network/interfaces.d is empty, so sourcing its files does nothing to the configuration.</p>

<pre><code>debian@debian-kvm:/etc/network$ ls interfaces.d
debian@debian-kvm:/etc/network$ 
</code></pre>

<p>Now, let's edit /etc/network/interfaces to match our example network information from the above Before We Start section.</p>

<pre><code>debian@debian-kvm:/etc/network$ cat interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

auto ens18
iface ens18 inet static
  address 172.16.165.97/28
  gateway 172.16.164.1

iface ens18 inet6 static
  address fe80:xxxx:xxxx:xxxx::97/128
  gateway fe80:xxxx:xxxx:xxxx::3

debian@debian-kvm:/etc/network$ 
</code></pre>

<p>The minimum required information does not include comments (lines beginning with <code>#</code>). Maybe we can make the rash and short-sighted assumption that we are not going to install anything which will want a file included from interfaces.d. The loopback interface might no longer be required <a rel="nofollow" href="https://salsa.debian.org/debian/ifupdown/-/blob/master/examples/network-interfaces">(please see lines 17 and 18 in this file from Debian sources).</a> Thus, for our example setup, the minimum /etc/network/interfaces might be:</p>

<pre><code>debian@debian-kvm:/etc/network$ cat interfaces

auto ens18
iface ens18 inet static
  address 172.16.165.97/28
  gateway 172.16.164.1

iface ens18 inet6 static
  address fe80:xxxx:xxxx:xxxx::97/128
  gateway fe80:xxxx:xxxx:xxxx::3

debian@debian-kvm:/etc/network$ 
</code></pre>

<p>When configuring Debian LXC containers, Proxmox configures their /etc/network/interfaces files using added post-up and pre-down routes. Similarly, just for fun, instead of giving the gateway addresses in our /etc/network/interfaces,, we can manually add routes. Except for the initial <code>post-up</code> and <code>pre-down</code> these added lines mirror <a rel="nofollow" href="https://talk.lowendspirit.com/discussion/comment/63067/#Comment_63067"><code>ip route</code> commands that we could run manually</a> to set up or take down networking without touching the /etc/network/interfaces file.</p>

<pre><code>debian@debian-kvm:/etc/network$ cat interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

auto ens18
iface ens18 inet static
  address 172.16.165.97/28
     post-up ip route add 172.16.164.1 dev ens18
     post-up ip route add default via 172.16.164.1 dev ens18
     pre-down ip route del default via 172.16.164.1 dev ens18
     pre-down ip route del 172.16.164.1 dev ens18

iface ens18 inet6 static
  address fe80:xxxx:xxxx:xxxx::97/128
     post-up ip route add fe80:xxxx:xxxx:xxxx::3  dev ens18
     post-up ip route add default via fe80:xxxx:xxxx:xxxx::3  dev ens18
     pre-down ip route del default via fe80:xxxx:xxxx:xxxx::3  dev ens18
     pre-down ip route del fe80:xxxx:xxxx:xxxx::3  dev ens18

debian@debian-kvm:/etc/network$ 
</code></pre>

<h2>VI. Our VM's DNS</h2>

<p>We might want to add more or different nameservers to /etc/resolv.conf. Our Quick Setup configuration, above, includes <a rel="nofollow" href="https://blog.cloudflare.com/dns-resolver-1-1-1-1/">IPs from Cloudflare</a> and <a rel="nofollow" href="https://developers.google.com/speed/public-dns">from Google.</a></p>

<h2>VII. Our VM's Apt Setup</h2>

<p>The Debian wiki instructions for configuring apt are at <a rel="nofollow" href="https://wiki.debian.org/SourcesList">https://wiki.debian.org/SourcesList.</a> There also is a <a rel="nofollow" href="https://manpages.debian.org/buster/apt/sources.list.5.en.html">man page.</a> The configuration shown above, in Section III Quick Setup, is from the <a rel="nofollow" href="https://wiki.debian.org/SourcesList">SourcesList Debian wiki page.</a></p>

<p>The Debian <a rel="nofollow" href="https://www.debian.org/security/">Security Information page</a> says:</p>

<blockquote><div>
  <p>You can use apt to easily get the latest security updates. This requires a line such as<br />
  deb <a href="http://security.debian.org/debian-security" rel="nofollow">http://security.debian.org/debian-security</a> buster/updates main contrib non-free</p>
</div></blockquote>

<p>Many of the larger providers offer Debian mirrors. For example, Debian packages and security updates are available from the <a rel="nofollow" href="https://docs.hetzner.com/robot/dedicated-server/operating-systems/hetzner-aptitude-mirror/">Hetzner Debian Mirror</a></p>

<p>After /etc/sources.list is edited, we update our system's package repositories as follows:</p>

<pre><code>apt-get upgrade &amp;&amp; apt-get dist-upgrade -y
</code></pre>

<p>We can see exactly which packages are installed by looking at the logs in /var/log/apt.</p>

<p>We may wish to install openssh-server so that we can connect to our VM via ssh in addition to our Proxmox VNC connection. With ssh we regain cut and paste functionality while enjoying lower apparent latency!</p>

<pre><code>apt-get install openssh-server
</code></pre>

<p>The <a rel="nofollow" href="https://aboutbryan.com/2013/03/03/my-first-5-minutes-on-a-server-or-essential-security-for-linux-servers/">Kennedy article,</a> mentioned below in Section VII, has some good tips for ssh server configuration.</p>

<h2>VIII. Security</h2>

<p><a rel="nofollow" href="https://www.google.com">Google</a> suggests its <a rel="nofollow" href="https://aboutbryan.com/2013/03/03/my-first-5-minutes-on-a-server-or-essential-security-for-linux-servers/">first choice among essential server security articles.</a> This article from 2013, by Bryan Kennedy, seems to provide still-good advice, except that, nowadays, many people prefer to use <a rel="nofollow" href="https://en.wikipedia.org/wiki/EdDSA">ed25519 keys</a></p>

<h2>IX. Backup</h2>

<p>After all this work, we certainly want to make an offline backup of our new VM. We can <a rel="nofollow" href="https://pve.proxmox.com/wiki/Backup_and_Restore">use Proxmox to make the backup</a> and then download a a copy from the host node's /var/lib/vz/dump directory.</p>
]]>
        </description>
    </item>
    <item>
        <title>HTTP Server Setup with a Single Command Line</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/3931/http-server-setup-with-a-single-command-line</link>
        <pubDate>Mon, 21 Mar 2022 20:31:31 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>alexxgg</dc:creator>
        <guid isPermaLink="false">3931@/index.php?p=/discussions</guid>
        <description><![CDATA[<p><em>Written by <a href="https://lowendspirit.com/index.php?p=/profile/alexxgg" rel="nofollow">@alexxgg</a>, 19 May 2021</em><br />
<small>Article was migrated from WordPress to Vanilla in March 2022</small></p>

<p>
  <img src="https://talk.lowendspirit.com/uploads/editor/y9/8lyyu4b1q32d.png" alt="image" />
</p>

<p>This is a guest post by <a rel="nofollow" href="https://talk.lowendspirit.com">forum</a> user <a href="https://lowendspirit.com/index.php?p=/profile/alexxgg" rel="nofollow">@alexxgg</a>,</p>

<p>Hi there!</p>

<p>These days when the internet shares things in milliseconds, who of you have needed to share a file quickly? I bet some of you remember at least one time one of those cases.</p>

<p>As you probably know, in terms of web servers, we can share files with popular software like Apache, Nginx, and Lighttpd but this software need basic configuration, also they consume server resources as long as they’re active.</p>

<p>What if you could set up a basic HTTP web server without installing Apache, Nginx, or Lighttpd? Well, that’s sounds kind of impossible, and even more unbelievable is that you can kill it with Ctrl^C. Thanks to Python3 we can do that with its <a rel="nofollow" href="https://pypi.org/project/httpserver/">HTTP server module</a>.</p>

<p>This module will deploy an HTTP server in any directory of the server, even in the root directory and that sounds ridiculously dangerous, fortunately, the default port of this HTTP server isn’t 80. Instead, it will use port: 8000 but you can assign a custom port, very convenient for NAT environment instances.</p>

<p>Now you can deploy a basic HTTP server -in the current directory with the default port- by typing this single command line:</p>

<pre><code>python3 -m http.server
</code></pre>

<p>Starting HTTP Server</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/05/lopja74fwxsh.png" alt="" title="" /></p>

<p>Killing HTTP Server</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/j0/nzh2vdl7fq70.png" alt="" title="" /></p>

<p>HTTP Server as Shown in Browser</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/ic/4ppesu0bamvj.png" alt="" title="" /></p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/81/dmmmh9vc0eds.png" alt="" title="" /></p>

<p>You can change the default port (example port: 32085) and specify a directory (example directory: /tmp/) with:</p>

<pre><code>python3 -m http.sever 32085 --directory /tmp/
</code></pre>

<p>More information about Python3 httpserver module is available <a rel="nofollow" href="https://docs.python.org/3/library/http.server.html">here</a></p>

<p>Also, there is a github page <a rel="nofollow" href="https://github.com/freelamb/simple_http_server">here</a></p>

<p><strong>Note</strong>: of course, you will need to install Python3 in order to use these post example command lines.<br />
Leave a comment to let me know any questions or suggestions.</p>
]]>
        </description>
    </item>
    <item>
        <title>How to change the number of minutes that the sudo password is cached</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/3928/how-to-change-the-number-of-minutes-that-the-sudo-password-is-cached</link>
        <pubDate>Mon, 21 Mar 2022 20:21:02 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>mikho</dc:creator>
        <guid isPermaLink="false">3928@/index.php?p=/discussions</guid>
        <description><![CDATA[<p><em>Written by <a href="https://lowendspirit.com/index.php?p=/profile/mikho" rel="nofollow">@mikho</a>, 4 May 2021</em><br />
<small>Article was migrated from WordPress to Vanilla in March 2022</small></p>

<p>
  <img src="https://talk.lowendspirit.com/uploads/editor/c2/qds4s5mryuc2.png" alt="image" />
</p>

<p>This is a really QUICK TIP!</p>

<p>When you run any command as root, using sudo, the password is remembered for 15 minutes by default.<br />
If you want to change the time that the password is cached, open the terminal (as root) and run:</p>

<pre><code>editor /etc/sudoers 
</code></pre>

<p>Find this line in the file:</p>

<pre><code>defaults env_reset
</code></pre>

<p>And change it into:</p>

<pre><code>defaults env_reset , timestamp_timeout=x
</code></pre>

<p>where “x” is the time in minutes that the password will be cached.</p>

<p>Save and exit and work is done!</p>
]]>
        </description>
    </item>
    <item>
        <title>Announcing Cloudflare for SaaS for Everyone</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/3918/announcing-cloudflare-for-saas-for-everyone</link>
        <pubDate>Mon, 21 Mar 2022 19:43:33 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>Laton</dc:creator>
        <guid isPermaLink="false">3918@/index.php?p=/discussions</guid>
        <description><![CDATA[<p><em>Written by <a href="https://lowendspirit.com/index.php?p=/profile/Laton" rel="nofollow">@Laton</a>, 24 Apr 2021</em><br />
<small>Article was migrated from WordPress to Vanilla in March 2022</small></p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/73/vn4x16y1spbj.png" alt="" title="" /></p>

<p>Cloudflare has recently adapted their <a rel="nofollow" href="https://www.cloudflare.com/en-gb/ssl-for-saas-providers/">SSL for SaaS</a> product, which was originally limited only to their Enterprise customers but has now been released publicly. Yesterday they announced their Cloudflare for SaaS solution available to everyone. And to reflect their recent service evolution of the product they have re-named it to: <a rel="nofollow" href="https://www.cloudflare.com/en-gb/saas/">Cloudflare for SaaS</a>.</p>

<p>You may ask yourself: <em>What exactly is SaaS?</em><br />
Software as a Service (SaaS) is a method of providing software to an end-user where the software is not installed and maintained by the user, but via hosted services (most often through a web browser). Popular examples of such a service include Salesforce, Google Apps, Microsoft Office 365, etc.</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/wr/ss73sxt4l6wk.png" alt="" title="" /></p>

<p>Since the 15th of April, they have released their beta stage, which is available for sign up if you submit your request <a rel="nofollow" href="https://forms.gle/crARoXd4taCtoSti8">here</a>. Before the introduction of <a rel="nofollow" href="https://www.cloudflare.com/en-gb/saas/">Cloudflare for SaaS</a>, your best bet was for your customer to set up a CNAME record and have them generate a private key and CSR.</p>

<p>On top of that, you would be required to maintain a solution to generate and securely store private keys. But with the introduction of Cloudflare for SaaS, it is now more freely accessible and has provided less of a burden when managing multiple customers.</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/ya/rh7reoegqtg4.png" alt="" title="" /></p>

<h4>Cloudflare Workers</h4>

<p>Back in January when SSL for SaaS was announced, 80% of beta users were already building their application on Cloudflare workers. But by combining the use of Cloudflare for SaaS with <a rel="nofollow" href="https://workers.cloudflare.com/">Cloudflare workers</a>, will overall reduce the time and core resources from building your application.</p>

<h4>Security</h4>

<p>It also has already provided <a rel="nofollow" href="https://www.cloudflare.com/en-gb/ddos/">DDoS Protection</a> and <a rel="nofollow" href="https://www.cloudflare.com/en-gb/waf/">Web Application Firewall (WAF)</a> built-in. Alongside the benefits offered to the Enterprise customers at no additional cost.</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/96/7te3da508k5e.png" alt="" title="" /></p>

<p>So, if you want to have more control of your SSL certificate solution and would like a simple but manageable solution, then why not sign up for the <a rel="nofollow" href="https://forms.gle/crARoXd4taCtoSti8">beta</a>.</p>
]]>
        </description>
    </item>
    <item>
        <title>HOWTO: Locate empty files and directories</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/3930/howto-locate-empty-files-and-directories</link>
        <pubDate>Wed, 05 May 2021 12:00:00 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>mikho</dc:creator>
        <guid isPermaLink="false">3930@/index.php?p=/discussions</guid>
        <description><![CDATA[<p><em>Written by <a href="https://lowendspirit.com/index.php?p=/profile/mikho" rel="nofollow">@mikho</a>, 5 May 2021</em><br />
<small>Article was migrated from WordPress to Vanilla in March 2022</small></p>

<p>
  <img src="https://talk.lowendspirit.com/uploads/editor/kl/ovtru2uav7gg.png" alt="image" />
</p>

<p>When installing software on your VPS you will end up with both empty files and empty directories, often these are used as placeholders/lock files/socket files for communication.</p>

<p>This short guide will give you some examples on how to find those empty files/directories.</p>

<p>The command we are going to use is the “<strong>find</strong>” command. To find empty directories/files in the current directory, you use the parameter “<em><strong>&#45;empty</strong></em>“.</p>

<p>You also have to use the parameter “<em><strong>&#45;type</strong></em>” to define if you are looking for directories (d) or files (f).</p>

<h2><strong>Examples</strong></h2>

<p>Here is the command to find empty directories in the current directory:</p>

<pre><code>find ./ -type d -empty
</code></pre>

<p>And here is the command to find empty files in the current directory:</p>

<pre><code>find ./ -type f -empty
</code></pre>

<p>If you need to know how many empty files you have in the current directory, pipe the find command to “<em><strong>wc -l</strong></em>“:</p>

<pre><code>find ./ -type f -empty | wc -l
</code></pre>

<p>Similarly, to recursivly count how many how many files are located under the current directory and sub-directories,  you can use the following command:</p>

<pre><code>find ./ -type f -not -empty | wc -l 
</code></pre>

<p>To remove all empty directories in the current directory, the command you can use is:</p>

<pre><code>find ./ -type d -empty -exec rmdir {} \;
</code></pre>

<p><strong>– In all the commands above, the  (./) means the current directory or folder, if you want to perform actions in other directories, just replace the  (./) with the path to the new directory.</strong></p>

<p><strong>– In system directories such as /etc/, there are many empty files and directories.</strong></p>

<p><strong>But it is strongly recommended to not remove them.</strong></p>
]]>
        </description>
    </item>
    <item>
        <title>Portainer – A Docker management tool</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/3919/portainer-a-docker-management-tool</link>
        <pubDate>Mon, 21 Mar 2022 19:47:34 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>sahjanivishal</dc:creator>
        <guid isPermaLink="false">3919@/index.php?p=/discussions</guid>
        <description><![CDATA[<p><em>Written by <a href="https://lowendspirit.com/index.php?p=/profile/sahjanivishal" rel="nofollow">@sahjanivishal</a>, 27 Apr 2021</em><br />
<small>Article was migrated from WordPress to Vanilla in March 2022</small></p>

<h3>What is Docker?</h3>

<p>If you're reading this, most probably you already know Docker or have at least heard about it a lot. But still, for the uninitiated, Docker is an open platform for developing, shipping, and running applications and it enables you to separate your applications from your infrastructure so you can deliver software quickly. Find Docker interesting and want to know more? Head over to their <a rel="nofollow" href="https://docs.docker.com/get-started/overview/">docs</a> and you can find all the information you need!</p>

<h3>What is Portainer?</h3>

<p>So, talking about the elephant in the room, <a rel="nofollow" href="https://www.portainer.io/">Portainer</a> is a fully-featured web based GUI management tool for Docker. It runs locally, giving developers a rich UI to build and publish container images, deploy and manage applications and leverage data persistence and horizontal scaling for their applications.<br />
Worried about the cost? Portainer Community Edition is open source, free forever and used by more than 500,000 developers worldwide.</p>

<h3>What can I use Portainer for?</h3>

<ol>
<li>Visualize your server's docker environment on your web browser. (<em>I know that you don't fear the terminal, but hey, a little help won't harm anybody!</em>)</li>
<li>Aggregate view of Docker Swarm clusters (<em>Yeah, it's that fancy!</em>)</li>
<li>Deploy containers with some pre-built templates, right from inside the Portainer.</li>
<li>Start, Stop, Kill, Restart, Pause, Resume and Remove the containers easily with the web-GUI.</li>
<li>Facing any issue while deploying containers? Don't worry, Portainer to rescue! You can inspect the logs for any containers directly from the GUI and see what is stopping you from conquering the world.</li>
</ol>

<h3>How do I install Portainer?</h3>

<p>So, you're happy to give Portainer a go and want to know how can you install it? I have got you covered:</p>

<ol>
<li>Make sure you have Docker Engine installed on your server. You can follow the install instructions given <a rel="nofollow" href="https://docs.docker.com/get-docker/">here.</a></li>
<li>Run the following command to create a docker volume which should give output as <code>portainer_data</code> indicating the command was successfully executed:</li>
</ol>

<p><code>sudo docker volume create portainer_data</code></p>

<ol start="3">
<li>Once the volume is created, run the following command to create and run the Portainer container:</li>
</ol>

<p><code>sudo docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce</code></p>

<p>The above command should create and run the Portainer container on your server's port number 9000, which can be generally accessed in following ways:</p>

<p>a) By opening <code>http://your_server_ip:9000</code> in your favorite browser.<br />
b) If you have a domain name pointed towards your server's IP, by opening <code>yourdomain.com:9000</code> in your browser.</p>

<blockquote><div>
  <p>Note: If you want to access Portainer over a subdomain instead of every time typing <code>yourdomain.com:9000</code>, you can put it behind a reverse proxy with the help of any web server, like Caddy.</p>
</div></blockquote>

<p>4&#46; Alright, once the container is up and running, access it via any of the above methods and you will be greeted by the following initial setup screen of Portainer:</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/pa/33updf14w5mb.png" alt="" title="" /></p>

<blockquote><div>
  <p>Set the username and password for admin user here and click on <code>Create User</code>.</p>
</div></blockquote>

<p>5&#46; Next, select Docker as the container management environment you want Portainer to connect to (yes Portainer can connect to Kubernetes too, but that's a story for another day):</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/xp/jl35jgd665h1.png" alt="" title="" /></p>

<p>6&#46; Voila! now you have successfully connected your local Docker environment to Portainer and you should be able to see below screen:</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/90/43xcygcvlqnz.png" alt="" title="" /></p>

<p>7&#46; Click on the <code>local</code> endpoint to see all the containers, images, volumes, networks etc. in your Docker environment:</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/am/z4sbzvuao0qn.png" alt="" title="" /></p>

<p>8&#46; You can also deploy app templates containers right from inside the Portainer:</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/65/sakwc8mh0hvd.png" alt="" title="" /></p>

<blockquote><div>
  <p>This is it! Go on, play around a bit and I'm sure you'll love how easy Portainer makes it to manage Docker containers. Given how many of the self-hosted apps can be deployed using Docker containers, Portainer is a must-have tool in your arsenal.</p>
</div></blockquote>
]]>
        </description>
    </item>
    <item>
        <title>Low memory usage SMTP Send-Only</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/3925/low-memory-usage-smtp-send-only</link>
        <pubDate>Mon, 21 Mar 2022 20:13:41 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>mikho</dc:creator>
        <guid isPermaLink="false">3925@/index.php?p=/discussions</guid>
        <description><![CDATA[<p><em>Written by <a href="https://lowendspirit.com/index.php?p=/profile/mikho" rel="nofollow">@mikho</a>, 1 May 2021</em><br />
<small>Article was migrated from WordPress to Vanilla in March 2022</small></p>

<p>
  <img src="https://talk.lowendspirit.com/uploads/editor/kl/ovtru2uav7gg.png" alt="image" />
</p>

<p>In the LowEndSpirit, we tend to look for resource-efficient alternatives. Here is an alternative to use instead of Postfix, Sendmail, or Exim.</p>

<p>Often when installing and running a web application or script you need an SMTP server to send an email, rarely there is the need to receive any email. It works equally well using <a rel="nofollow" href="https://linux.die.net/man/8/ssmtp">ssmtp</a>, which also is simple and fast to install. It takes two minutes to install and configure.</p>

<h3>RedHat, CentOS7, Fedora</h3>

<pre><code>yum install ssmtp
</code></pre>

<p>If you receive a <em>“Package ssmtp is not available”</em> error, you’ll need to install EPEL on your machine with the following command:</p>

<pre><code>yum --enablerepo=extras install epel-release
</code></pre>

<p>Once done, you’ll be able to install ssmtp using the above command.</p>

<h2>Ubuntu, Debian</h2>

<pre><code>apt-get install ssmtp
</code></pre>

<p>The configuration is done in the <strong><em>/etc/ssmtp/ssmtp.conf</em></strong> and there is only a couple of settings to change:</p>

<p><em><strong>Mailhub</strong></em><br />
The mail server you must send mail through (relay). In this guide we will use GMail smtp Server.<br />
<strong><em>From Line Override</em></strong><br />
Set to YES to allow the use of others choose from addresses other than the system itself.<br />
<em><strong>AuthUser</strong></em><br />
The username or email adress on the account used to login to gmail.<br />
<strong><em>AuthPass</em></strong><br />
The password for above account<br />
<strong><em>UseSTARTTLS</em></strong><br />
Set to Yes to use TLS when connecting to the SMTP server.</p>

<pre><code>## Config file for sSMTP sendmail
## The person who gets all mail for userids &lt; 1000
# Make this empty to disable rewriting.
root=postmaster
# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=smtp.gmail.com:587
AuthUser=name@gmail.com
AuthPass=YourtopSecretPassw0rd!
UseSTARTTLS=YES 
# Where will the mail seem to come from?
#rewriteDomain= 
# The full hostname
hostname=debianVPS.local 
# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: 
addressFromLineOverride=YES
</code></pre>

<p>No reboots required.</p>

<p>To use ssmtp with the PHP <em>mail()</em> function, you have to edit the <em><strong>sendmail&#95;path</strong></em> parameter in <strong><em>php.ini</em></strong> to something like this:</p>

<pre><code>sendmail_path = /usr/sbin/ssmtp -t
</code></pre>

<p>You have no open ports, everything just works!</p>
]]>
        </description>
    </item>
    <item>
        <title>Email notification when someone logs in via SSH</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/3927/email-notification-when-someone-logs-in-via-ssh</link>
        <pubDate>Mon, 03 May 2021 12:00:00 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>mikho</dc:creator>
        <guid isPermaLink="false">3927@/index.php?p=/discussions</guid>
        <description><![CDATA[<p><em>Written by <a href="https://lowendspirit.com/index.php?p=/profile/mikho" rel="nofollow">@mikho</a>, 3 May 2021</em><br />
<small>Article was migrated from WordPress to Vanilla in March 2022</small></p>

<p>
  <img src="https://talk.lowendspirit.com/uploads/editor/kl/ovtru2uav7gg.png" alt="image" />
</p>

<p>Even if it is too late when someone else logs in as root on your server, it is good to know that <strong>NOW</strong> is the time to get working on your security.</p>

<p>To setup email notification, login to your server as root.<br />
Edit .bashrc</p>

<pre><code>editor .bashrc
</code></pre>

<p>add the following line at the end, changing “ServerName” to the hostname of your server and “email@thisaddress.com” to your own email address.</p>

<pre><code>echo 'ALERT - Root Shell Access (ServerName) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d"(" -f2 | cut -d")" -f1`" email@thisaddress.com 
</code></pre>

<hr />

<p><strong>!NOTE!</strong> - Take notice of the &#96; in the code block. Sometimes when copying code from a webpage, these small characters will mess up when pasted.</p>

<hr />

<p>Save and exit your .bashrc.</p>

<p>Next time someone, hopefully you, logs on as root, you will get an email about this.</p>

<p>This can be done for any user, you only have to make sure that the user can email out from your server.</p>

<p>Quick Tip: Use the guide <a rel="nofollow" href="https://lowendspirit.com/low-memory-usage-smtp-send-only/">here</a> to install and configure a Low Resource SMTP Server.</p>
]]>
        </description>
    </item>
    <item>
        <title>Reclaim reserved disk space KVM/VMWare/Dedicated</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/3922/reclaim-reserved-disk-space-kvm-vmware-dedicated</link>
        <pubDate>Mon, 21 Mar 2022 20:04:09 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>mikho</dc:creator>
        <guid isPermaLink="false">3922@/index.php?p=/discussions</guid>
        <description><![CDATA[<p><em>Written by <a href="https://lowendspirit.com/index.php?p=/profile/mikho" rel="nofollow">@mikho</a>, 29 Apr 2021</em><br />
<small>Article was migrated from WordPress to Vanilla in March 2022</small></p>

<p>
  <img src="https://talk.lowendspirit.com/uploads/editor/c2/qds4s5mryuc2.png" alt="image" />
</p>

<p>Following up on the bonus tip posted on <a rel="nofollow" href="https://lowendspirit.com/resize-your-kvm-vps-disk-partition-2-methods-and-bonus-tip-to-reclaim-disk-space-easy-mode/">Resize your KVM VPS disk partition, 2 methods and bonus tip to reclaim disk space – Easy mode</a>, here is a longer explanation and guide how to reclaim your reserved disk space.</p>

<hr />

<p>Joe Dougherty from <a rel="nofollow" href="https://securedragon.net/">SecureDragon.net</a> (great guy running a great company) sent me a tip about <a rel="nofollow" href="http://www.lowendtalk.com/discussion/33817/reclaim-some-free-space-on-your-server-with-this-weird-trick-kvm-xen-dedi-only">this thread</a> and asked if I could write something about this “weird trick”. Actually it’s not a wierd trick, it’s a built in security feature. The information in this post will only work on dedicated servers or Virtual Servers that utilize full virtualization, meaning that <strong>this won’t work on OpenVZ</strong>.</p>

<hr />

<p>On a newly created filesystems (Ext &#91;2/3/4&#93;) some of the space will be allocated for the system superuser (root) as “system reserved”. The default of 5% is meant for system partitions. If something goes wrong and your server consumes all its free disk space, the root user could still log in and check logs/crashdumps/etc and generally fix the situation.</p>

<p>For example, if your disk space fills up, the system logs (<em><code>/var/log</code></em>) and root’s mailbox (<em><code>/var/mail/root</code></em>) can still receive important information. For a <em><code>/home</code></em> or general data storage partition, there’s no need to leave any space for root. For very special needs, you can even change the user that gets this emergency space.</p>

<p>There’s another reason to not allow an ext&#91;23&#93; filesystem to get full, which is <a rel="nofollow" href="http://en.wikipedia.org/wiki/Defragmentation">fragmentation</a>. Ext4 should be better at this, as <a rel="nofollow" href="https://www.redhat.com/archives/ext3-users/2009-January/msg00026.html">explained by Linux filesystem developer/guru Theodore Ts’o</a>:</p>

<blockquote><div>
  <p>If you set the reserved block count to zero, it won't affect performance much except if you run for long periods of time (with lots of file creates and deletes) while the filesystem is almost full (i.e., say above 95%), at which point you'll be subject to fragmentation problems.  Ext4's multi-block allocator is much more fragmentation resistant, because it tries much harder to find contiguous blocks, so even if you don't enable the other ext4 features, you'll see better results simply mounting an ext3 filesystem using ext4 before the filesystem gets completely full.If you are just using the filesystem for long-term archive, where files aren't changing very often (i.e., a huge mp3 or video store), it obviously won't matter.</p>
  
  <p>Theodore Tso </p>
</div></blockquote>

<p>If you have a VPS with small disk size the 5% won’t mean much but if you have a 100GB drive or bigger, it quickly adds up to a vaste amount of unused space. In those cases we could lower the amount of reserved space in order to claim and use a few more GB.</p>

<p>At the time of writing the original post, I actually had an unused XEN VPS so lets have a look at what we can do about this by using that as a real life example.</p>

<p>first we confirm the filesystem parameters by running this <a rel="nofollow" href="https://linux.die.net/man/8/tune2fs">command</a>:</p>

<pre><code># tune2fs -l /dev/xvda1
</code></pre>

<p>it will list all information about the disk. This is the output I got from my server:</p>

<pre><code>tune2fs 1.42.5 (29-Jul-2012)
Filesystem volume name:   &lt;none&gt;
Last mounted on:          &lt;not available&gt;
Filesystem UUID:          50fd54e4-7740-4683-b1e5-64e93d6d1e92
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery sparse_super large_file
Filesystem flags:         signed_directory_hash 
Default mount options:    (none)
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              9830400
Block count:              39321600
Reserved block count:     1966080
Free blocks:              38473681
Free inodes:              9799099
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      1014
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8192
Inode blocks per group:   512
RAID stride:              1
RAID stripe width:        80
Filesystem created:       Mon Nov 10 19:05:08 2014
Last mount time:          Sun Dec 14 17:25:37 2014
Last write time:          Sun Dec 14 17:25:13 2014
Mount count:              12
Maximum mount count:      34
Last checked:             Mon Nov 10 19:05:08 2014
Check interval:           15552000 (6 months)
Next check after:         Sat May  9 19:05:08 2015
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:               256
Required extra isize:     28
Desired extra isize:      28
Journal inode:            8
Default directory hash:   half_md4
Directory Hash Seed:      e2ccf267-28ea-4e34-9df0-a349d06f0247
Journal backup:           inode blocks
</code></pre>

<p>The ineresting part from the output above:</p>

<pre><code>Reserved block count:     1966080
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
</code></pre>

<p>Before we move on to the amount of reserved space, take a moment to reflect on what user who is allowed to use the reserved space. By default it is root unless changed by the system administrator.</p>

<p>if you multiply the <em>Reserved Block Count</em> with the current <em>Block Size</em> (also found in the tune2fs output above)</p>

<pre><code>Block size:               4096
</code></pre>

<p>we get how much space in bytes that is reserved by the system:</p>

<table><tbody><tr><td>Block count * Block Size</td><td>Byte</td><td>Kilobyte</td><td>Megabyte</td><td>Gigabyte</td></tr><tr><td>1966080 * 4096</td><td>8053063680</td><td>7864320</td><td>7680</td><td>7,5</td></tr></tbody></table>

<p>Doing the same operation using the Block Count value:</p>

<pre><code>Block count:              39321600
</code></pre>

<p>will give you the Total Disk space of the drive</p>

<table><tbody><tr><td>Block count * Block Size</td><td>Byte</td><td>Kilobyte</td><td>Megabyte</td><td>Gigabyte</td></tr><tr><td>39321600 * 4096</td><td>161061273600</td><td>157286400</td><td>153600</td><td>150</td></tr></tbody></table>

<p>As you can see (7,5GB out of 150GB) exactly 5% of the disk is reserved space.</p>

<p>As previously mentioned, if you don’t have a large disk it would be wise to not change that 5% value since it could mean that you wont have enough “system reserved space” to recover from a full disk problem.</p>

<p>In my case, 7,5 GB of reserved space is a bit much and I would benefit if this was available for me to store my backups instead. So, how do we change the amount of reserved space?</p>

<p>Since my disk is in total 150GB each percentage is 1,5GB and I think that 1,5GB will be enough for this server, the command to set the reserved space to 1 percent would therefor look like this:</p>

<pre><code># tune2fs -m 1 /dev/xvda1
</code></pre>

<p>The returned result :</p>

<pre><code>Setting reserved blocks percentage to 1% (393216 blocks)
</code></pre>

<p>Keeping in mind that each block is 4096 bytes the above result means the reserved space is:</p>

<pre><code>393216 * 4096 = 1,5 GB
</code></pre>

<p>Before you jump of joy I would like to end this article with a few words of caution;</p>

<p>While this is a nice way to get some extra space on your server <strong>TAKE EXTREME CARE</strong> if you decide to change the settings on the drive that has the / volume or you could end up with a server that even root can’t save when the disk runs out of space. If you have a secondary drive that only holds data, may it be your mp3 collection or family photos, you can set the reserved space to 0percent on that drive. As long as it is NOT the system drive.</p>
]]>
        </description>
    </item>
    <item>
        <title>How to Create and Setup a Debian KVM VPS with Proxmox VE 6 — Part II — Debian Install</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/3917/how-to-create-and-setup-a-debian-kvm-vps-with-proxmox-ve-6-part-ii-debian-install</link>
        <pubDate>Mon, 21 Mar 2022 19:40:48 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>Not_Oles</dc:creator>
        <guid isPermaLink="false">3917@/index.php?p=/discussions</guid>
        <description><![CDATA[<p><em>Written by <a href="https://lowendspirit.com/index.php?p=/profile/Not_Oles" rel="nofollow">@Not_Oles</a>, 21 Apr 2021</em><br />
<small>Article was migrated from WordPress to Vanilla in March 2022</small></p>

<p>
  <img src="https://talk.lowendspirit.com/uploads/editor/n9/cixat1djj0ag.png" alt="image" />
</p>

<p><strong>Introduction</strong></p>

<p>In <a rel="nofollow" href="https://lowendspirit.com/how-to-create-and-setup-a-debian-kvm-vps-with-proxmox-ve-6-part-i-creation">Part I of this series</a>, we downloaded the <a rel="nofollow" href="https://www.debian.org/CD/netinst/">Debian netinst install iso</a>. We then created a KVM VPS with the iso attached, and, finally, we successfully booted the iso.</p>

<p>In today's post, we're going to install our KVM with Debian 10 from the newly booted iso. But first, a bit of context on installing.</p>

<p><strong>Context</strong></p>

<ul>
<li><strong>Why the Debian minimal netinst iso?</strong></li>
</ul>

<p>Debian themselves say, <a rel="nofollow" href="https://www.debian.org/CD/netinst/">"we think that in many cases the minimal CD image is better — above all, you only download the packages that you selected for installation on your machine. . . ."</a></p>

<p>What we gain from this series is a well-proven, widely used, minimal, highly extensible, open-source server operating system.</p>

<ul>
<li><strong>What about networking?</strong></li>
</ul>

<p>The biggest difference between installing on our VPS and installing on our personal laptop or desktop might be network configuration. On personal devices, we are used to automatic network configuration happening behind the scenes via <a rel="nofollow" href="https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol">Dynamic Host Configuration Protocol (DHCP)</a>. We turn on our device, it gets its own IP address and internet connection without our having to do much.</p>

<p>On servers, however, the server's IP address and internet connection sometimes are set by hand instead of automatically via DHCP. Traditionally, server network settings are done from a console physically connected to the running server. Obviously, however, if our server is at a remote location, we cannot have a wired connection. Also, since networking hasn't yet been set up inside the server, we can't connect directly to our remote server over the internet, either.</p>

<p>As might be expected, the Debian minimal netinst iso is set up to configure networking automatically via DHCP. Thus, when we try the networking step of the install, that step will fail. The netinst iso will succeed, however, in installing a minimal Debian system without networking. In Part III of this series, covering Post Install Configuration, we will use the Proxmox web GUI and VNC to go inside our minimal system and set up networking by hand.</p>

<ul>
<li><strong>Alternative installation methods</strong></li>
</ul>

<p>It might be worth mentioning a few of the many other excellent methods of server installation which, although frequently used, are not selected here because they might be even more complex than our "simple" <img src="images/smile.png" alt=":)" title=":)" /> method.</p>

<ul>
<li>First, <a rel="nofollow" href="https://lowendspirit.com/debian-unattended-installation-using-a-preseed-file">Debian unattended Installation using a preseed file</a> will not work here because no networking is set up to use for obtaining the preseed file.</li>
<li>Cloud-init is <a rel="nofollow" href="https://github.com/canonical/cloud-init">"the <em>industry standard</em> multi-distribution method for cross-platform cloud instance initialization."</a> However, the <a rel="nofollow" href="https://pve.proxmox.com/wiki/Cloud-Init_Support">Proxmox Cloud-Init Support wiki article</a> says, despite the convenience of ready-made images, "we usually recommended to prepare the images by yourself," because "you will know exactly what you have installed." Also, for a special perspective on Cloud-Init, you might enjoy watching <a rel="nofollow" href="https://www.hashicorp.com/resources/cloudinit-the-good-parts">Cloud-Init: The Good Parts.</a></li>
<li>Proxmox supports <a rel="nofollow" href="https://pve.proxmox.com/wiki/VM_Templates_and_Clones">Templates.</a> It's possible to create templates with <a rel="nofollow" href="https://www.packer.io/">Packer.</a> If interested, you can check <a rel="nofollow" href="https://dev.to/aaronktberry/creating-proxmox-templates-with-packer-1b35">Creating proxmox templates with packer.</a></li>
</ul>

<p><strong>Before We Start</strong></p>

<p>We need to begin today at <a rel="nofollow" href="https://lowendspirit.com/how-to-create-and-setup-a-debian-kvm-vps-with-proxmox-ve-6-part-i-creation">the exact stage where we left Part I.</a> Our Debian Installer should be booted and running on our VPS.</p>

<p>We also will need the server's hostname (which can be Debian) plus the username (which also can be Debian) and the real name for the user account which the installer will create. It's also convenient to have on hand two <a rel="nofollow" href="https://passwords-generator.org/">previously generated good passwords,</a> one for the root account and another for the new user account.</p>

<p><strong>Debian Installer Steps</strong></p>

<ul>
<li><strong>Select Install</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/h2/9s2boinm789t.png" alt="" title="" /></p>

<ul>
<li><strong>Language</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/oi/jyzq11ay2z2c.png" alt="" title="" /></p>

<ul>
<li><strong>Location</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/d8/4ogce6eln8c9.png" alt="" title="" /></p>

<ul>
<li><strong>Keyboard</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/10/ws7jw1dfl4uk.png" alt="" title="" /></p>

<ul>
<li><strong>DHCP Tries and Fails</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/00/qbxl1icecoc6.png" alt="" title="" /></p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/dz/csnojjtvtggb.png" alt="" title="" /></p>

<ul>
<li><strong>Select "Do Not Configure Network at this Time"</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/9e/73uzhwy2lvp4.png" alt="" title="" /></p>

<ul>
<li><strong>Hostname</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/il/445y6j7140ya.png" alt="" title="" /></p>

<ul>
<li><strong>Enter and Confirm the Root Password</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/7n/9pzj9y6y9qtf.png" alt="" title="" /></p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/ya/jymedyyrhi6x.png" alt="" title="" /></p>

<ul>
<li><strong>User's Real Name</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/o5/bbaqkg91187q.png" alt="" title="" /></p>

<ul>
<li><strong>Username</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/p7/a0ccap5kqxff.png" alt="" title="" /></p>

<ul>
<li><strong>User Password</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/40/9mkk3s6d1qzk.png" alt="" title="" /></p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/od/sh8bx3s7ht09.png" alt="" title="" /></p>

<ul>
<li><strong>Time Zone</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/tq/1qgateac02jk.png" alt="" title="" /></p>

<ul>
<li><strong>Partitioning Method</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/3h/gxc2wxgj9mfk.png" alt="" title="" /></p>

<ul>
<li><strong>Disk to Partition</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/os/uvqci3hbc4vy.png" alt="" title="" /></p>

<ul>
<li><strong>Partitioning Scheme</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/pl/31wn8e92ka2o.png" alt="" title="" /></p>

<ul>
<li><strong>Confirm Partitioning</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/9l/hh5ah0wha62m.png" alt="" title="" /></p>

<ul>
<li><strong>Write Changes to Disks</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/io/55x6c3zhihri.png" alt="" title="" /></p>

<ul>
<li><strong>Confirm No Additional Install Media</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/n4/b8zo11jrg9vz.png" alt="" title="" /></p>

<ul>
<li><strong>Confirm No Network Mirror</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/tj/riw8uqbklrhr.png" alt="" title="" /></p>

<ul>
<li><strong>Package Usage Survey</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/nl/brp3sp93qayg.png" alt="" title="" /></p>

<ul>
<li><strong>Choose Additional Software</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/8p/vtuzuhlsub2p.png" alt="" title="" /></p>

<ul>
<li><strong>Dual Boot</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/ad/vzsroraic1ds.png" alt="" title="" /></p>

<ul>
<li><strong>Grub</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/rf/a825mn0s7p30.png" alt="" title="" /></p>

<ul>
<li><strong>Installation Complete</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/3g/q96cfykeh2zm.png" alt="" title="" /></p>

<p>In the Proxmox web GUI, we select VPS &gt; Hardware &gt; CD/DVD Drive. Press edit and select "Do not use any media." Then, we return to our "Installation Complete" screen by selecting Console, which should reappear just as we left it. Finally, we click the "Continue" button, which should reboot the VPS.</p>

<p>In <a rel="nofollow" href="https://lowendspirit.com/how-to-create-and-setup-a-debian-kvm-vps-with-proxmox-ve-6-part-i-creation">Part I</a>, we did not install Qemu Agent. Therefore, rebooting from the Proxmox web GUI (outside our VPS) as opposed to rebooting from the console (inside our VPS) might not work. However, if it is necessary to stop the server from the web GUI, we can use the web GUI's Stop command found on the drop-down menu of the Shutdown button.</p>

<ul>
<li><strong>Successful Reboot</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/yi/5qiz1u3nginb.png" alt="" title="" /></p>
]]>
        </description>
    </item>
    <item>
        <title>AXEL – multi-threaded downloads</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/3916/axel-multi-threaded-downloads</link>
        <pubDate>Wed, 14 Apr 2021 12:00:00 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>mikho</dc:creator>
        <guid isPermaLink="false">3916@/index.php?p=/discussions</guid>
        <description><![CDATA[<p><em>Written by <a href="https://lowendspirit.com/index.php?p=/profile/mikho" rel="nofollow">@mikho</a>, 14 Apr 2021</em><br />
<small>Article was migrated from WordPress to Vanilla in March 2022</small></p>

<h2>What is Axel?</h2>

<hr />

<p>When you want to download something from the command line you normally use the commands wget or curl.</p>

<p>What if you want to accelerate these downloads? I recently found this command: <a rel="nofollow" href="https://github.com/eribertomota/axel">Axel</a> which works the same way but allows you to use multiple connections for one file.<br />
As a comparison, the Mozilla extension DownThemAll does the same thing in a graphical environment. Axel can also use multiple mirrors for a download and according to tests done by the Github author this can speed up downloads up to 60%!.</p>

<p>Axel has no dependencies, is lightweight, supports HTTP, HTTPS, FTP and FTPS protocols and unlike other similar programs, it downloads all the data directly to the destination file using a single thread., saving time at the end because the program does not ave to concatenate the downloaded parts. It is also available in the Debian repo</p>

<p>If you take a look at the options available, you see that you use it the same way as you would use wget.</p>

<pre><code>Usage: axel [options] url1 [url2] [url...] 
--max-speed=x           -s x    Specify maximum speed (bytes per second)
--num-connections=x     -n x    Specify maximum number of connections
--output=f              -o f    Specify local output file
--search[=x]            -S [x]  Search for mirrors and download from x servers
--header=x              -H x    Add header string
--user-agent=x          -U x    Set user agent
--no-proxy              -N      Just don't use any proxy server
--quiet                 -q      Leave stdout alone
--verbose               -v      More status information
--alternate             -a      Alternate progress indicator
--help                  -h      This information
--version               -V      Version information
</code></pre>

<p>Axel in its simplest use:</p>

<pre><code>axel url
</code></pre>

<p>Common options include</p>

<pre><code>--max-speed
</code></pre>

<p>to prevent the app chewing up all your bandwidth and</p>

<pre><code>--num-connections
</code></pre>

<p>to specify a number of connections (the recommended default of 4 is fine for most downloads).</p>

<hr />

<p>Passing in multiple URLs allows downloading of the same file from multiple locations.</p>

<h2>Summation</h2>

<p>Axel is a great command-line tool, but what if you want a GUI download manager with similar features? Check out uGet, which also includes accelerated downloads, clipboard monitoring, browser integration queuing support, and many more features!</p>

<p>Download Manager for for <a rel="nofollow" href="https://ugetdm.com/downloads/">Linux, BSD, Android, and Windows.</a></p>
]]>
        </description>
    </item>
    <item>
        <title>Easy add IP to be blocked by iptables</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/3905/easy-add-ip-to-be-blocked-by-iptables</link>
        <pubDate>Mon, 12 Apr 2021 12:00:00 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>mikho</dc:creator>
        <guid isPermaLink="false">3905@/index.php?p=/discussions</guid>
        <description><![CDATA[<p><em>Written by <a href="https://lowendspirit.com/index.php?p=/profile/mikho" rel="nofollow">@mikho</a>, 12 Apr 2021</em><br />
<small>Article was migrated from WordPress to Vanilla in March 2022</small></p>

<p>Following up on the post on how to loop thru a file and perform an action per line, which you can find here</p>

<p><a href="https://lowendspirit.com/how-to-loop-through-a-file-and-perform-an-action-per-line/" rel="nofollow">https://lowendspirit.com/how-to-loop-through-a-file-and-perform-an-action-per-line/</a></p>

<hr />

<p>There is a case when this is useful, adding IPs from a text file into iptables and block their access to your VPS or dedicated server.</p>

<p>if you break down this command with its parameters (<em>iptables being the command</em>)</p>

<pre><code>iptables -A INPUT -s XXX.XXX.XXX.XXX -p udp -m udp --dport 28960:28965 -j DROP
</code></pre>

<p><u><strong>Parameter</strong>: Explanation</u><br />
<strong>&#45;A</strong>: Append this to existing rules<br />
<strong>INPUT</strong>: The chain where the rule should be added into<br />
<strong>&#45;s XXX.XXX.XXX.XXX</strong>: &#45;s Sets the source for a particular packet, in this case the ip of XXX.XXX.XXX.XXX<br />
<strong>&#45;p udp</strong>: &#45;p = Sets the IP protocol for the rule, which can be either icmp, tcp, udp, or all, to match every possible protocol. If this option is omitted when creating a rule, the all option is the default.<br />
<strong>&#45;m udp</strong>: &#45;m = match option  Different network protocols provide specialized matching options which may be set in specific ways to match a particular packet using that protocol. Of course, the protocol must first be specified in the iptables command, such as using -p tcp , to make the options for that protocol available.<br />
<strong>–dport 28960:28965</strong>: –dport Specifies the destination port of the UDP packet, using the service name, port number, or range of port numbers. The –destination-port match option may be used instead of –dport.  To specify a specific range of port numbers, separate the two numbers with a colon (:), such as our example.  You may also use an exclamation point character (!) as a flag after the –dport option to tell iptables to match all packets which do not use that network service or port.<br />
<strong>&#45;j DROP</strong>: &#45;j Tells iptables to jump to a particular target when a packet matches a particular rule. Valid targets to be used include the standard options, ACCEPT, DROP, QUEUE, and RETURN, as well as extended options that are available through modules loaded, such as LOG, MARK, and REJECT, among others. If no target is specified, the packet moves past the rule with no action taken. However, the counter for this rule is still increased by 1, as the packet matched the specified rule.  in our example we use DROP — The system that sent the packet is not notified of the failure. The packet is simply removed from the rule checking the chain and discarded.</p>

<p>This command will DROP connections from IP XXX.XXX.XXX.XXX on udp port 28960:28965</p>

<p>If you want to block all connections from a specific IP, no matter what port it tries to connect to, omit the -p -m and --dport parameters. This will look like this</p>

<pre><code>iptables -A INPUT -s XXX.XXX.XXX.XXX -j DROP
</code></pre>

<p>You might ask when are we going to loop thru the file?</p>

<pre><code>#!/bin/sh

# This will loop thru the file /ban/banip.txt and add every IP in that 
# file with a DROP to the INPUT chain in iptables.
#
# change the path and file name if required

# you can re-run this file if you are not saving your iptables config 
# between reboots. 
while read blist
do
/sbin/iptables -A INPUT -s $blist -j DROP &amp;&amp; sleep 2
echo $blist has been added to your iptables

done &lt; /ban/banip.txt
</code></pre>

<p>To add a single IP to the block list in iptables and add the IP to your text file, you could use a simple shell script like this</p>

<pre><code>#!/bin/sh
# Script to add ip
echo -n "Enter the IP to BAN and press [ENTER]:"
read ip
/sbin/iptables -A INPUT -s $ip -j DROP

#keep a record of the banned IP's if you want or comment out
echo $ip &gt;&gt; /ban/banip.txt
# Make sure you use the same path and filename as in the loop script
</code></pre>

<p>This is a quick and dirty way to keep a list of IPs you would like to block access from.</p>

<p>I'm sure that the readers have more sophisticated and innovative ways to add their own list of IPs to iptables.</p>

<p>Comment with how you do it and why you do it the way you do.</p>
]]>
        </description>
    </item>
    <item>
        <title>Extending Proxmox Disk Space with iSCSI Storage</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/2712/extending-proxmox-disk-space-with-iscsi-storage</link>
        <pubDate>Sat, 27 Mar 2021 03:41:28 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>ehab</dc:creator>
        <guid isPermaLink="false">2712@/index.php?p=/discussions</guid>
        <description><![CDATA[<p>This tutorial describes how to setup an iscsi partion and add it to the Proxmox storage pool.</p>

<p>The main use case for this setup is to mix and extend storage options due to low local disk space, adding fast Nvme or slow cheap HDD for iso's,templates etc ...</p>

<p>While Proxmox cp does provide a GUI to add iscsi storage my experience with server restarts did not recover connectivity with the target disk.</p>

<p>In this tutorial i will walk though mostly a command line setup between two servers.</p>

<p><strong>Note</strong>: It is recommend to use a private network between the two servers and if possible a 10GB connection would be ideal.</p>

<h6>Terms to know</h6>

<p><strong>Target</strong> - "is the server providing the disk/partion to share"<br />
<strong>Initiator</strong> - "the proxmox server consuming the target"</p>

<p>The next diagram depicts the main commands and files to touch:</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/b1/tkycefkq5qbq.png" alt="" /></p>

<p>are you ready; here we go:</p>

<h2>A - Setting up the Target example ip - 98.76.54.32 :</h2>

<pre><code># apt-get install tgt 
# cat &lt;&lt;EOF &gt; /etc/tgt/conf.d/target01.conf
&lt;target iqn.2021-03.kvm:lun1&gt;
     backing-store /dev/mapper/vgstore-lviscsi
     initiator-address 12.34.56.78
     incominguser iscsi-user password
&lt;/target&gt;
EOF
# systemctl --now enable tgt
# systemctl status tgt  ### make sure its running ; you may need to reboot
</code></pre>

<p>in the above conf file i am setting the free partition /dev/mapper/vgstore-lviscsi make sure you add the correct partition available to you.</p>

<pre><code># tgtadm -o show -m target
</code></pre>

<p>you may need to reboot to get tgtadm show tartget details.</p>

<h2>B - Setting up the ** Initiator ** example ip - 12.34.56.78 :</h2>

<pre><code># apt-get install open-iscsi 
# systemctl --now enable open-iscsi
# reboot # if next command
# iscsiadm -m discovery -t sendtargets -p 98.76.54.32:3260  # should get next sample output
98.76.54.32:3260,1 iqn.2021-03.kvm:lun1
</code></pre>

<p>next is to change the target conf file</p>

<pre><code># ## use tab after nodes to auto complete the name
nano /etc/iscsi/nodes/iqn.2021-03.kvm\:lun1/98.76.54.32\,3260\,1/default
</code></pre>

<p>find the key and edit value according to the following</p>

<pre><code>node.startup = automatic
node.session.auth.authmethod = CHAP
node.session.auth.username = iscsi-user
node.session.auth.password = password
</code></pre>

<pre><code># systemctl restart open-iscsi 
# iscsiadm -m node --login     # should return successful 
</code></pre>

<p>now lets check if the partition is added</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/6b/3qsjo1vtzl58.png" alt="" /></p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/ki/2w7ef3s54fqd.png" alt="" /></p>

<p>Now its time to create the volume and display it</p>

<pre><code># pvcreate /dev/sda
# vgcreate vgiscsi /dev/sda
# vgs
</code></pre>

<p><img src="https://talk.lowendspirit.com/uploads/editor/va/xmjon2q0sicr.png" alt="" /></p>

<h2>C - Add the vg group to proxmox</h2>

<p><img src="https://talk.lowendspirit.com/uploads/editor/o2/evpqwx6bc0qa.png" alt="" /><br />
<img src="https://talk.lowendspirit.com/uploads/editor/sk/mc1azlbb9obj.png" alt="" /></p>

<p>next create and use the new lvm for creating a container like</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/pn/3mqfgs7392hq.png" alt="" /></p>

<p>and its done.</p>

<p>This was my experince of extending storage on a proxmox using iscsi. I hope you will have fun as much as i did.</p>

<p>Refs:<br />
<a href="https://www.howtoforge.com/tutorial/how-to-setup-iscsi-storage-server-on-ubuntu-2004-lts/" rel="nofollow">https://www.howtoforge.com/tutorial/how-to-setup-iscsi-storage-server-on-ubuntu-2004-lts/</a><br />
<a href="https://www.tecmint.com/setup-iscsi-target-and-initiator-on-debian-9/" rel="nofollow">https://www.tecmint.com/setup-iscsi-target-and-initiator-on-debian-9/</a></p>

<p><strong>Final notes:</strong> <br />
I would like to mention <a href="https://lowendspirit.com/index.php?p=/profile/gleert" rel="nofollow">@gleert</a> from <a href="https://www.naranja.tech/" rel="nofollow">https://www.naranja.tech/</a> for providing a great kvm with a lot of bandwidth. <br />
I promised him that if my install worked and ran smoothly for a while i will add this note.</p>
]]>
        </description>
    </item>
    <item>
        <title>How to Create and Setup a Debian KVM VPS with Proxmox VE 6 -- Part I -- Creation</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/2260/how-to-create-and-setup-a-debian-kvm-vps-with-proxmox-ve-6-part-i-creation</link>
        <pubDate>Wed, 16 Dec 2020 04:18:23 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>Not_Oles</dc:creator>
        <guid isPermaLink="false">2260@/index.php?p=/discussions</guid>
        <description><![CDATA[<p><strong>How to Create a Debian KVM VPS with Proxmox VE 6</strong></p>

<p>Contributed by Not_Oles, December 27, 2020</p>

<p><strong>Introduction</strong></p>

<p>This afternoon we're going to spin up a new Virtual Private Server ("VPS") running the <a rel="nofollow" href="https://debian.org">Debian GNU/Linux Operating System</a>. Our VPS will be a <a rel="nofollow" href="https://www.linux-kvm.org/page/Main_Page">Kernel-based Virtual Machine {"KVM")</a> utilizing the <a rel="nofollow" href="https://proxmox.com/en/proxmox-ve">Proxmox Virtual Environment.</a></p>

<p>Today's post will cover creation of the Virtual Machine ("VM") with the Proxmox web GUI ("Graphical User Environment") from the beginning up to the exciting moment when the Debian installer successfully starts. <img src="https://lowendspirit.com/plugins/emojiextender/emoji/twitter/smile.png" title=":)" alt=":)" height="18" /> The next post will cover the Debian installation, and the following post will cover configuration inside the newly installed Debian operating system.</p>

<p>We're going to be using an <a rel="nofollow" href="https://www.hetzner.com/dedicated-rootserver/ax51">AX51-NVME server at Hetzner</a> on which Proxmox already has been installed.</p>

<p><strong>Soyoustart, LXC, and Secure Shell Alternatives</strong></p>

<p>If you do not already have a Proxmox server, previous posts covering Proxmox <a rel="nofollow" href="https://lowendspirit.com/installing-proxmox-ve-6-2-at-soyoustart">installation</a> and <a rel="nofollow" href="https://lowendspirit.com/postinstall-configuration-of-proxmox-ve-6-2">postinstall configuration</a> at Soyoustart might be helpful.</p>

<p>Today's project involves a <a rel="nofollow" href="https://www.linux-kvm.org/page/Main_Page">KVM VPS.</a> Another <a rel="nofollow" href="https://lowendspirit.com/creating-our-first-lxc-vps-with-proxmox-ve-6-2-at-soyoustart">post in  this series</a> discusses creating <a rel="nofollow" href="https://linuxcontainers.org/lxc/introduction/">LXC container VPSes.</a></p>

<p>Today's post also assumes a bit of familiarity with <a rel="nofollow" href="https://www.ssh.com/ssh/">Secure Shell ("ssh"),</a> which is used here to obtain the Debian netinstall ISO file. However, alternate instructions also are given for uploading the ISO via the Proxmox web GUI.</p>

<p><strong>Download the ISO</strong></p>

<p>For today's KVM VPS we're going to use the standard Debian netinstall iso.</p>

<ul>
<li>Log in to the server and put the Debian iso in the right place for the Proxmox web GUI to find it.</li>
</ul>

<pre><code>$ ssh root@hels.example.com
Linux hels.example.com 5.4.78-2-pve #1 SMP PVE 5.4.78-2 (Thu, 03 Dec 2020 14:26:17 +0100) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sun Dec 13 06:26:17 2020 from 187.XXX.XXX.XXX
root@hels ~ # cd /var/lib/vz/template/iso
root@hels /var/lib/vz/template/iso # wget https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-10.7.0-amd64-netinst.iso
[ . . . ]
HTTP request sent, awaiting response... 200 OK
Length: 352321536 (336M) [application/x-iso9660-image]
Saving to: ‘debian-10.7.0-amd64-netinst.iso’

debian-10.7.0-amd64-netinst 100%[===========================================&gt;] 336.00M   108MB/s    in 3.2s    

2020-12-15 23:34:41 (104 MB/s) - ‘debian-10.7.0-amd64-netinst.iso’ saved [352321536/352321536]

root@hels /var/lib/vz/template/iso # 
</code></pre>

<p><strong>Verify the ISO</strong></p>

<ul>
<li>Next we download the checksums file and the signature file so we can verify the ISO:</li>
</ul>

<pre><code>root@hels /var/lib/vz/template/iso # wget https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/SHA512SUMS
--2020-12-16 04:50:34--  https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/SHA512SUMS
Resolving cdimage.debian.org (cdimage.debian.org)... 2001:6b0:19::165, 2001:6b0:19::173, 194.71.11.173, ...
Connecting to cdimage.debian.org (cdimage.debian.org)|2001:6b0:19::165|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 658
Saving to: ‘SHA512SUMS’

SHA512SUMS                  100%[===========================================&gt;]     658  --.-KB/s    in 0s      

2020-12-16 04:50:35 (20.5 MB/s) - ‘SHA512SUMS’ saved [658/658]

root@hels /var/lib/vz/template/iso # wget https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/SHA512SUMS.sign
--2020-12-16 05:03:56--  https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/SHA512SUMS.sign
Resolving cdimage.debian.org (cdimage.debian.org)... 2001:6b0:19::165, 2001:6b0:19::173, 194.71.11.165, ...
Connecting to cdimage.debian.org (cdimage.debian.org)|2001:6b0:19::165|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 833
Saving to: ‘SHA512SUMS.sign’

SHA512SUMS.sign             100%[===========================================&gt;]     833  --.-KB/s    in 0s      

2020-12-16 05:03:56 (35.1 MB/s) - ‘SHA512SUMS.sign’ saved [833/833]

root@hels /var/lib/vz/template/iso # 

</code></pre>

<ul>
<li>Next we check the signature on the SHA512SUMS file:</li>
</ul>

<pre><code><br />root@hels /var/lib/vz/template/iso # gpg --verify SHA512SUMS.sign SHA512SUMS
gpg: Signature made Sun 06 Dec 2020 02:46:09 AM CET
gpg:                using RSA key DF9B9C49EAA9298432589D76DA87E80D6294BE9B
gpg: Can't check signature: No public key
root@hels /var/lib/vz/template/iso # gpg --keyserver keyring.debian.org --recv DF9B9C49EAA9298432589D76DA87E80D6294BE9B
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key DA87E80D6294BE9B: public key "Debian CD signing key &lt;debian-cd@lists.debian.org&gt;" imported
gpg: Total number processed: 1
gpg:               imported: 1
root@hels /var/lib/vz/template/iso # gpg --verify SHA512SUMS.sign SHA512SUMS
gpg: Signature made Sun 06 Dec 2020 02:46:09 AM CET
gpg:                using RSA key DF9B9C49EAA9298432589D76DA87E80D6294BE9B
gpg: Good signature from "Debian CD signing key &lt;debian-cd@lists.debian.org&gt;" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: DF9B 9C49 EAA9 2984 3258  9D76 DA87 E80D 6294 BE9B
root@hels /var/lib/vz/template/iso # 

</code></pre>

<ul>
<li>We verify that the downloaded install file matches the SHA512sum:</li>
</ul>

<pre><code>root@hels /var/lib/vz/template/iso # sha512sum -c SHA512SUMS 2&gt;/dev/null | grep debian-10.7.0-amd64-netinst.iso 
debian-10.7.0-amd64-netinst.iso: OK
root@hels /var/lib/vz/template/iso # 
</code></pre>

<ul>
<li>Alternatively, we might already have the ISO downloaded and available locally, or it might be a custom ISO that we ourselves made. in these and similar cases, we can upload the ISO via the Proxmox web GUI.</li>
</ul>

<p>Log in to the web GUI at <a href="https://[Node_Name].example.com:8006" rel="nofollow">https://[Node_Name].example.com:8006</a>. Note that we must use http<strong>s</strong>. The server will send an empty response if we use http.</p>

<p>In the upper left hand Server View column of the web GUI, we expand the Node_Name by clicking the almost invisible "&gt;" to the left of the Node_Name. Then we click on "Local" and on "ISO Images." When we click on the "Upload" button above the list of images, a dialog box opens to start the upload.</p>

<p><img src="http://talk.lowendspirit.com/uploads/editor/u6/w647u9qbalzi.png" alt="" title="Uploading an ISO with Proxmox web GUI" /></p>

<p><strong>Create the Virtual Machine</strong></p>

<ul>
<li>In the upper right of the Proxmox web GUI, we click the "Create VM" button.</li>
</ul>

<p><img src="http://talk.lowendspirit.com/uploads/editor/j3/fw9y3e3a8ig5.png" alt="" title="Create VM Button in Proxmox web GUI" /></p>

<ul>
<li>The "General" Tab is the first tab in the "Create: Virtual Machine" dialog.</li>
</ul>

<p>Proxmox assigns a VM ID number, by default beginning with 100, but we might prefer to use a custom numbering scheme.</p>

<p>By default, let's use the reverse DNS provided by Hetzner as the name of the server.</p>

<p><img src="http://talk.lowendspirit.com/uploads/editor/f2/04ys3908rivz.png" alt="" title="General Tab" /></p>

<p>Click the "Next" button to continue to the OS tab.</p>

<ul>
<li>In the OS Tab, we select from the drop down the OS image we previously downloaded and verified. We also check to see that the OS type and kernel version are correct.</li>
</ul>

<p><img src="http://talk.lowendspirit.com/uploads/editor/g4/kahkbn3txzzc.png" alt="" title="OS Tab" /></p>

<ul>
<li>The System Tab is next. In the System Tab, we get to choose a graphics card, running <a rel="nofollow" href="https://pve.proxmox.com/wiki/Qemu-guest-agent#Introduction_-_What_is_qemu-guest-agent">Qemu Agent</a>, and the SCSI hard disk controller. Let's go with the defaults.</li>
</ul>

<p><img src="http://talk.lowendspirit.com/uploads/editor/ec/xc07rwuralka.png" alt="" title="System Tab" /></p>

<ul>
<li>In the Hard Disk Tab, let's increase the disk size allocation to 100 GB and otherwise go with the defaults.</li>
</ul>

<p><img src="http://talk.lowendspirit.com/uploads/editor/d4/9fbwjsl7ncwc.png" alt="" title="" /></p>

<ul>
<li>In the CPU Tab, let's give this user 8 cores.</li>
</ul>

<p><img src="http://talk.lowendspirit.com/uploads/editor/fa/9li4h21x9eso.png" alt="" title="" /></p>

<ul>
<li>In the Memory Tab, let's give this user 8096 MiB.</li>
</ul>

<p><img src="http://talk.lowendspirit.com/uploads/editor/9c/4os4kfou6r6t.png" alt="" title="" /></p>

<ul>
<li>In the Network Tab we can go with the defaults.</li>
</ul>

<p><img src="http://talk.lowendspirit.com/uploads/editor/as/divvgnukiv0t.png" alt="" title="" /></p>

<ul>
<li>In the Confirm Tab, let's click "Start after created."</li>
</ul>

<p><img src="http://talk.lowendspirit.com/uploads/editor/wu/xtlmcugljhpq.png" alt="" title="" /></p>

<ul>
<li>Selecting the newly created VM and "Console" lets us see the successful Debian boot screen! <img src="https://lowendspirit.com/plugins/emojiextender/emoji/twitter/smile.png" title=":)" alt=":)" height="18" /></li>
</ul>

<p><img src="http://talk.lowendspirit.com/uploads/editor/b2/4xnpdqncaovd.png" alt="" title="" /></p>

<p><strong>Conclusion</strong></p>

<p>At this point, the VM has been created, and Debian server is ready to be installed inside the newly created VM.</p>
]]>
        </description>
    </item>
    <item>
        <title>How to host Your WordPress website for less than 10 US Dollars Per Year</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/2258/how-to-host-your-wordpress-website-for-less-than-10-us-dollars-per-year</link>
        <pubDate>Tue, 15 Dec 2020 09:40:30 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>vyas</dc:creator>
        <guid isPermaLink="false">2258@/index.php?p=/discussions</guid>
        <description><![CDATA[<h1>WordPress Hosting on a Budget</h1>

<h3>Summary</h3>

<p>In this post, I will discuss different ways to set up a WordPress website in under 10 US Dollars a year. Learn why I decided to take this approach, and how you can find frugal web hosting for an entry level blog or portfolio site.</p>

<hr />

<p><strong>Note</strong></p>

<p>I had originally set out to discuss different ways to install WordPress. As I began writing it, it became evident that the LES readers might also be interested in learning about <strong>hosting a WordPress site in under 10 US dollars a year</strong>.  We will cover that in Part II of this 2 post series.</p>

<h3>What you can expect to read in Part I? </h3>

<p>In this part, I have elaborated my reasons for doing so. For more discussions related to WordPress, you can visit the <a rel="nofollow" href="https://talk.lowendspirit.com/discussion/1501/all-things-wordpress-discussions">All Things WordPress Discussion</a> in the LowEndSpirit Forum.</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/kw/wb37wpy9dv7b.png" alt="feature image for blog post on WordPress. Dec 2020 by Amar Vyas, amarvyas.in" width="500" /></p>

<h2>Introduction</h2>

<p>During the recently concluded <a rel="nofollow" href="https://talk.lowendspirit.com/discussion/comment/46506#Comment_46506">Black Friday/ Cyber Monday 2020 (BFCM2020) deals</a> on LowEnd Spirit and elsewhere,  you may have picked up a VPS or two or a Shared Hosting Plan here and there. Which may have left you wondering,<br />
"What do I do with all these hosting plans?"</p>

<blockquote><div>
  <p>The more experienced hands may use their BFCM2020 purchase for specific projects such as Virtual Private Server for  Plex server, a NAT for a VPN, shared hosting for parking domains, and so on.</p>
</div></blockquote>

<p>In many cases, you, the buyer of these Black Friday deals would want to set up some soft of a website. Maybe you are not a beginner, but you might probably the ' go to ' person for friends, neighbours, relatives or significant others. They may often rely on for advise. Now lets' say one or more of them want to set up a website.</p>

<h3>A website in 2021 ? You must be joking!</h3>

<p>In spite of the barrage of Social Media sites and apps, the number of websites has actually increased the over the years For those interested in numbers, <a rel="nofollow" href="https://www.broadbandsearch.net/blog/internet-statistics">this site has some facts and figures</a> to peruse. Some of the data and the sources in such surveys or statistics might need a second look, but such information does offer a perspective.</p>

<p>The relative convenience of setting up a website these days seems to be a contributing factor for the increasing number of websites. The convenience could include:</p>

<ul>
<li><p>Beginner friendly Hosting, either through SAAS providers like <a rel="nofollow" href="https://squarespace.com">Squarespace</a> and <a rel="nofollow" href="https://wix.com">Wix</a>, or <br />
via shared or managed hosting that uses one click installers like <a rel="nofollow" href="https://softaculous.com">Softaculous</a> and <a rel="nofollow" href="https://installtron.com">Installtron</a>.</p></li>
<li><p>Less complexity of setting up a website due to 'no code' solutions</p></li>
<li>Cost of hosting, if we exclude the recent cPanel hike and its coming impact.</li>
<li>Tools for backup and updates</li>
<li>Ability to host in multiple languages</li>
</ul>

<p>Rather than pondering on these factors further, let us move on to our main discussion!</p>

<h3>WordPress Hosting, the Frugal Way</h3>

<p>To keep things simple, I have structured this post in two segments. In the first part, I will provide a quick overview of the  ecosystem for WordPress hosting, and some of the providers in this space. Lets call this an appetizer for the main topic of discussion.</p>

<p>In the  Part II we will look at the different ways of setting up WordPress under different hosting configurations. This is the most important segment, where we will talk about how to host a WordPress site for under 10 US  Dollars a year. Our aim is not to go cheap, but to do so in a frugal manner. If you are starting out today, or are migrating a low traffic website, this is the section you should pay close attention to. I will talk about issues like traffic, load testing, basic configurations (or the "stack" of themes and plugins used by me.  Also find included some links, resources and takeaways from my testing.</p>

<hr />

<h3>The Mad Rush for WordPress Hosting</h3>

<p>Depending on which source you look up, the marketshare of WordPress in the web hosting space is on the rise. The numbers quoted often are: "WordPress occupies 40 % marketshare of all websites" to "more than 50% of all websites that use a content management system, use WordPress." <a rel="nofollow" href="https://w3techs.com/technologies/details/cm-wordpress">W3techs also reflects on this trend</a>.</p>

<p>Without flying the flag on behalf of <a rel="nofollow" href="https://automattic.com">Automattic</a>, the company behind WordPress, let us look at the Universe of WordPress Hosting.  This is a complex system with hosts, plugin and theme developers, website designers, social media and security consultants, content specialists, marketers, e and woo commerce specialists, and so forth. WordPress is open source and basic hosting and some themes and plugins are available at little to no cost. But the professional services (content, search engine optimization, security, etc..) might cost you a lot. So is the case with managed or specialized hosting.</p>

<p><strong>Our focus is on WordPress Hosting, so let us take a look at it closely.</strong><br />
This pricing for WordPress hosting is a very interesting area where you have <a rel="nofollow" href="https://wpvip.com">WordPress VIP</a> from automatic themselves, which exceeds US dollars 5,000  a month. In the mid range, there are pricing plans from a whole array of providers that can run into hundreds of US dollars a year.</p>

<p>If you look up managed WordPress hosting plans typically start at 10 to 15 US dollars a month at entry level, but the median price or most providers start their plans at 30 or 35 US dollars. Annually, the might run into excess of $300. If you look at the specifications that they provide, you would notice that the specifications or page views are not very high. <a rel="nofollow" href="https://www.wpbeginner.com/managed-wordpress-hosting/">Many of the providers offer similar set of features as this list shows</a> .</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/s2/emvswi26kzmk.png" alt="list of WordPress Hosting providers. A Vyas, Dec 2020.amarvyas.in" width="450" /></p>

<p>This may include CDN or content delivery network, image optimization etc. The key reason for pricing is because of support. But evaluating support is akin to wading through tricky waters. In recent weeks I have spent quite a bit of time reading up on customer service issues and overall service levels of some of these providers. Siteground in particular seems to be the most talked about (and often maligned) provider, largely because of their 'bait and switch' pricing and recent decision to limit WordPress support requests.</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/g8/h032z883nnvy.png" alt="pricing plan for WP Optim, Dec 2020" width="400" /></p>

<p>Pricing plan for WP Optim, used for illustration<br /></p>

<h3>Not everyone needs Feature-Rich Hosting</h3>

<p>A typical user may have a question like</p>

<blockquote><div>
  <p>"I am looking at hosting a simple website which will have about 50 posts and around 200  images. Do I really need to spend over 200 dollars a year on hosting?"</p>
</div></blockquote>

<p>If such a question is posed in the webhosting groups on Facebook or other sites, you will receive a list of provider recommendations that may look like the below table.</p>

<p>Before answering a yes or no, to the above question, I usually ask a set of qualifier questions myself. Many of which seem logical (atleast to me). For purpose of our discussion,</p>

<ul>
<li>We will focus on a blog or image / portfolio site only.</li>
<li>Deeply discounted shared hosting plans from the likes of Hostinger and EIG companies are excluded.</li>
</ul>

<p>Sample Checklist of questions for WordPress Hosting selection</p>

<pre>
- What kind of site do you have? 
(i.e.) Is it a Blog, portfolio, membership site, store with woo commerce etc..? 
- Do you plan to use a Content Delivery Network (CDN)? Or, do you have one currently?
- If you are looking to move hosts, what are the current (shared) hosting specifications?
- Where is your hosting located, and where do the maximum visitors come from?
- Do you use a monitoring service like Hetrix tools or Uptime Robot to 
monitor the website uptime?
- What is the current hosting plan fees and what is your appetite for a higher plan/ upgrade?
- Are you comfortable with a DIY setup, or do you need handholding? (i.e for an existing site,
 do you need help with migration, or for a new site do you need help with setting up the site ? )
</pre>

<p>Keeping those questions in focus, we will ddress some of these qustions in the second part of this post. Till then. I leave you with the screenshot of a sample website creted for this blog post.<br />
<img src="https://talk.lowendspirit.com/uploads/editor/y8/ygfx27k755te.png" alt="screenshot from Blocksy Theme on ClassicPress. Amarvyas.in Dec 2020" width="500" /></p>

<p>Blocksy theme on ClassicPress: giving a Frugal WordPress Website with a modern look.</p>

<p>Resources: <br />
1. You may also want to read my  accompanying post o NAll Things WordPress discussion in the LES Forum.  <a rel="nofollow" href="https://talk.lowendspirit.com/discussion/comment/50067/#Comment_50067">Downside of Expensive WordPress Hosting Plans</a><br /><br />
2.Prices for "premium" or "Managed" WordPress Hosting Providers <br />
</p><details><summary>Click the arrow to expand. </summary><br />
<a rel="nofollow" href="https://closte.com/pricing">Closte</a><br /><br />
<a rel="nofollow" href="https://10web.io/pricing/">10 Web</a> <br /><br />
<a rel="nofollow" href="https://kinsta.com/plans/">Kinsta</a> <br /><br />
<a rel="nofollow" href="https://pagely.com/plans-pricing/">Pagely</a><br /><a rel="nofollow" href="https://www.siteground.com/wordpress-hosting.htm">SiteGround</a> <br /><br />
<a rel="nofollow" href="https://www.liquidweb.com/products/managed-wordpress/">LiquidWeb</a> <br /><br />
<a rel="nofollow" href="https://getflywheel.com/pricing/">Flywheel</a><br /><br />
Nestify<br /><br />
<a rel="nofollow" href="https://rocket.net">Rocket Web Hosting</a> <br /><br />
<a rel="nofollow" href="https://wordpress.com/premium/">WordPress Premium</a><br /><br />
<a rel="nofollow" href="https://wpengine.com/more/specialoffer/">WP Engine</a><br /><br />
<a rel="nofollow" href="https://pressable.com/pricing/">Pressable</a><br /><br />
<a rel="nofollow" href="https://pantheon.io/plans/pricing">Pantheon</a><br /><br />
</details>

<hr />

<p>For any feedback and suggestions about this post, please leave a comment below or contact <a href="https://lowendspirit.com/index.php?p=/profile/vyas" rel="nofollow">@vyas</a> in the LES forum. All screenshots are taken from websites of respective providers. All other images are created by <a rel="nofollow" href="https://amarvyas.in">A Vyas</a>, December 2020.</p>
]]>
        </description>
    </item>
    <item>
        <title>Resize your KVM VPS disk partition, 2 methods and bonus tip to reclaim disk space - Easy mode.</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/1353/resize-your-kvm-vps-disk-partition-2-methods-and-bonus-tip-to-reclaim-disk-space-easy-mode</link>
        <pubDate>Tue, 30 Jun 2020 13:57:58 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>LES_Blog</dc:creator>
        <guid isPermaLink="false">1353@/index.php?p=/discussions</guid>
        <description><![CDATA[<p><em>Written by Anthony Smith, 1 July 2020</em><br />
<small>Article was migrated from WordPress to Vanilla in March 2022</small></p>

<p>Did you upgrade your VPS and it looks like the disk is still the same size? Did you migrate your VPS to another host using the method in <a rel="nofollow" href="https://lowendspirit.com/migrate-a-kvm-vps-from-one-host-to-another-easy-mode" title="part 1 of this easy mode series">part 1 of this easy mode series</a> and the target disk was bigger so you want to make use of that extra space?</p>

<p>I will show you in a few simple methods below with examples of <em>resize2fs</em> and <em>growpart</em> and also the super simple point and click GParted.</p>

<hr />

<p>In the following image we get a look at the disk and partition size before any changes have been made so we have a good starting point to work from, we can see it is a 10GB disk with a single partition <code>/dev/vda1</code> being pretty much the full 10GB.</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/cr/7ik1nkkkz551.png" alt="" title="" /></p>

<p>I then resized the disk up to 15GB in the backend as you can see in the next image, the physical disk is now 15GB however the partition <code>/dev/vda1</code> is still only 10GB.</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/fb/ifc9scgimrlb.png" alt="" title="" /></p>

<p>Starting with the GParted method we need to boot the VPS into a rescue mode that includes GParted, most hosts will offer some ISO with GParted included or just a plain GParted disk, I tend to use sysrescuecd as it usually has the relevant tool-set to complete most tasks.</p>

<p>Now you need to change the boot order and mount the ISO of choice (that includes GParted).</p>

<p>Boot order:</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/rr/2rxm9e2bg04s.png" alt="" title="" /></p>

<p>Mount ISO and reboot:</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/fh/o0binhj8yzbk.png" alt="" title="" /></p>

<p>Clicking the reboot button in SolusVM is what re-writes your config file on the backend so that the ISO mounts and the boot order changes, in Virtualizor you need to 'Stop' then 'Start', reboot, for some reason does not update the config file so the ISO will not mount.</p>

<p>You will then be able to open a VNC session using the built-in HTML5 VNC viewer or a direct VNC connection using a desktop client.</p>

<p>If you used sysrescuecd you should see something similar to this:</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/2y/9yx4zpmqkl6p.png" alt="" title="" /></p>

<p>Pick the default option and when the rescue mode drops you at a prompt, run: <code>startx</code> as shown in the next image:</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/jp/pcgop0tfcnra.png" alt="" title="" /></p>

<p>Give it a minute or so and the graphical session should start and look like this:</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/2j/8bpcgceuzvvm.png" alt="" title="" /></p>

<p>You will see a shortcut to GParted on the bottom left, in other distros you may find it via the menu system.</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/cz/vkf7b7fj7rnz.png" alt="" title="" /></p>

<p>After you launch GParted you will see a disk overview and you will see that extra 5GB of unused space:</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/ub/72amy53pysgw.png" alt="" title="" /></p>

<p>Right-click on the first partition on the left labelled <strong>/dev/vda1</strong> and select resize/move:</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/zk/rrrbj1egrb0e.png" alt="" title="" /></p>

<p>Then grab the furthest extent of the partition and drag it to the right and click the 'resize/move' button.</p>

<p>Before:</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/6y/bfldxltyuqy8.png" alt="" title="" /></p>

<p>After:</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/5l/741hd7wcxrc1.png" alt="" title="" /></p>

<p>Then click the tick to confirm the operation:</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/16/z8xdggd5l2gt.png" alt="" title="" /></p>

<p>Confirm:</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/id/77s91713vcdy.png" alt="" title="" /></p>

<p>That should be it, the partition should now occupy all of the free space on the hard disk.</p>

<p>You can now shut down the rescue mode by unmounting the ISO and changing the boot order back:</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/t3/2hsxls3aixlv.png" alt="" title="" /></p>

<p>Tip: Hit power off first then reboot, you will not risk any data while in rescue mode without mounted partitions so no need to wait for the full shutdown, this saves you 30 seconds or so.</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/26/612hr7h8arym.png" alt="" title="" /></p>

<p>Now when you log in to your VPS again you will see that the partition size has grown:</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/e1/a99qfsbj4o79.png" alt="" title="" /></p>

<p>Congratulations you are all done!</p>

<hr />

<p>But what if you feel like using GParted was cheating, more like 'Super-easy' mode and you want to feel like you learned what is actually happening rather than just knowing where to click?</p>

<p>I hear you!, let's do it again then in a slightly different way, once again in the backend, I have increased the disk size on the same VPS to 20GB (an extra 5GB) as seen in the image below.</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/ho/uwmhzh8t3wcg.png" alt="" title="" /></p>

<p>Once again, get in to rescue mode or boot with the sysrescuecd iso, I won't repeat the same images as above, the process is identical however just get to the point whereby you get a prompt do <strong>not</strong> run startx.</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/hu/lihlaf9ge90q.png" alt="" title="" /></p>

<p>Now running <code>fdisk -l /dev/vda</code> we can see that the disk <strong>vda</strong> is 20GB and the first partition <strong>vda1</strong> is 15GB, to extend this run:</p>

<p><code>growpart /dev/vda 1</code> <em>note the space between vda and 1</em></p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/dm/x7wgpcg3yl8z.png" alt="" title="" /></p>

<p>This (growpart) will not always automatically grow the filesystem but what it is useful for is forcing the kernel to register the new disk size as some older kernels and tools may fail with you run resize2fs with an error along the lines of "Nothing to do"</p>

<p>So next we will manually run <code>resize2fs /dev/vda1</code></p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/bi/f41p1p9dkune.png" alt="" title="" /></p>

<p>As you can see in the above image the increased partition size is verified with <code>lsblk /dev/vda</code> which will show the disk and the partition sizes.</p>

<p>Power off the VPS, change the boot order back to Hard disk first again and reboot.</p>

<p>Now when you log in to your actual OS you can verify that the partition has in fact expanded:</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/nw/9y9fe042t8ez.png" alt="" title="" /></p>

<p><strong>BONUS TIP</strong></p>

<p>The ext4 filesystem most commonly used, certainly for Linux VPS templates anyway will as standard reserve 5% of your disk space in case you run out, it is like a buffer zone to prevent catastrophe.</p>

<p>It is a relic from ext3 which was released in 2001, at that time the average physical hard disk in use was between 10GB and 20GB.</p>

<p>These days disks even virtual ones are significantly bigger and you take very regular backups... right? so 5% is often really over the top.</p>

<p>You can reduce this to 0 however I seriously do not recommend that, but you can sometimes gain a good little chunk of disk space back by pushing the reserve down to 1%.</p>

<p>This can be done live, no need to reboot or go in to rescue mode, just run: <code>tune2fs -m 1 /dev/vda1</code></p>

<p>The 1 is the % of space to reserve for the partition you select, in this case <strong>/dev/vda1</strong></p>
]]>
        </description>
    </item>
    <item>
        <title>Installing Proxmox VE 6.2 at SoYouStart</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/1298/installing-proxmox-ve-6-2-at-soyoustart</link>
        <pubDate>Mon, 22 Jun 2020 02:16:58 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>Not_Oles</dc:creator>
        <guid isPermaLink="false">1298@/index.php?p=/discussions</guid>
        <description><![CDATA[<p><strong>Installing Proxmox VE 6.2 at SoYouStart</strong><br />
<em>How to (almost) become a Hosting Provider for only US$29.95 and in only 20 minutes</em></p>

<p>Contributed by <a href="https://lowendspirit.com/index.php?p=/profile/Not_Oles" rel="nofollow">@Not_Oles</a> -- June 21, 2020</p>

<p><strong>Introduction</strong></p>

<p>Every interaction with a website requires a <em>client</em> (often a web browser) and also a <em>server.</em> Servers are computers on the internet which transmit content in response to requests sent by clients. The server which supplies the specific content responsive to specific requests often is called the <em>host</em> for that content. Thus, a <em>hosting provider</em> is a person or a company which provides servers that can host content.</p>

<p><strong>OVH, SoYouStart, and Kimsufi</strong></p>

<p><a rel="nofollow" href="https://www.ovh.com/world/">OVH</a>, an international company based in France, is an example of a hosting provider. <a rel="nofollow" href="https://us.ovhcloud.com/about/company/timeline">As of 2017,</a> OVH had over 2,000 employees, 27 data centers worldwide, and over 300,000 active servers.</p>

<p>In addition to selling under its own name, OVH also has two additional brands: <a rel="nofollow" href="https://www.soyoustart.com/us/">SoYouStart</a>, which provides less expensive servers, and <a rel="nofollow" href="https://www.kimsufi.com/us/en/servers.xml">Kimsufi</a>, which provides very low cost servers.</p>

<p>As appropriate in the world of Low End Spirit, we will be working here today with one of the lowest cost SoYouStart servers. Our server was rented as a great Boxing Day deal for just US$29.95 per month.</p>

<p>Here are our server's specs: SYS-LE-1 Server - Intel Xeon D-1521 - 32GB DDR4 ECC 2133MHz - 2x 2To HDD SATA Soft RAID. SoYouStart servers are advertised as 250 Mbps bandwidth, which is symmetrical and unmetered. However <em>ssssh!</em> a few SoYouStart servers seem to be being delivered with 500 Mbps or even 1 Gbps.</p>

<p><strong>Avoiding waste of server resources</strong></p>

<p>Even our inexpensive SoYouStart server is bigger and more powerful than what is needed for the majority of websites or web services. And a latest generation web server might offer ten or twenty times the power of ours. Thus, to avoid the waste of server capacity which would result if each website or web service each had to use its own, individual <em>dedicated, bare metal server,</em> many methods have been developed for sharing or "virtualizing" server capacity.</p>

<p><strong>Proxmox Virtual Environment</strong></p>

<p><a rel="nofollow" href="https://proxmox.com/en/">Proxmox Virtual Environment ("PVE")</a> is a free, <a rel="nofollow" href="https://git.proxmox.com/">open source</a> server virtualization administrative system from an Austrian company. Proxmox has seen wide adoption. Proxmox software is designed to divide and share bare metal host servers and their resources among multiple <em>virtual private servers (VPS).</em> Proxmox VE 6.2 was <a rel="nofollow" href="https://forum.proxmox.com/threads/proxmox-ve-6-2-released.69647/">released on May 12, 2020.</a></p>

<p>Proxmox offers a <a rel="nofollow" href="https://pve.proxmox.com/wiki/Graphical_User_Interface">Graphical User Interface ("GUI")</a> through which one can administer, via a web browser, Proxmox itself as well as Proxmox host servers ("nodes") and  VPSes installed by Proxmox. Proxmox has <a rel="nofollow" href="https://pve.proxmox.com/wiki/Main_Page">an extensive wiki</a> and an <a rel="nofollow" href="https://forum.proxmox.com/">active forum</a>. <a rel="nofollow" href="https://proxmox.com/en/proxmox-ve/pricing">Proxmox paid support subscriptions</a> are available.</p>

<p>Proxmox is programmed in the <a rel="nofollow" href="https://pve.proxmox.com/wiki/Perl_Style_Guide">PERL ("Practical Extraction and Report Language") programming language.</a> Because Proxmox is programmed in PERL, Proxmox VE users have, in addition to the GUI, the option of controlling everything via <a rel="nofollow" href="https://www.proxmox.com/en/news/listid-1/mailid-89-useful-commands-for-your-proxmox-ve-cli?tmpl=component">the traditional command line interface ("CLI").</a></p>

<p><strong>The SoYouStart Control Panel</strong></p>

<p>OVH is <a rel="nofollow" href="https://proxmox.com/en/partners/hosting-partner">a Proxmox Hosting Partner</a>, and Proxmox is available on the SoYouStart Control Panel for install as one among the many OVH supported operating systems.</p>

<p>Besides installing supported operating systems, and somewhat similar to the OVH and the Kimsufi control panels, the SoYouStart Control Panel includes facilities for:</p>

<ul>
<li>Rescue Mode -- booting the server into an entirely memory resident operating system</li>
<li>Netboot -- booting the server's resident operating system on a kernel obtained over the network</li>
<li>IPMI -- Intelligent Platform Management Interface, <a rel="nofollow" href="https://www.supermicro.com/en/">Supermicro's</a> method of managing the server remotely, sometimes referred to as Keyboard, Video monitor, Mouse (KVM)</li>
<li>Failover IP assignment and transfer -- add or remove additional IP addresses or transfer IP addresses from one server to another</li>
<li>Setting Reverse DNS</li>
<li>Real time server monitoring</li>
<li>Backup</li>
<li>Quite a bit more</li>
</ul>

<p>One possible advantage of using Proxmox on OVH is that the Proxmox OVH install seems to use kernels from Proxmox instead of the OVH-customized, real time monitoring-enabled kernels present in the OVH-Control-Panel-installed versions of some other operating systems. On Proxmox, one thus gets newer kernels faster, while paying the price of losing OVH's real time monitoring in the OVH Control Panel. As of this writing, the Proxmox kernel version is SMP PVE 5.4.44-1 (Fri, 12 Jun 2020 08:18:46 +0200) x86_64, while the <a rel="nofollow" href="https://last-public-ovh-kernel.snap.mirrors.ovh.net/builds/">latest OVH version</a> is 4.19.128.</p>

<p><strong>Proxmox OS Install process</strong></p>

<p>We're now going to run through the Control Panel's Proxmox install process,. Note that installing Proxmox is quite similar to installing any of the other supported Operating Systems. So, for example, if you wanted to install Debian or Ubuntu or CentOS, the install process looks very much the same. Indeed, Proxmox runs on Debian, and so a Proxmox install basically is an extended Debian install.</p>

<p>What really does look quite different, however, and lies beyond today's scope, is installing an unsupported OS like OpenBSD by using the Rescue System or the IPMI. Suffice it to say that almost anything compatible with the hardware should be installable and should work just fine, though getting it installed and working sometimes can be quite tricky.</p>

<p><strong>Starting the Install</strong></p>

<p>On a newly rented server the first view of the Control Panel shows a pop-up flagging the Reinstall button along with a message saying something like, "Your server is ready to be installed." On a server which already has had an install, we begin by clicking the Reinstall button in the upper right:</p>

<p><img src="http://talk.lowendspirit.com/uploads/editor/dp/salela464qly.png" alt="" title="Starting the Install" /></p>

<p><strong>Default or Custom Install</strong></p>

<p>The Installer presents us with an opportunity to select the default install or a custom install. The default install simplifies the whole processes by bypassing the opportunity to change the disk partitioning. The defaults are fine for many people, but maybe we will want to make a change, so, let's check the box for "Custom Installation:"</p>

<p><img src="http://talk.lowendspirit.com/uploads/editor/4r/9exn9oda6b1e.png" alt="" title="Check box for Custom Installation" /></p>

<p><strong>OS Template selection</strong></p>

<p>Next we select the Proxmox VE 6 operating system template. Note that previous versions of Proxmox also are available further down the list. If we were installing another supported operating system besides Proxmox, this is the place where we would select it.</p>

<p><img src="http://talk.lowendspirit.com/uploads/editor/mz/a9v23yxyydtk.png" alt="" title="Select Proxmox VE 6" /></p>

<p><strong>Disk RAID, partitioning, and formatting</strong></p>

<p>At the disk partitioning and formatting stage, we have the opportunity, on servers with more than one disk, to use the disks redundantly. When one disk constantly is mirroring another disk in a <a rel="nofollow" href="https://en.wikipedia.org/wiki/RAID"><em>Redundant Array of Independent Disks</em> (RAID)</a>, we always have two copies of all our data. When one disk fails, our data is safe on the mirror disk. The cost of RAID, with two disks total, is a 50% reduction in disk capacity.</p>

<p>For production, many people, including me, would enable RAID. Thus, the default of the OVH installer is to have RAID Level 1 mirroring enabled. RAID 1 mirroring requires two disks.</p>

<p>But, here, for our non-production, test server, not using RAID 1 will double our disk capacity and also might permit us to test, on the second disk, additional partition types, file systems, or operating systems not available through the OVH installer. So, here, let's disable RAID 1 by clicking the checkbox for "Install on the first disk only."</p>

<p>If you want to keep RAID 1 enabled, simply leave the "Install on the first disk only" checkbox unchecked.</p>

<p><img src="http://talk.lowendspirit.com/uploads/editor/b7/0hcb7h301q8b.png" alt="" title="First disk only" /></p>

<p>Next, we review the default partitioning scheme and make any desired changes. With First Disk Only selected the default partitioning scheme is as follows:</p>

<table>
<thead>
<tr>
  <th align="center">Order</th>
  <th align="center">Type</th>
  <th align="center">File system</th>
  <th align="center">Mount point</th>
  <th align="center">Size</th>
</tr>
</thead>
<tbody>
<tr>
  <td align="center">1</td>
  <td align="center">primary</td>
  <td align="center">ext4</td>
  <td align="center">/</td>
  <td align="center">20000 MB</td>
</tr>
<tr>
  <td align="center">2</td>
  <td align="center">primary</td>
  <td align="center">swap</td>
  <td align="center">swap</td>
  <td align="center">1024 MB</td>
</tr>
<tr>
  <td align="center">3</td>
  <td align="center">lv</td>
  <td align="center">ext4</td>
  <td align="center">/var/lib/vz</td>
  <td align="center">Space remaining</td>
</tr>
</tbody>
</table>

<p>Here we consider two changes. First, changing the root partition ("/") to increase the size. The default 20,000 MB size is fine for the base system, and often, on production systems, one conservatively might want to avoid making any changes at all in the base system or its layout. But, for example, the base system does not include even the Proxmox manual pages. Since plenty of space is available, and since we might want to add a few things, let's increase the root partition size to 500,000 MB.</p>

<p>The 1024 MB swap space also might be fine, especially in a system, as here, with lots of RAM. Remember, we have 32 GB RAM in the host system. But probably we will not assign the VPSes that we will create with Proxmox access to the entire 32 GB memory. Therefore, a little more swap might help some of the smaller VPSes complete memory intensive projects without running out of memory. Let's set the swap to 16,384 MB, an amount about equal to half the total RAM.</p>

<table>
<thead>
<tr>
  <th align="center">Order</th>
  <th align="center">Type</th>
  <th align="center">File system</th>
  <th align="center">Mount point</th>
  <th align="center">Size</th>
</tr>
</thead>
<tbody>
<tr>
  <td align="center">1</td>
  <td align="center">primary</td>
  <td align="center">ext4</td>
  <td align="center">/</td>
  <td align="center"><strong>500000 MB</strong></td>
</tr>
<tr>
  <td align="center">2</td>
  <td align="center">primary</td>
  <td align="center">swap</td>
  <td align="center">swap</td>
  <td align="center"><strong>16384 MB</strong></td>
</tr>
<tr>
  <td align="center">3</td>
  <td align="center">lv</td>
  <td align="center">ext4</td>
  <td align="center">/var/lib/vz</td>
  <td align="center">Space remaining</td>
</tr>
</tbody>
</table>

<p>Here's an image of the installer at the moment before confirmation of the resized root and swap:</p>

<p><img src="http://talk.lowendspirit.com/uploads/editor/si/y63munaqdjgi.png" alt="" title="Root and swap resized" /></p>

<p><strong>Hostname,  SSH key, and Post-install script</strong></p>

<p>Next we tell the installer our fully qualified hostname. Also, we have an opportunity to select an ssh key from among the keys associated with our SoYouStart account. And, if we wish, we can link to a post-install script:</p>

<p><img src="http://talk.lowendspirit.com/uploads/editor/q1/0d4ez06u4g25.png" alt="" title="Hostname" /></p>

<p><strong>Confirmation</strong></p>

<p>Finally we get our last chance to cancel or else to go ahead and launch the install:</p>

<p><img src="http://talk.lowendspirit.com/uploads/editor/cj/mawibk9dmmhm.png" alt="" title="Confirmation dialog" /></p>

<p><strong>Success</strong></p>

<p>As soon as we confirm the install, all the magic begins to happen behind the scenes. On the Control Panel, the third entry in the left hand column, "OS," comes alive. It says something like "Initializing the install process," followed by "Hardware checks," followed by "Admin password."  The install process continues, through "Partitioning and formatting," "Deploying OS," and "Rebooting." By this time, approximately ten minutes have passed.</p>

<p>The next and last stage takes about ten additional minutes for a total of twenty minutes all together. During the last stage, the Panel says, "Waiting for services to be up." Finally, we see a green "Success" pop-up, and also our phone beeps to announce the arrival of OVH's email confirming the install:</p>

<p><img src="http://talk.lowendspirit.com/uploads/editor/px/vc1j15ao4iai.png" alt="" title="Success!" /></p>

<p><strong>What's next after a successful install?</strong></p>

<p>After our successful install we surely can congratulate ourselves, since now we're "(almost) ready" <img src="https://lowendspirit.com/plugins/emojiextender/emoji/twitter/smile.png" title=":)" alt=":)" height="18" /> to begin serving profiting <img src="https://lowendspirit.com/plugins/emojiextender/emoji/twitter/smile.png" title=":)" alt=":)" height="18" /> as full fledged Hosting Providers. <img src="https://lowendspirit.com/plugins/emojiextender/emoji/twitter/smile.png" title=":)" alt=":)" height="18" /> Let's now take a quick look at what else might be needed.</p>

<p>Regarding our newly installed test server there remain at least: updating, upgrading, setting up the firewall, setting up fail2ban, downloading VPS OS templates, and actually creating VPSes. The next post will cover how to do these remaining steps with both the Proxmox web GUI and the command line.</p>

<p>In addition to the test server, we need enough additional RAID enabled production servers to provide the capacity needed by our customer base.</p>

<p>On the business administration side, if not already done, we need to establish our hosting company as a formal business under the laws of the jurisdiction which will be our home base. We need to build a website for our hosting business, add a payment gateway, and go on a marketing campaign unless we're already drowning in customer requests. Finally, we need to ask for our Hosting Provider tag so we can advertise on LES if we have space for additional customers.</p>
]]>
        </description>
    </item>
    <item>
        <title>Debian unattended Installation using a preseed file</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/1762/debian-unattended-installation-using-a-preseed-file</link>
        <pubDate>Sat, 12 Sep 2020 18:39:50 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>ehab</dc:creator>
        <guid isPermaLink="false">1762@/index.php?p=/discussions</guid>
        <description><![CDATA[<p>I find installing Debian via VNC a time consuming process. Luckily there is an option to install Debian "unattended". You can do so using a preseed file to feed the selections and able to include advanced script customizations. If you come from CentOs World, then think of it as a kickstart file.</p>

<p>This is not new information, I just wanted the wonderful LES community to be aware of this great time saver.</p>

<p>The official source is at <a href="https://wiki.debian.org/DebianInstaller/Preseed" rel="nofollow">https://wiki.debian.org/DebianInstaller/Preseed</a>  and a long file example at <a href="https://www.debian.org/releases/stable/example-preseed.txt" rel="nofollow">https://www.debian.org/releases/stable/example-preseed.txt</a></p>

<p><strong>Requirements</strong>:</p>

<ul>
<li>A VM with Debian iso mounted e.g:  <a rel="nofollow" href="https://www.debian.org/CD/netinst/" title="Network install from a minimal CD">Network install from a minimal CD</a></li>
<li>The preseed file is uploaded in some webserver and reachable by the VM.</li>
<li>The VM is online with vnc console support and is able to get an ip from your provider dhcp.</li>
<li>The VM is booted from the iso,  here are screen shots on how to get there:</li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/gs/4q8qm0v56gsx.png" alt="" title="" /><br />
<img src="https://talk.lowendspirit.com/uploads/editor/0y/dfubzgxhrk2a.png" alt="" title="" /><br />
<img src="https://talk.lowendspirit.com/uploads/editor/y5/whz5adf8r4n9.png" alt="" title="" /></p>

<p>Here is a working file "preseed-test.cfg" that partitions the entire first disk with lvm in auto mode.</p>

<pre><code>#####  save this file as preseed-test.cfg  and upload to your webserver

## locals and keys
d-i debian-installer/locale string en_US
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/xkb-keymap select fi
d-i keymap select fi

## detect network-hostname and auto setup
d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain

## mirrors and proxy if needed
d-i mirror/country string manual
d-i mirror/http/hostname string deb.debian.org
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string

## time and zone
d-i time/zone string Europe/Helsinki
d-i clock-setup/utc boolean true
d-i clock-setup/ntp boolean true
d-i clock-setup/ntp-server string pool.ntp.org

 ## Partion ::: use first disk , entire disk as one with lvm
d-i partman/early_command string debconf-set partman-auto/disk "$(list-devices disk | head -n1)"
d-i partman-auto/method string lvm
d-i partman-md/device_remove_md boolean true
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/confirm boolean true
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman-lvm/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman/confirm boolean true

## add root and user with passwords, change later
d-i passwd/root-login boolean true
d-i passwd/root-password password startSimple20
d-i passwd/root-password-again password startSimple20
d-i passwd/user-fullname string anthonySmith
d-i passwd/username string ant
d-i passwd/user-password password startSimple20
d-i passwd/user-password-again password startSimple20
d-i user-setup/allow-password-weak boolean true
d-i user-setup/encrypt-home boolean false

## lets install a standard server with ssh
tasksel tasksel/first multiselect standard,ssh-server
# add your cool tools
d-i pkgsel/include string ntp ssh wget curl

## upgrades
unattended-upgrades unattended-upgrades/enable_auto_updates boolean false
d-i pkgsel/update-policy select none
popularity-contest popularity-contest/participate boolean false

## install grub
d-i grub-installer/bootdev  string default
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true

 ## eject and reboot
d-i cdrom-detect/eject boolean true
d-i finish-install/reboot_in_progress note
</code></pre>

<p>The installation will execute in auto mode and the result of the above file is shown next, ignore sdb I was testing with another disk.</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/i7/a2c9neccfpyv.png" alt="" title="" /></p>

<p><strong>Notes</strong>:<br />
* I advise to read each section in the above preseed file and change accordingly to you needs for example; <strong>timezone, keyboard layout, passwords.</strong>... refer to references and source page.<br />
* The partitioning can get tricky if you want to do a regular layout or exclude swap, but is doable.<br />
* You can add custom scripts before install upgrade section like this as an example:</p>

<pre><code>### my other scripts 
d-i preseed/late_command string \
   in-target sh -c 'sed -i "s/^#PermitRootLogin.*\$/PermitRootLogin yes/g" /etc/ssh/sshd_config'; \
   in-target curl -sq http://othersite.fi/k8s/99-k8s.conf -o /etc/sysctl.d/99-k8s.conf ;
</code></pre>

<p>What else have fun.</p>

<p><strong>References</strong></p>

<ul>
<li><a href="https://www.debian.org/releases/buster/arm64/apbs02.en.html" rel="nofollow">https://www.debian.org/releases/buster/arm64/apbs02.en.html</a></li>
<li><a href="https://www.packer.io/guides/automatic-operating-system-installs/preseed_ubuntu" rel="nofollow">https://www.packer.io/guides/automatic-operating-system-installs/preseed_ubuntu</a></li>
<li><a href="https://gist.github.com/ofrzeta/afeb53590c538fbddace" rel="nofollow">https://gist.github.com/ofrzeta/afeb53590c538fbddace</a></li>
<li><a href="https://gist.github.com/lorin/5140029" rel="nofollow">https://gist.github.com/lorin/5140029</a></li>
<li><a href="https://github.com/delfer/debian-preseed-iso/blob/master/preseed.cfg" rel="nofollow">https://github.com/delfer/debian-preseed-iso/blob/master/preseed.cfg</a></li>
<li><a href="https://gist.github.com/boxrick/3a4022d003daa63b7d27cca7f0f99894" rel="nofollow">https://gist.github.com/boxrick/3a4022d003daa63b7d27cca7f0f99894</a></li>
<li><a href="https://gist.github.com/styblope/2cf93a41662608f924de71fd0e91e0d1" rel="nofollow">https://gist.github.com/styblope/2cf93a41662608f924de71fd0e91e0d1</a></li>
<li>others i might forgot to add.</li>
</ul>
]]>
        </description>
    </item>
    <item>
        <title>Compilation of FREE LES Shared Web Hosting Offers</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/3839/compilation-of-free-les-shared-web-hosting-offers</link>
        <pubDate>Tue, 26 May 2020 12:00:00 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>vyas</dc:creator>
        <guid isPermaLink="false">3839@/index.php?p=/discussions</guid>
        <description><![CDATA[<p><em>Written by <a href="https://lowendspirit.com/index.php?p=/profile/vyas" rel="nofollow">@vyas</a>, 26 May 2020</em><br />
<small>Article was migrated from WordPress to Vanilla in March 2022</small></p>

<h1>Free Shared Web Hosting: Offers Galore</h1>

<p><img src="https://talk.lowendspirit.com/uploads/editor/in/xoxgbz049ca1.png" alt="" title="" /></p>

<p>Over the past couple of months, providers on <a rel="nofollow" href="https://talk.lowendspirit.com/discussion/92/les-hosting-provider-register">LES</a> have generously offered free shared hosting plans for the LES community. The goal or objective behind is simple: they want to give back to the community and help those who can benefit from these offers.</p>

<p>In the below section I have compiled the list of offers by Four providers who have posted such offers since March 2020. Relevant details such as location, bandwidth, number of websites, disk space, are also included. This information is already available in the <a rel="nofollow" href="https://talk.lowendspirit.com/">forums</a>. However, wouldn't it be cool if it was available in a single page? I wanted to keep it simple, and while a more comprehensive tabulation <a rel="nofollow" href="https://talk.lowendspirit.com/discussion/16/ympkers-shared-reseller-hosting-comparison-chart">like the one mentioned in this post</a> might make sense for some, I opted for brevity and simplicity. With this thought, let us dive into these offers.</p>

<h3>Presenting the offers Together</h3>

<table>
<thead>
<tr>
  <th></th>
  <th>Nexusbytes  (Servedez)</th>
  <th>Teta Host</th>
  <th>HostingCubes</th>
  <th>Khan Web Hosting</th>
</tr>
</thead>
<tbody>
<tr>
  <td>Location</td>
  <td>New York</td>
  <td>France and Germany</td>
  <td>Multiple&#42;&#42;</td>
  <td>Romania</td>
</tr>
<tr>
  <td>Panel</td>
  <td>DA</td>
  <td>DA</td>
  <td>DA</td>
  <td>DA</td>
</tr>
<tr>
  <td>Disk Space</td>
  <td>Unlimited&#42;</td>
  <td>1 GB NVMe</td>
  <td>1 GB</td>
  <td>500 MB NVMe</td>
</tr>
<tr>
  <td>Bandwidth</td>
  <td>Unlimited&#42;</td>
  <td>100 GB</td>
  <td>25 GB</td>
  <td>50 GB</td>
</tr>
<tr>
  <td>Email Accounts</td>
  <td>10</td>
  <td></td>
  <td>5</td>
  <td>5</td>
</tr>
<tr>
  <td>Databases</td>
  <td></td>
  <td>3</td>
  <td>5</td>
  <td>5</td>
</tr>
<tr>
  <td>Number of Domains</td>
  <td>1</td>
  <td>3</td>
  <td>1</td>
  <td>1</td>
</tr>
<tr>
  <td>Remarks</td>
  <td><a rel="nofollow" href="https://servedez.com/index.php?topic=4.0">Check terms and  conditions</a></td>
  <td>Daily Backups</td>
  <td>Renews after 1 yr</td>
  <td>5 FTP Accounts</td>
</tr>
<tr>
  <td>Further Information</td>
  <td><a rel="nofollow" href="https://servedez.com/index.php">Visit Site for details</a></td>
  <td><a rel="nofollow" href="https://talk.lowendspirit.com/discussion/1047/tetahost-free-directadmin-nvme-shared-web-hosting-in-france-or-germany">Link to offer</a></td>
  <td><a rel="nofollow" href="https://talk.lowendspirit.com/discussion/636/lab-rats-required-to-test-new-free-hosting-service/p1">Link to offer</a></td>
  <td><a rel="nofollow" href="https://talk.lowendspirit.com/discussion/772/free-directadmin-nvme-shared-hosting">Link to offer</a></td>
</tr>
</tbody>
</table>

<hr />

<p>Notes:</p>

<ol>
<li>DA stands for <a rel="nofollow" href="https://www.directadmin.com/">Direct Admin</a> control panel</li>
<li>Free shared hosting plans by Hostingcubes are available for a period of one year at 7 different locations. Visit the offer page by <a href="https://lowendspirit.com/index.php?p=/profile/Lee" rel="nofollow">@Lee</a> - <a rel="nofollow" href="https://talk.lowendspirit.com/discussion/636/lab-rats-required-to-test-new-free-hosting-service/p1">for further details</a></li>
<li>Requirements for Free Shared Hosting by Khan Web: "All you would need to do is join <a rel="nofollow" href="https://discord.gg/TNg2bB">Discord Channel</a> &amp; send a PM to user <a rel="nofollow" href="https://talk.lowendspirit.com/profile/AK_KWH">@AK&#95;KWH</a>, mentioning your discord username"</li>
</ol>

<p><img src="https://talk.lowendspirit.com/uploads/editor/jg/2r1vw72jlzz0.png" alt="" title="" /></p>

<h3>The Obvious and Not-So-Obvious</h3>

<p>There are several reasons to question the rationale behind such offers. For example, why would anybody offer a service for free? Then there is the suspicion that the providers might use the sign-ups as an opportunity to up-sell services. That may be true in some cases, but more than one provider in the above list has mentioned that these offers rarely result in paying customers. In the words of <a href="https://lowendspirit.com/index.php?p=/profile/seriesn" rel="nofollow">@seriesn</a> from Nexusbytes,</p>

<blockquote><div>
  <p>"Usually if you are not paying for your project, you don't take it seriously logic applies here..... I guess it also depends because a lot of these use cases are for personal projects that never take off, or people just abandon them." - <a rel="nofollow" href="https://talk.lowendspirit.com/profile/seriesn">@seriesn</a></p>
</div></blockquote>

<h3>Risk of abuse by Users</h3>

<p>The intention of this post is not to delve upon the pro's and cons of free shared web hosting. But I thought of mentioning that the providers can often face abuses from users and those looking to exploit the gratis service. This discussion from the forums, based on experiences of Lee with Hostingcubes, <a rel="nofollow" href="https://talk.lowendspirit.com/discussion/comment/23247">offers an interesting perspective</a>.</p>

<h3>Free service during beta testing</h3>

<p>Some providers can offer free accounts for a limited period when they are launching new products or services. A recent example is Hello Internet /<a href="https://lowendspirit.com/index.php?p=/profile/hello" rel="nofollow">@hello</a>, who offered <a rel="nofollow" href="https://talk.lowendspirit.com/discussion/797/free-cpanel-nvme-hosting-eu">free CPanel hosting in Germany</a>. In exchange, they sought feedback, testing from the users. A provider may choose to continue offering the 'free' service to the beta testers beyond the testing period. </p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/qi/8cws8atmvk0x.png" alt="" title="" /></p>

<h3>Summing it all up</h3>

<p>The act of offering a service for free does not limit itself to shared hosting on this forum. Some users have posted their offers for a 'free' use of VPS. But I thought of limiting this post to shared web hosting offers. One reason was focus. The other reason is more personal: I have benefited over the past years from free web hosting services. This prompted me to compile the offers and write this post that would provide a handy resource the LES community.</p>

<p>The details in the table are compiled from the offer posts. In some cases, I have used the details by checking with the providers, or from my own account. In case of any updates, errors, or additions, do leave your feedback in the comments section below.</p>

<h4>Links to free shared web hosting offers by providers:</h4>

<p>I have included them in the table above but for ready reference, here they are, in no particular order:</p>

<ol>
<li>Tetahost <a rel="nofollow" href="https://talk.lowendspirit.com/discussion/1047">https://talk.lowendspirit.com/discussion/1047</a></li>
<li>Nexusbytes: <a rel="nofollow" href="https://talk.lowendspirit.com/discussion/850/free-shared-hosting-servedez">https://talk.lowendspirit.com/discussion/850/free-shared-hosting-servedez</a></li>
<li>Khan Web Hosting: <a rel="nofollow" href="https://talk.lowendspirit.com/discussion/772/free-directadmin-nvme-shared-hosting">https://talk.lowendspirit.com/discussion/772/free-directadmin-nvme-shared-hosting</a></li>
<li>Hostingcubes: <a rel="nofollow" href="https://talk.lowendspirit.com/discussion/636/lab-rats-required-to-test-new-free-hosting-service/p1">https://talk.lowendspirit.com/discussion/636/lab-rats-required-to-test-new-free-hosting-service/p1</a></li>
</ol>
]]>
        </description>
    </item>
    <item>
        <title>Postinstall Configuration of Proxmox VE 6.2</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/1408/postinstall-configuration-of-proxmox-ve-6-2</link>
        <pubDate>Mon, 06 Jul 2020 18:55:55 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>Not_Oles</dc:creator>
        <guid isPermaLink="false">1408@/index.php?p=/discussions</guid>
        <description><![CDATA[<p><strong>Postinstall Configuration of Proxmox VE 6.2</strong></p>

<p>Contributed by <a href="https://lowendspirit.com/index.php?p=/profile/Not_Oles" rel="nofollow">@Not_Oles</a> -- July 6, 2020</p>

<p><strong>Introduction</strong></p>

<p>Our goal is to become a Low End Hosting Provider by selling virtual private servers (VPSes) created with <a rel="nofollow" href="https://proxmox.com/en/">Proxmox</a> on an inexpensive bare metal host server rented from <a rel="nofollow" href="https://www.soyoustart.com/us/">SoYouStart</a>.</p>

<p>In the <a rel="nofollow" href="https://lowendspirit.com/installing-proxmox-ve-6-2-at-soyoustart">first post in this series</a> we successfully installed <a rel="nofollow" href="https://proxmox.com/en/">Proxmox Virtual Environment ("PVE"), Version 6.2</a> on a Low End <a rel="nofollow" href="https://www.soyoustart.com/us/">SoYouStart</a> server.</p>

<p>In this post, using the Proxmox web Graphical User Interface (GUI), as well as the traditional command line environment, we will accomplish postinstall steps, including:</p>

<ul>
<li>Initial Login,</li>
<li>Obtaining a <a rel="nofollow" href="https://letsencrypt.org/">Let's Encrypt</a> Secure Sockets Layer (SSL) certificate,</li>
<li>Setting up the firewall,</li>
<li>Adding firewall rules,</li>
<li>Enabling firewall rules and also the firewall itself,</li>
<li>Checking the firewall for proper operation,</li>
<li>Updating and upgrading both Proxmox itself as well as the Debian GNU/Linux base system on which Proxmox 6.2 runs, and</li>
<li>Additional ssh and web GUI security considerations.</li>
</ul>

<p>The postinstall steps covered here are not specific to SoYouStart and, instead, are very much the same with other bare metal host server providers. So, this post could be used as a postinstall configuration guide for Proxmox installations on servers from other vendors besides SoYouStart.</p>

<p><strong>Initial Login</strong></p>

<p>Let's check the OVH email congratulating us on our successful install. Look within the email for "Application Access Parameters," which gives us a link to point our browser at the Proxmox web GUI and as well as our username, root, and root's password. Note that the link has "8006" in it because the web GUI runs on port 8006. If, using Chrome broswer, we click the link or paste it into our URL bar, the first thing we should see is the insecure connection block, which, looks like this:</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/ls/1kzs14926svd.png" alt="" title="Chrome connection block page" /></p>

<p>Note that the connection actually is encrypted. It isn't really "insecure," except in the sense that Chrome does not recognize our server's certificate as valid. To access the Control Panel the block needs to be overridden, so let's click "Advanced," and then "Proceed to [the link from the email] (unsafe):"</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/fp/nbt6u7dn2wkw.png" alt="" title="Proceed" /></p>

<p>We now should see the Proxmox web GUI login screen where we can enter root as our username and our password from the OVH emai and click "Login:"</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/lb/od9rni88h8n4.png" alt="" title="Login window" /></p>

<p>Next we should see the Proxmox Nag popup:</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/an/6z4briviz2v4.png" alt="" title="Proxmox Nag" /></p>

<p>Let's please consider buying a subscription to support the Proxmox team. Then we'll click OK.</p>

<p>Finally, we are ready to use the Proxmox web GUI.</p>

<p><img src="http://talk.lowendspirit.com/uploads/editor/cc/0jssiwebnxgr.png" alt="" title="Proxmox Web GUI Ready" /></p>

<p>The Control Panel layout features include:</p>

<ul>
<li>a Server View in the left hand column listing all the servers in the Datacenter. As this is our first server, it is the only server listed.</li>
<li>The Top Bar, which tells us the version of Proxmox Virtual Environment, here 6.2-6, and provides a searchbox plus buttons to create a KVM VPS, create an LXC VPS, and to access root user account functions (Settings, Password, Two Factor Authentication (TFA), Language, and Logout).</li>
<li>The main panel, which here contains information about the Datacenter, including a list of nodes (each server is called a "node") and a Help button in the upper right. The left hand column of the main panel contains a long list of categories, one of which is "Firewall," which we need to scroll down the menu in order to see.</li>
<li>Recent Log entries are shown at the bottom of the main panel. We see that the zero currently existing VPSes were started without any failure.</li>
</ul>

<p>We can click and drag the borders of the Control Panel layout sections to resize them as convenient.</p>

<p><strong>Obtaining a Let's Encrypt SSL certificate</strong></p>

<p>Ordinarily, the very first thing to do after installing a new server might be to secure the server by limiting access through the firewall, further adjusting ssh access, installing fail2ban, etc. However, these steps, as done below, do block <a rel="nofollow" href="https://letsencrypt.org/">Let's Encrypt's</a> ability to issue the server certificate. To make issuing the certificate easier, let's get the certificate issued before setting up the firewall. Getting the certificate will only take a moment.</p>

<p>In order to get the certificate, you need to have registered a domain name such as superspeedyvps-example.com, pointed the domain's DNS records at the server's numerical IP address given in OVH's access email, and set up whatever email you want to use to receive notices from Let's Encrypt.</p>

<p>There is one additional preliminary tip to make using our new certificate easier after we get it. Initially we logged in to the Control Panel using the OVH supplied URL from the access letter. If, prior to certificate issuance, we login to the Control Panel using our own superspeedyvps-example.com domain, then issue the certificate, then login again, it seems to take Chrome a few days to stop putting up the unsecured connection block despite that Chrome seems immediately to recognize the newly issued certificate's validity. Therefore, let's briefly continue using the OVH supplied URL and not point Chrome at our superspeedyvps-example.com domain until after the Let's Encrypt certificate is issued.</p>

<p>In the left hand Server View column, let's click on our server's name and, in the center panel's left column, scroll down if necessary, and also click on "Certificates." We should see this:</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/8f/67t53ee0ea0s.png" alt="" title="Certificate Information" /></p>

<p>Next, we need to add our account in order to issue a certificate via the <a rel="nofollow" href="https://en.wikipedia.org/wiki/Automated_Certificate_Management_Environment">Automated Certificate Management Environment (ACME)</a> We click on "Add ACME Account."</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/6x/lp0wywdkipz6.png" alt="" title="Add ACME Account" /></p>

<p>Next, we add our email address, carefully review the Terms of Service (TOS), check the "Accept TOS" box, and click "Register."</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/as/yy0o24esg3nd.png" alt="" title="ACME Registration" /></p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/i2/lo5gbhmtbea0.png" alt="" title="Register Account Zoomed" /></p>

<p>We see the account registration output and also that the registration task succeeded.</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/pw/908edhagkodt.png" alt="" title="ACME Account Success" /></p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/u6/qj64c4j2thb1.png" alt="" title="Register Task Success Zoomed" /></p>

<p>Next we close the account registration output window and click "Add" in order to add our certificate. The Create Domain dialog box appears.</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/6z/g37cyne9vlz2.png" alt="" title="Create Domain" /></p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/xk/nwkt21rrgf62.png" alt="" title="Create Domain Zoomed" /></p>

<p>After clicking "Create," we click on our domain now newly appearing in the main panel's ACME domain list. Then, to get our certificate issued, we click on "Order Certificate Now." A pop up window appears, showing the output of the certificate ordering process. The process takes a minute or so, and ends with "Task OK."</p>

<p>The Chrome security block soon reappears because the certificate has changed. We can just close our tab and then reload the web GUI in a new tab, this time entering our own registered domain, superspeedyvps-example.com, into the browser URL bar. We have to log in again and we have another opportunity to see the Nag. We can click the lock icon in Chrome's URL bar and then "Certificate" to see our new certificate's details.</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/7y/70rh18vygjr6.png" alt="" title="Certificate Viewer" /></p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/9v/18k7cupgieo7.png" alt="" title="Certificate Details" /></p>

<p><strong>Setting Up the Firewall</strong></p>

<p>The Proxmox firewall currently seems to use <a rel="nofollow" href="https://forum.proxmox.com/threads/v6-0-move-from-iptables-to-nftables.55924/">iptables-legacy</a>. We can check our server this way:</p>

<pre><code># ls -al /etc/alternatives/iptables
lrwxrwxrwx 1 root root 25 Jul  2 19:40 /etc/alternatives/iptables -&gt; /usr/sbin/iptables-legacy
#
</code></pre>

<p>The Proxmox firewall is disabled on a new install. When the firewall is enabled, the default firewall configuration is to block all but ports 8006 and 22 on the <em>local</em> network, so if we are connecting from the internet, we shouldn't enable the firewall itself until after wide area internet access rules are added and enabled. The <a rel="nofollow" href="https://pve.proxmox.com/wiki/Firewall">Proxmox Firewall Instructions</a> emphasize this warning:</p>

<blockquote><div>
  <p>The firewall is completely disabled by default, so you need to set the enable option [ . . . ]<br />
  Important If you enable the firewall, traffic to all hosts is blocked by default. Only exceptions is WebGUI(8006) and ssh(22) from your local network.<br />
  If you want to administrate your Proxmox VE hosts from remote, you need to create rules to allow traffic from those remote IPs to the web GUI (port 8006). You may also want to allow ssh (port 22), and maybe SPICE (port 3128).</p>
</div></blockquote>

<p>Firewall changes do not affect connections previously made, so, as insurance, <a rel="nofollow" href="https://pve.proxmox.com/wiki/Firewall">Proxmox advises:</a></p>

<blockquote><div>
  <p>Tip: Please open a SSH connection to one of your Proxmox VE hosts before enabling the firewall. That way you still have access to the host if something goes wrong.</p>
</div></blockquote>

<p><strong>Adding Firewall Rules</strong></p>

<p>We are going to add firewall rules allowing web GUI and ssh access from our primary IP address and from a backup IP address so that our ability to use our primary IP address is not a single point of possible failure. We'll also add rules to allow the host to respond to ping and traceroute.</p>

<p>Here is how to add the rules using the Proxmox web GUI. First, we select our server in the Server View column. Second, we scroll down and select Firewall in the menu on the left side of the main panel:</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/xc/aj91cvabx1rj.png" alt="" title="Select Firewall" /></p>

<p>Third, we click the "Add" button, and the Add Rule dialog appears:</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/xx/gdclsoww4gkk.png" alt="" title="Add Firewall Rule" /></p>

<p>The first rule is to accept incoming connections from our primary IP address on port 8006 and using TCP protocol. Let's not check the enable box at this time because, lest we get locked out, we want to add additional access rules before enabling. After entering each rule, let's click Add in the Add Rule box, then click Add on the Firewall main panel to relaunch the Add Rule dialog to enter our next rule. A list of all the rules we are adding looks like this:</p>

<table>
<thead>
<tr>
  <th align="left">Enabled</th>
  <th align="center">Type</th>
  <th align="left">Action</th>
  <th align="left">Source</th>
  <th align="center">Protocol</th>
  <th align="right">Destination Port</th>
  <th align="center">Log Level</th>
  <th align="left">Comment</th>
</tr>
</thead>
<tbody>
<tr>
  <td align="left">No</td>
  <td align="center">in</td>
  <td align="left">ALLOW</td>
  <td align="left">Primary IP</td>
  <td align="center">tcp</td>
  <td align="right">8006</td>
  <td align="center">nolog</td>
  <td align="left">web GUI</td>
</tr>
<tr>
  <td align="left">No</td>
  <td align="center">in</td>
  <td align="left">ALLOW</td>
  <td align="left">Primary IP</td>
  <td align="center">tcp</td>
  <td align="right">22</td>
  <td align="center">nolog</td>
  <td align="left">ssh</td>
</tr>
<tr>
  <td align="left">No</td>
  <td align="center">in</td>
  <td align="left">ALLOW</td>
  <td align="left">Backup IP</td>
  <td align="center">tcp</td>
  <td align="right">8006</td>
  <td align="center">nolog</td>
  <td align="left">web GUI</td>
</tr>
<tr>
  <td align="left">No</td>
  <td align="center">in</td>
  <td align="left">ALLOW</td>
  <td align="left">Backup IP</td>
  <td align="center">tcp</td>
  <td align="right">22</td>
  <td align="center">nolog</td>
  <td align="left">ssh</td>
</tr>
<tr>
  <td align="left">No</td>
  <td align="center">in</td>
  <td align="left">ALLOW</td>
  <td align="left"></td>
  <td align="center">icmp</td>
  <td align="right"></td>
  <td align="center">nolog</td>
  <td align="left">ping</td>
</tr>
<tr>
  <td align="left">No</td>
  <td align="center">in</td>
  <td align="left">ALLOW</td>
  <td align="left"></td>
  <td align="center">udp</td>
  <td align="right">33434:44534</td>
  <td align="center">nolog</td>
  <td align="left">traceroute</td>
</tr>
</tbody>
</table>

<p>If we are connecting from a dynamic IP, we can enter a rule allowing connections from a limited range of IP addresses using CIDR notation. For example, if only the last octet of our IP address changes, the source IP in the rule could be something like 123.123.123.0/24. An alternative to widening the connection rule is connecting from our dynamic IP through an intermediate fixed-IP VPS. Here, the IP of the intermediate VPS would entered into the rule.</p>

<p>After we have set all the rules, it's important for us carefully to triple check to make sure each rule is exactly, exactly, exactly right. <img src="https://lowendspirit.com/plugins/emojiextender/emoji/twitter/smile.png" title=":)" alt=":)" height="18" /> A typo can lock us out! So, let's check all the rules one more time.</p>

<p><strong>Enabling and disabling firewall rules and also the firewall itself</strong></p>

<p>Proxmox allows us, as sometimes might be very convenient, quickly and easily to <strong>dis</strong>able individual firewall rules, the entire firewall for an individual host server node, or even all the firewalls for the entire datacenter. Therefore, in order to <strong>en</strong>able our firewall rules, we need to enable each individual rule, the host server node firewall, and the Datacenter firewall.</p>

<p>First, we need to click the enable checkbox next to the beginning of each individual rule.</p>

<p>Second, we need to make sure that the host server node's firewall is on. Click on "Options," right under "Firewall" on the left column menu of the main panel. Verify that "Firewall," the first option shown on the list, is set to "Yes."</p>

<p>Third, to enable the firewall at the Datacenter level, we click on "Datacenter" in the far left Server View menu, then click on "Options" just under "Firewall" on the left column menu of the main panel. We need to change "Firewall," the first option shown on the list, from "No" to "Yes."</p>

<p>Now the firewall should be operational.</p>

<p><strong>Checking the firewall for proper operation</strong></p>

<p>Next, let's check to make sure the firewall actually is working as expected.</p>

<p>First, we can open a terminal on the host server node. Just being able to open the terminal shows that we are allowed access from our IP address. In the terminal, we can see whether each of our new rules appears when we run</p>

<pre><code># iptables -L PVEFW-HOST-IN
</code></pre>

<p>Second, we should try connecting from various IPs which should be disallowed as well as from the IPs for which we set specific ALLOW rules.</p>

<p><strong>Updating and upgrading Proxmox and Debian</strong></p>

<p>Our next step is to update and upgrade both Proxmox Virtual Environment and also the underlying Debian GNU/Linux operating system so that our customers' VPSes can benefit from the latest bug fixes and feature upgrades.</p>

<p>Like many things in Proxmox, the update / upgrade process can be done in a command line terminal window equally excellently as via the web GUI. Just open a terminal on the bare metal host server node and execute:</p>

<pre><code># apt-get update &amp;&amp; apt-get dist-upgrade -y
</code></pre>

<p>In the web GUI, update plus dist-upgrade is a four click process. We click on</p>

<ol>
<li>Our server's name in the extreme left Server View column,</li>
<li>"Updates" in the left column menu of the main panel,</li>
<li>"Refresh" on the top menu of the main panel, and</li>
<li>"Upgrade" on the top menu of the main panel.</li>
</ol>

<p>"Refresh" on the top menu of the main panel launches a Task Window which runs apt-get update</p>

<p>"Upgrade" on the top menu of the main panel launches a command line terminal window which runs apt-get dist-upgrade.</p>

<p><img src="http://talk.lowendspirit.com/uploads/editor/95/4h2xe6z80ulv.png" alt="" title="Update and Upgrade" /></p>

<p>Sometimes, following an upgrade, we are told to run</p>

<pre><code># apt autoremove
</code></pre>

<p>to take away a few old packages which no longer are needed. Also, I like to</p>

<pre><code># reboot
</code></pre>

<p>Rebooting may not be necessary after every upgrade, but I enjoy knowing that my server <em>can</em> reboot successfully.</p>

<p><strong>Additional ssh and web GUI security considerations</strong></p>

<p>Here are some additional security steps which we might consider. All these additional security steps have advantages and disadvantages, so each of us has to decide how best to proceed on each of our individual servers.</p>

<p>The first additional suggestion is to  change the root password originally supplied by OVH. Most everyone would choose to do this. Additionally, we might consider disabling ssh password login entirely.</p>

<p>Another possibility is to change the ssh port from 22 to some high number. An alternative or further possible step is to use port knocking. An advantage of these is that the logs suddenly get very quiet, since most of script kiddie attackers do not pursue ssh after the port changes. A disadvantage is that many software packages and services assume ssh operates on port 22.</p>

<p>The ability to assume that ssh will be on port 22 is, after all, the purpose of having standard ports. Therefore, if we install port knocking or change the ssh port, some other things will break. For example, I no longer seem to be able to access my servers via the Intelligent Platform Management Interface (IPMI) console after changing the ssh port.  Running multiple Proxmox servers from one server's web GUI might also break.</p>

<p>Yet another possible postinstall security step could be installing fail2ban. The default Debian fail2ban install protects ssh but requires additional configuration to protect the Proxmox web GUI. The default install also may require additional configuration to work with the Proxmox firewall. Here, where access to our server is limited to single IP addresses by our firewall ACCESS rules, fail2ban may be less necessary or even unneeded.</p>

<p><strong>Conclusion</strong></p>

<p>Following our successful Proxmox install in part one of this series and our successful postinstall configuration here in part two,  we have reached the point where we can use Proxmox to create the VPSes for which our customers are eagerly waiting!</p>

<p>In the next post we will download an operating system template and then use the newly downloaded template to create our first VPS with Proxmox at SoYouStart!</p>
]]>
        </description>
    </item>
   </channel>
</rss>
