<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Proxmox on blog.iankulin.com</title><link>https://blog.iankulin.com/tags/proxmox/</link><description>Recent content in Proxmox on blog.iankulin.com</description><generator>Hugo</generator><language>en-AU</language><lastBuildDate>Mon, 01 Apr 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://blog.iankulin.com/tags/proxmox/index.xml" rel="self" type="application/rss+xml"/><item><title>My Web App Update Process</title><link>https://blog.iankulin.com/my-web-app-update-process/</link><pubDate>Mon, 01 Apr 2024 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/my-web-app-update-process/</guid><description>&lt;p&gt;I&amp;rsquo;ve settled on a very standard, reproducible setup for services in my homelab. This post looks at that, then runs through the update I did today to Forgejo which only took a few minutes and felt relatively risk free.&lt;/p&gt;
&lt;h3 id="standard-setups"&gt;Standard Setups&lt;/h3&gt;
&lt;p&gt;My system is based around Proxmox. I have three physical machines - one for production apps, a production spare, and a development/testbed machine. A Synology NAS serves for backups. Moving a VM or LXC between the machines is trivial; but it&amp;rsquo;s done manually - the machines are not clustered for high availability.&lt;/p&gt;
&lt;p&gt;Most workloads are Docker containers &lt;em&gt;inside&lt;/em&gt; an LXC. This works fine with a couple of caveats. I have an LXC template saved with Docker and Tailscale installed, my non-root user added, the mount for the NAS, and SSH keys. Setting up a new app starts with a full clone of this, a &lt;code&gt;dpkg-reconfigure openssh-server&lt;/code&gt; and &lt;code&gt;tailscale up&lt;/code&gt; and changing the root &amp;amp; non-root users&amp;rsquo; passwords.&lt;/p&gt;
&lt;p&gt;Next I create a sub directory for the app and write the &lt;code&gt;docker-compose.yaml&lt;/code&gt; in there. Then it&amp;rsquo;s just a matter of &lt;code&gt;docker compose up -d&lt;/code&gt;. If there&amp;rsquo;s any data, it goes in a another sub directory off this one.&lt;/p&gt;
&lt;p&gt;Unless I need something else, nightly backups to the NAS happen automatically for all the VMs and containers handled by a setting in Proxmox.&lt;/p&gt;
&lt;h3 id="upgrading-an-app"&gt;Upgrading an App&lt;/h3&gt;
&lt;p&gt;I&amp;rsquo;ve noticed a couple of posts about a new release of &lt;a href="https://forgejo.org/"&gt;Forgejo&lt;/a&gt; on Mastodon in the past few days, so I figure I should look at that. My version is 1.21.1 and the new one is 1.21.8&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2024-03-24-at-8.44.36-am.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Because of &lt;a href="https://semver.org/"&gt;semantic versioning&lt;/a&gt;, I&amp;rsquo;m confident this is not going to break anything, but I check the release notes anyway. It looks good.&lt;/p&gt;
&lt;h4 id="backup"&gt;Backup&lt;/h4&gt;
&lt;p&gt;I jump into the Proxmox web gui and make a backup of the container.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2024-03-24-at-8.47.06-am.jpg" alt=""&gt;&lt;/p&gt;
&lt;h4 id="docker-compose"&gt;Docker Compose&lt;/h4&gt;
&lt;p&gt;I ssh in to look at the image tag in the docker-compose.yml file. The reason I&amp;rsquo;m interested in this is that if the compose is set to &lt;code&gt;codeberg.org/forgejo/forgejo:1.21.1&lt;/code&gt; then it will be locked into that patch version, but it says &lt;code&gt;codeberg.org/forgejo/forgejo:1.21&lt;/code&gt; so we&amp;rsquo;re good.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2024-03-24-at-8.48.38-am.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Now I take the service down from the CLI with &lt;code&gt;sudo docker compose down&lt;/code&gt;, then pull the new image with &lt;code&gt;sudo docker pull codeberg.org/forgejo/forgejo:1.21&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2024-03-24-at-9.24.21-am.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;The to start it again, it&amp;rsquo;s just a &lt;code&gt;docker compose up -d&lt;/code&gt; and we&amp;rsquo;re live again.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2024-03-24-at-8.52.45-am.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2024-03-24-at-8.52.45-am.png" width="900" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4 id="testing"&gt;Testing&lt;/h4&gt;
&lt;p&gt;My testing of this was pretty brief since (a) I&amp;rsquo;ve got high confidence in the developers at &lt;a href="https://blog.iankulin.com/gogs-gitea-forgejo/"&gt;gitea and forgejo&lt;/a&gt; and (b) this app gets pretty much daily use so if there are issues I&amp;rsquo;ll surface them pretty quickly, (c) anything I&amp;rsquo;m actively working on had full git histories on my laptop, and (d) the releases since my last update are pretty much just bug fixes.&lt;/p&gt;
&lt;p&gt;Nevertheless, I clicked around the web gui, and tried some pushes, pulls and clones and everything seemed fine.&lt;/p&gt;
&lt;h3 id="conclusion"&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;I&amp;rsquo;m very comfortable with the way I&amp;rsquo;ve put all this together now. It&amp;rsquo;s a reliable, easily managed setup that makes maintenance like this simple and safe.&lt;/p&gt;</description></item><item><title>Using LXC templates in Proxmox</title><link>https://blog.iankulin.com/using-lxc-templates-in-proxmox/</link><pubDate>Sun, 24 Dec 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/using-lxc-templates-in-proxmox/</guid><description>&lt;p&gt;I wrote a couple of weeks ago about a &lt;a href="https://blog.iankulin.com/new-self-hosted-service-workflow/"&gt;standard workflow&lt;/a&gt; I use to spin up a web service in an LXC container to add to my self-hosted collection of services. It went a bit like: do this, and then this, then this other thing. Whenever you find yourself repeating a set of steps like this, it&amp;rsquo;s usually a sign that you should be automating it. Not just to save time (although this is a key benefit) but also to improve repeatability and to avoid introducing errors.&lt;/p&gt;
&lt;p&gt;In Proxmox, this particular task is easily systematized using container &lt;em&gt;templates&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;The simplest way to think of a container template is that it&amp;rsquo;s just a one-for-one snapshot of a container (ie the disk image, the configuration file that contains all the VM hardware information) all squashed up into a tarball - basically the same as a backup. This is then copied to create new containers.&lt;/p&gt;
&lt;p&gt;If we create new containers from a template, all the software and configuration that was in the template will be present in the new container. This is obviously the desired behaviour, but it presents some issues - we probably don&amp;rsquo;t want multiple containers with the same host name, or MAC address, or SSH host keys. Some of these issues Proxmox will sort out for us, some we&amp;rsquo;ll need to tidy up manually.&lt;/p&gt;
&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Issue&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;strong&gt;Solution&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Host name&lt;/td&gt;&lt;td&gt;When you 'clone' the template in Proxmox, it will ask you the new host name.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;MAC address&lt;/td&gt;&lt;td&gt;Proxmox just creates a new one with no input needed from you.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Machine ID&lt;/td&gt;&lt;td&gt;If you truncate it in the template before you save it as a template, a new one will be created then the container is.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;SSH host keys&lt;/td&gt;&lt;td&gt;Manually delete them in the template before saving the template, then manually re-create them in the new container once it's booted up.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;h3 id="making-the-template"&gt;Making the template&lt;/h3&gt;
&lt;p&gt;Create an LXC container as normal - ie chose &amp;ldquo;Create CT&amp;rdquo; in Proxmox, give it a name, choose a password, then a template, make the decisions about memory, disk, networking etc. Note that when you are choosing an official template to create it from (Apline, Debian, Ubuntu etc) , these files are almost identical to what we&amp;rsquo;ll be creating in this process.&lt;/p&gt;
&lt;p&gt;Once that&amp;rsquo;s up and running, I &lt;code&gt;ssh&lt;/code&gt; in and run all my apt updates and install any software or make any other changes. For me this includes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Making it a client of &lt;a href="https://blog.iankulin.com/caching-apt-updates/"&gt;my local apt-cache&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;running ssh update and upgrades&lt;/li&gt;
&lt;li&gt;Copying in my SSH keys (ssh-copy-id)&lt;/li&gt;
&lt;li&gt;Installing sudo and adding myself as a sudo user&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.docker.com/engine/install/debian/"&gt;Installing Docker&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://tailscale.com/kb/1174/install-debian-bookworm/"&gt;Installing Tailscale,&lt;/a&gt; and doing the &lt;a href="https://blog.iankulin.com/getting-tailscale-working-in-lxc-containers/"&gt;Tailscale LXC fix&lt;/a&gt; (but not running &lt;code&gt;tailscale up&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Installing &lt;a href="https://blog.iankulin.com/simple-api-endpoint-in-go/"&gt;my simple machine status server&lt;/a&gt; that&amp;rsquo;s used for monitoring&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Once that&amp;rsquo;s all done, we&amp;rsquo;ve got a nice clean container, but with all the software and config that we need for most future containers.&lt;/p&gt;
&lt;p&gt;Now we need to address a couple of the issues that could be caused by cloning this LXC from the table above.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Machine ID - you could probably get away with not worrying about this, but might run into a confusing issue later. A simple &lt;code&gt;sudo truncate -s 0 /etc/machine-id&lt;/code&gt; will nuke it, then a new unique one will be created when the clone container boots up.&lt;/li&gt;
&lt;li&gt;SSH host keys - you know when you ssh into a new system for the first time and OpenSSH asks you if you&amp;rsquo;re sure you want to recognise this server? This is done by the server identifying itself with one of these keys. If these are left the same for all of the clones of our template, you&amp;rsquo;ll have to be constantly deleting the keys out of your &lt;code&gt;known_hosts&lt;/code&gt; file. We can delete them now (which will make this template and any clones impossible to &lt;code&gt;ssh&lt;/code&gt; into) or later. I choose now. &lt;code&gt;sudo rm /etc/ssh/ssh_host_*&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Once this is all done, we are ready to convert this container into a template. Shut it down, then if you are cautious, back it up (you can&amp;rsquo;t convert a template back into a container). Then right click on it in Proxmox and choose &amp;lsquo;Convert to Template&amp;quot;. After a few seconds, it will be in your server view as a template with a slightly different icon.&lt;/p&gt;
&lt;h3 id="using-the-template"&gt;Using the template&lt;/h3&gt;
&lt;p&gt;The process of using our new template is called cloning. Right click on the template in Proxmox, and choose clone. You&amp;rsquo;ll be presented with a dialogue to give it a number, choose a host name, select the clone type (you want a &amp;lsquo;full clone&amp;rsquo;) and where this container&amp;rsquo;s storage will be.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-12-03-at-12.43.10-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-12-03-at-12.43.10-pm.png" width="1000" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;A few seconds later the new LXC container will be in your server view and can be started.&lt;/p&gt;
&lt;p&gt;You won&amp;rsquo;t be able to ssh into this container yet as we deleted the host keys. Use the console in Proxmox to log in (with the root or sudo user credentials you set up earlier) and recreate the ssh host keys with &lt;code&gt;sudo dpkg-reconfigure openssh-server&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;While you are here, you should probably change the passwords for both users with &lt;code&gt;passwd&lt;/code&gt; or &lt;code&gt;sudo passwd &amp;lt;username&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The other thing I&amp;rsquo;ll need to do to use my container with Tailscale is to run &lt;code&gt;sudo tailscale up&lt;/code&gt; and complete the steps for that.&lt;/p&gt;
&lt;p&gt;And we&amp;rsquo;re done. You&amp;rsquo;ve now got a container that&amp;rsquo;s identical to our template, except for the things that need to be different. You can go ahead and use it as needed now.&lt;/p&gt;
&lt;h4 id="resources"&gt;Resources&lt;/h4&gt;
&lt;p&gt;Here&amp;rsquo;s a couple of useful things I came across in the writing of this post:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=J29onrRqE_I&amp;amp;t=619s"&gt;Proxmox VE Full Course: Class 8&lt;/a&gt; - Creating Container Templates - video from Jay (Learn Linux TV)&lt;/p&gt;
&lt;p&gt;&lt;a href="https://pve.proxmox.com/wiki/Linux_Container"&gt;Linux Containers&lt;/a&gt; - from the Proxmox docs&lt;/p&gt;</description></item><item><title>Practice your restore strategy</title><link>https://blog.iankulin.com/practice-your-restore-strategy/</link><pubDate>Thu, 21 Dec 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/practice-your-restore-strategy/</guid><description>&lt;img src="https://blog.iankulin.com/images/img_7342.jpg" width="1000" alt=""&gt;
&lt;p&gt;My homelab set up is a production node, (pve-prod1) a backup production node (pve-prod2) and a development machine (pve-dev1). They are all G2 800 minis, but pve-prod1 has a i7 6700T and 32GB RAM, where as the other two are i5 6500T with 16GB. My thinking is that the older two can easily share the workload of the main production machine for disaster recovery. Everything is virtualised on top of Proxmox, so sharing up the VM&amp;rsquo;s and containers is trivial.&lt;/p&gt;
&lt;p&gt;Every three or four months, I run the nightly backups, turn off the production machine and restore back on to pve-prod2 and boot everything up. That was today&amp;rsquo;s job, and in the process I discovered a couple of things to address.&lt;/p&gt;
&lt;h3 id="issues"&gt;Issues&lt;/h3&gt;
&lt;p&gt;Issues were minor - everything was up again quite quickly, but they were:&lt;/p&gt;
&lt;h4 id="vm-disk-storage"&gt;VM disk storage&lt;/h4&gt;
&lt;p&gt;VM disk storage - I ran out on pve-prod2. Quite often when pve-prod1 is offline, it gets a new SSD, or most recently and 512GB of NMVE. So there&amp;rsquo;s oodles of room for the VM disks. As a result, I&amp;rsquo;m never mean with the sizes when I&amp;rsquo;m guessing what an application might need. I hate not allocating enough because expanding them is hard.&lt;/p&gt;
&lt;p&gt;Also, I&amp;rsquo;ve been moving docker workloads off the big docker VM and into their own LXC&amp;rsquo;s. But I&amp;rsquo;m still running the VM since it still has a couple of containers. All this adds up to there wasn&amp;rsquo;t enough room on the pve-prod2 SSD for all the VM disks. This is not the end of the world, I can leave the VM disks on the NAS and work over the network - but it&amp;rsquo;s a reminder to me to not let the backup hardware get to far behind the production hardware.&lt;/p&gt;
&lt;p&gt;Of course I could have moved some of these onto pve-dev1 (which is massively overspec&amp;rsquo;d) but I don&amp;rsquo;t really want to power two machines if I can get by with one. I have asked Father Christmas for another 512GB NMVE M2, so I&amp;rsquo;m optimistic this will be solved shortly.&lt;/p&gt;
&lt;h4 id="versions"&gt;Versions&lt;/h4&gt;
&lt;p&gt;After I moved all the VMs and LXCs, I realised I that pve-prod2 is running an old version of Proxmox - it&amp;rsquo;s on 7.4 and the others are on 8.1. Everything works (unless you need dark mode) but it was a mistake on my part, when I&amp;rsquo;d upgraded pve-prod1 I deliberately left prod2 on the old, known good, version but with the intention I&amp;rsquo;d upgrade it in a month or so, then never did.&lt;/p&gt;
&lt;h4 id="lxc-backup-to-nas"&gt;LXC Backup to NAS&lt;/h4&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/problems-backing-up-lxc-to-nfs-in-proxmox/"&gt;I&amp;rsquo;ve previously discussed this issue&lt;/a&gt;, where an LXC apparently does not have the require permissions for it&amp;rsquo;s temporary files on an NFS share but does have them for the finished backup. It&amp;rsquo;s a simple config change, but one that I hadn&amp;rsquo;t made to prod2. This is a good case for maintaining a post-proxmox-install Ansible playbook.&lt;/p&gt;
&lt;h3 id="bouquets"&gt;Bouquets&lt;/h3&gt;
&lt;h4 id="proxmox"&gt;Proxmox&lt;/h4&gt;
&lt;p&gt;I&amp;rsquo;ve been pondering if I should move away from Proxmox. I imagine I can achieve something similar with some combination of KVM, QEMU, Virt-Manager or Cockpit. I&amp;rsquo;d be learning some new things and be closer to a generic solution. On the other hand, I&amp;rsquo;m still learning about Proxmox, especially the command line stuff as I convert more of the homelab to infrastructure as code.&lt;/p&gt;
&lt;p&gt;Also, it&amp;rsquo;s just worked flawlessly. I was reminded today as I did this now routine task of the first time I moved a VM between two computers how exciting it was - and I was doing that as a noob using the web interface. Proxmox certainly meets all my current needs so I&amp;rsquo;ll be sticking with it. If I&amp;rsquo;m eBay tempted by more iron, I might have a play with some of the other options, but for the moment, I&amp;rsquo;m sticking with it.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m also conscious that the NAS is filling up (although slowly) and a future improvement would be to start to use the &lt;a href="https://www.proxmox.com/en/proxmox-backup-server/overview"&gt;Proxmox Backup Server&lt;/a&gt;. This delta&amp;rsquo;s your backups to allow a more comprehensive history to be kept while reducing the disk space being used. This will lock me into the Proxmox ecosystem a little more.&lt;/p&gt;
&lt;h4 id="synology"&gt;Synology&lt;/h4&gt;
&lt;p&gt;Also I need to shoutout Synology NAS&amp;rsquo;s. Just super reliable. I yearn for a ZFS solution, but if you just want reliable, gets things done storage for your homelab, they are an excellent choice for most situations. They are not sexy.&lt;/p&gt;
&lt;h4 id="monitoring"&gt;Monitoring&lt;/h4&gt;
&lt;img src="https://blog.iankulin.com/images/img_b42eca952bee-1.jpeg" width="577" alt=""&gt;
&lt;p&gt;A lot of the time I don&amp;rsquo;t really think about my monitoring - which consists or Uptime Kuma hooked up to Ntfy for phone notifications, and a &lt;a href="https://blog.iankulin.com/simple-api-endpoint-in-go/"&gt;custom Go program&lt;/a&gt; that exposes the RAM and disk use on each container and VM.&lt;/p&gt;
&lt;p&gt;But when you power down your production server, and your phone lights up in red, followed by green messages as each service comes back up, that&amp;rsquo;s a good feeling.&lt;/p&gt;
&lt;p&gt;Anyway, here&amp;rsquo;s your reminder to test your backup strategy if you haven&amp;rsquo;t done that for a while. Like me, you might learn something to your advantage.&lt;/p&gt;</description></item><item><title>New Self-Hosted Service Workflow</title><link>https://blog.iankulin.com/new-self-hosted-service-workflow/</link><pubDate>Sun, 03 Dec 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/new-self-hosted-service-workflow/</guid><description>&lt;p&gt;I&amp;rsquo;ve developed a bit of a workflow for setting up a new service of some type on the homelab. Installing it is the obvious thing, but I also have a few quality of life things I do to make it a full production-quality part of my installation. I thought it might be helpful to run through those things using a recent example of adding &lt;a href="https://www.audiobookshelf.org/"&gt;audiobookshelf&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="audiobookshelf"&gt;audiobookshelf&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://www.audiobookshelf.org/"&gt;audiobookshelf&lt;/a&gt; is a web based system for viewing, playing, downloading and/or generally managing your audio books. I&amp;rsquo;ve been an &lt;a href="https://www.audible.com.au/"&gt;Audible&lt;/a&gt; user/subscriber, but recently got grumpy at them about something - I think I had paused my subscription, and my downloaded books were still available on my phone. I was halfway through one, upgraded the app, and then wasn&amp;rsquo;t able to play the book without re-subscribing. That might not be exactly right, but it was some type of frustrating carry on like that.&lt;/p&gt;
&lt;p&gt;In any case, that made me decide I couldn&amp;rsquo;t trust them, and it was time to reassert my digital sovereignty by downloading the books I&amp;rsquo;d paid for (and the ones they&amp;rsquo;d given me), removing the &lt;a href="https://en.wikipedia.org/wiki/Digital_rights_management"&gt;DRM&lt;/a&gt;, and hosting it myself. The first two steps of that process were easily carried out with a brilliant bit of software called &lt;a href="https://openaudible.org/"&gt;OpenAudible&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="do-it-on-dev"&gt;Do it on dev&lt;/h3&gt;
&lt;img src="https://blog.iankulin.com/images/img_7003.jpg" width="900" alt=""&gt;
&lt;p&gt;Since I have the luxury of having separate production and development servers, I generally play around with new things I&amp;rsquo;m trying out on the dev instance of Proxmox. Note that this is almost entirely unnecessary - since everything is virtualised in Proxmox on the production server, there&amp;rsquo;s hardly any damage I could cause in one VM or container that would adversely affect anything else.&lt;/p&gt;
&lt;p&gt;Nevertheless, whether it&amp;rsquo;s caution, or a need to justify the size of the homelab, I always start building new things on the dev server. Once it&amp;rsquo;s all working perfectly, it&amp;rsquo;s a simple matter (that we&amp;rsquo;ll get to later) to move it as-is to the production server.&lt;/p&gt;
&lt;h3 id="installation-stack"&gt;Installation Stack&lt;/h3&gt;
&lt;p&gt;My default setup now is a Docker container, inside an LXC container on Proxmox. Although this originally felt like a comical number of levels of abstraction, each layer is doing something for me, and now it just feels like the cost of doing business.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Proxmox - virtualising everything insulates services from each other, makes moving them around easier, backing them up and restoring them trivial, and provides a level of high availability.&lt;/li&gt;
&lt;li&gt;LXC - lighter than a full VM, more VM like than Docker, and quicker to play with. Does add a bit of complexity we&amp;rsquo;ll get to later.&lt;/li&gt;
&lt;li&gt;Docker - OCI compliant containers are the bomb. This is how we do software now. I pushed back as long as I could but the logic is too strong. There are problems still to solve around &lt;a href="https://www.cisa.gov/sbom"&gt;SBOM&lt;/a&gt;, but the reduction in the work of managing installations is compelling.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I create a non-root user, and the &lt;code&gt;docker-compose.yml&lt;/code&gt; and the directories for any config or data all go in that user&amp;rsquo;s home directory. I don&amp;rsquo;t prefer &lt;a href="https://docs.docker.com/storage/volumes/"&gt;Docker volumes&lt;/a&gt; for the data any more since the &lt;a href="https://blog.iankulin.com/docker-volume-backup-is-more-complicated-than-it-should-be/"&gt;downsides&lt;/a&gt; annoy me and the upsides must be in order to solve problems I haven&amp;rsquo;t encountered yet.&lt;/p&gt;
&lt;p&gt;Since there are a few little gotchas using LXC, when I&amp;rsquo;m trying something for the very first time, and I&amp;rsquo;m not even sure if it&amp;rsquo;s going to end up being used, I&amp;rsquo;ll do it in an VM first. I have a bunch of VM&amp;rsquo;s on the dev machine in varying states, so I normally pick one of them that already had Docker installed. This also gives me an idea for the amount of RAM and disk space the container is going to need. Changing the memory size once it&amp;rsquo;s in production is no biggie, but expanding the disk space is a bit of stuffing around.&lt;/p&gt;
&lt;p&gt;When I&amp;rsquo;m ready to make the container, it&amp;rsquo;s always the latest Debian stable, unprivileged, nesting turned on. Very few web services require more than 1GB RAM, and I guess the disk usage from the earlier trials then add a bit. I have lots of disk space and CPU time - it&amp;rsquo;s usually memory that&amp;rsquo;s the first bottleneck you&amp;rsquo;ll run into on little homelab servers. I&amp;rsquo;m sure I&amp;rsquo;ve heard &lt;a href="https://2.5admins.com/"&gt;Jim Salter and Allan Jude&lt;/a&gt; recommend that you should keep the VM memory low to leave more for the host so the it can effectively cache for all the guests.&lt;/p&gt;
&lt;p&gt;I always use docker-compose. Too many times I&amp;rsquo;ve wanted to upgrade a container, and have to waste time figuring out what the run command was. The compose file is good documentation for where your data is as well if you are, like me, avoiding volumes.&lt;/p&gt;
&lt;h3 id="the-steps"&gt;The Steps&lt;/h3&gt;
&lt;h4 id="some-installs"&gt;Some installs&lt;/h4&gt;
&lt;p&gt;With the fresh LXC created (latest Debian stable, unprivileged, nesting turned on), and started, I use the Proxmox console to log in, do some &lt;code&gt;apt&lt;/code&gt; updates, use &lt;code&gt;adduser&lt;/code&gt; to add my user, &lt;code&gt;apt install sudo&lt;/code&gt; and then &lt;code&gt;usermod&lt;/code&gt; to add my user to the sudo group.&lt;/p&gt;
&lt;p&gt;I then switch to a real terminal and ssh in as that user to install Docker. While that&amp;rsquo;s happening, I log into my router and reserve the IP address for the new container. This will follow when I move the container to the production server since it takes it&amp;rsquo;s MAC address with it.&lt;/p&gt;
&lt;p&gt;My pattern for SSH keys, which might not be the most secure, is that I have a key per device. So there&amp;rsquo;s one from my laptop, one for the terminal on my phone, and one for a VM that I sometimes use as an entry point to my home network via Tailnet. My theory with all this is that if any of those devices are compromised (for example my laptop is stolen) I can revoke that key from each of my services.&lt;/p&gt;
&lt;h4 id="nas-mount"&gt;NAS Mount&lt;/h4&gt;
&lt;p&gt;Often the service I&amp;rsquo;m installing needs access to the NAS - and that&amp;rsquo;s the case for audibookshelf which obviously needs access to my collection of audio books on my four bay Synology. I use an &lt;code&gt;/etc/fstab&lt;/code&gt; entry to mount the folder I&amp;rsquo;m interested in. I&amp;rsquo;ve set up the NAS to share these over SMB. The entry for audiobookshelf looks like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;//192.168.100.32/media/books/audio/ /mnt/media cifs username=abs_user,password=SeCrErpaSSword,file_mode=0660,dir_mode=07
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;There&amp;rsquo;s a bit going on here, let&amp;rsquo;s pull it apart:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;//192.168.100.32/media/books/audio/&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The directory on the NAS where my audiobooks are stored. I&amp;rsquo;ve been a bit slack here. It would have been better for that directory to have been it&amp;rsquo;s own share to reduce the attack surface.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;/mnt/media&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the directory in the LXC container that we&amp;rsquo;re mounting the books to. If I could go back in time to when I started by Linux &amp;amp; self-hosting journey, I would not have used the word media, since in Linux that more refers to things like USB drives and less like entertainment to consume. &lt;a href="https://www.karlton.org/2017/12/naming-things-hard/"&gt;Naming things is hard&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;cifs&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The protocol being used for the share. I&amp;rsquo;ve got this shared folder set up as SMB, so I use CIFS. Some of my shares are NFS, so you could have &lt;code&gt;nfs&lt;/code&gt; at this position in the entry.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;username=abs_user,password=SeCrErpaSSword&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It seems bad to have these credentials in /etc/fstab where any user on this system can read them, but I am the only user on this system and I don&amp;rsquo;t know what other convenient way I could get around this.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;file_mode=0660&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Read/write for user and group&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;dir_mode=07&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Read/write/execute on directories for user &amp;amp; group&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Once that&amp;rsquo;s in the &lt;code&gt;/etc/fstab&lt;/code&gt;, you need to mount it with a &lt;code&gt;mount -a&lt;/code&gt;, then you should see the share by &lt;code&gt;ls&lt;/code&gt;-ing the mount point.&lt;/p&gt;
&lt;h4 id="docker-compose"&gt;Docker compose&lt;/h4&gt;
&lt;p&gt;Obviously this will vary with whatever service you&amp;rsquo;re running. Here&amp;rsquo;s mine for audiobookshare.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;version: &amp;#39;3&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;services:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; audiobookshelf:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; image: ghcr.io/advplyr/audiobookshelf
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; container_name: audiobookshelf
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ports:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &amp;#34;80:80&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; volumes:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - ./config:/config
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - ./metadata:/metadata
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - /mnt/media:/audiobooks
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; restart: always
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The notable things here are that I store all the container data - in this case &lt;code&gt;/config&lt;/code&gt; and &lt;code&gt;/metadata&lt;/code&gt; in subdirectories from the current directory, which is actually the user&amp;rsquo;s home directory. This LXC container is only for running this single service, so as soon as I &lt;code&gt;ssh&lt;/code&gt; in, everything I need to know or find out is easily discoverable, and easily accessible if I want to &lt;code&gt;scp&lt;/code&gt; it without a convoluted path.&lt;/p&gt;
&lt;p&gt;Another benefit of running in individual LXC&amp;rsquo;s is that each service has its own IP address - so I can use port 80 for every service.&lt;/p&gt;
&lt;h4 id="tailscale"&gt;Tailscale&lt;/h4&gt;
&lt;p&gt;Now that we can have up to 100 Tailscales on the free tier, every real service gets one. For the install, I just follow the &lt;a href="https://tailscale.com/kb/1174/install-debian-bookworm/"&gt;Debian Tailscale installation instructions&lt;/a&gt; since I&amp;rsquo;m using a Debian LXC. And now when we try &lt;code&gt;tailscale up&lt;/code&gt; we run into the LXC problem. I&amp;rsquo;ve already documented how to overcome that in &lt;a href="https://blog.iankulin.com/getting-tailscale-working-in-lxc-containers/"&gt;an earlier post&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The combination of using Tailscale, and having access to port 80 means that the web address for this service will just be whatever hostname I gave it, in this case http://ct327-audiobookshelf&lt;/p&gt;
&lt;h4 id="ansible"&gt;Ansible&lt;/h4&gt;
&lt;p&gt;Some of the next steps are so common, I&amp;rsquo;ve set up Ansible playbooks for them, but to allow me to apply them to the new server, they need to be added into my Ansible infrastructure. First the hosts file where they get a host entry and some variables.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-11-18-at-5.48.08-am.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-11-18-at-5.48.08-am.png" width="900" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Then in the encrypted &lt;code&gt;vault.yml&lt;/code&gt; file for the secrets. I&amp;rsquo;ve written about these before &lt;a href="https://blog.iankulin.com/first-ansible-playbook/"&gt;here&lt;/a&gt; and &lt;a href="https://blog.iankulin.com/ansible-with-secrets/"&gt;here&lt;/a&gt;. Since I have &lt;code&gt;hosts:all&lt;/code&gt; in the playbook that runs all my &lt;a href="https://gist.github.com/IanKulin/41dbf097ac6bddd9e315859d3a06fe02"&gt;&lt;code&gt;apt&lt;/code&gt; updates&lt;/a&gt;, this now means the LXC container will get all it&amp;rsquo;s updates.&lt;/p&gt;
&lt;p&gt;Now we can automate some tasks:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Make this server use our &lt;code&gt;apt-cache&lt;/code&gt; server to make updates a bit faster and efficient. Described &lt;a href="https://blog.iankulin.com/caching-apt-updates/"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Install a &lt;a href="https://blog.iankulin.com/simple-api-endpoint-in-go/"&gt;little endpoint&lt;/a&gt; so the available memory and disk space can be monitored.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Once that endpoint is installed, I can add a couple of entries to my &lt;a href="https://blog.iankulin.com/uptime-kuma-nfty/"&gt;Uptime Kuma&lt;/a&gt; instance to keep track of the server health and notify me with &lt;a href="https://blog.iankulin.com/uptime-kuma-nfty/"&gt;ntfy&lt;/a&gt; - so that&amp;rsquo;s monitoring covered off.&lt;/p&gt;
&lt;h4 id="backups"&gt;Backups&lt;/h4&gt;
&lt;p&gt;Backups in Proxmox are easy. I already have a general backup job set up for the prod DataCenter - it just snapshots every VM and LXC to the NAS at 1:00am each day. That&amp;rsquo;s plenty for this service - the only thing that would get lost would be a day&amp;rsquo;s worth of metadata, most of which is automatically pulled from web services anyway.&lt;/p&gt;
&lt;p&gt;This backup is of the LXC container with all the audiobookshelf config and code - not my book library. There is a backup process for it that&amp;rsquo;s a complicated collection of and external USB drive and &lt;code&gt;rsync&lt;/code&gt;-ing to a remote that might be a story for another day.&lt;/p&gt;
&lt;h3 id="done"&gt;Done&lt;/h3&gt;
&lt;p&gt;And that&amp;rsquo;s it. Now my audiobookshelf is running in an LXC container, serving the books off my NAS. The service is monitored for health, and there&amp;rsquo;s a backup plan in place. I can kick back and catch up on some technical reading.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/img_7018.jpg" alt=""&gt;&lt;/p&gt;</description></item><item><title>Ansible playbook to start Proxmox hosts</title><link>https://blog.iankulin.com/ansible-playbook-to-start-proxmox-hosts/</link><pubDate>Sun, 05 Nov 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/ansible-playbook-to-start-proxmox-hosts/</guid><description>&lt;img src="https://blog.iankulin.com/images/mick-jagger-start-me-up-video-the-rolling-stones-far-out-magazine-copy.jpg" width="683" alt=""&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/proxmox-tags-to-solve-a-problem/"&gt;In my last post&lt;/a&gt;, I talked about tagging guests in a Proxmox node so I could easily see which VMs and LXCs I needed to manually start before I ran an Ansible script to run all my &lt;code&gt;apt updates&lt;/code&gt;. It would have been reasonable to wonder why I didn&amp;rsquo;t just add things to my playbook to magically do that.&lt;/p&gt;
&lt;p&gt;The answer would be, I haven&amp;rsquo;t gotten around to it yet, so here goes:&lt;/p&gt;
&lt;h3 id="modules"&gt;Modules&lt;/h3&gt;
&lt;p&gt;You might remember we discussed that the various functionalities for Ansible are in &lt;em&gt;modules&lt;/em&gt;. The modules for starting Proxmox guests are &lt;code&gt;[community.general.proxmox_kvm](https://docs.ansible.com/ansible/2.9/modules/proxmox_kvm_module.html)&lt;/code&gt; for VMs, and &lt;code&gt;[community.general.proxmox](https://docs.ansible.com/ansible/2.9/modules/proxmox_module.html)&lt;/code&gt; for LXC containers. If you look at the documentation for either of those, you&amp;rsquo;ll see a couple of prerequisites: &lt;em&gt;proxmoxer&lt;/em&gt; and &lt;em&gt;requests&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-10-14-at-8.18.46-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-10-14-at-8.18.46-pm.png" width="900" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;requests&lt;/em&gt; is a common Python library (Ansible is actually running Python on the machines it&amp;rsquo;s configuring) for HTTP requests. We can ignore it since (a) you probably already have it installed, and (b) if not, when we install &lt;em&gt;proxmoxer&lt;/em&gt;, it will be installed as a dependency. You&amp;rsquo;ve probably already guessed that &lt;em&gt;proxmoxer&lt;/em&gt; is the Python library for interacting with Proxmox through it&amp;rsquo;s API.&lt;/p&gt;
&lt;p&gt;So before we can start any of the guests, we need to ensure proxmoxer is installed:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; tasks:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - name: Install proxmoxer
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; apt:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; name: python3-proxmoxer
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; state: latest
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="my-ansible-setup"&gt;My Ansible setup&lt;/h3&gt;
&lt;p&gt;It&amp;rsquo;s probably worth going over how my Ansible is set up so you can make sense of the rest of this without going back to read earlier posts. In the directory where I&amp;rsquo;m running this playbook, I have an &lt;code&gt;ansible.cfg&lt;/code&gt; file. Here&amp;rsquo;s the entire contents:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;[defaults]
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INVENTORY = hosts
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It&amp;rsquo;s an INI type file, and in this case it&amp;rsquo;s just saying if I don&amp;rsquo;t specify the name of an inventory file (a list of all my machines and their IP addresses or names), then use the file named &amp;lsquo;hosts&amp;rsquo;. This just saves me specifying the inventory file at the command line with the flag &lt;code&gt;-i&lt;/code&gt; each time.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;hosts&lt;/code&gt; file looks a bit like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#eceff4"&gt;[&lt;/span&gt;pve_dev1&lt;span style="color:#eceff4"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;pve&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;dev1
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#616e87;font-style:italic"&gt;#192.168.100.28&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#eceff4"&gt;[&lt;/span&gt;pve_dev1&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;vars&lt;span style="color:#eceff4"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ansible_user&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;&lt;span style="color:#a3be8c"&gt;&amp;#39;{{pve_dev1_user}}&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ansible_become_password&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;&lt;span style="color:#a3be8c"&gt;&amp;#39;{{pve_dev1_become_pass}}&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;There&amp;rsquo;s a couple of these entries for every &amp;lsquo;machine&amp;rsquo; that I manage. The first bit just gives the address for the machine, and the second the variables for that machine - a sudo user and their password. You could just type those entries in here like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#eceff4"&gt;[&lt;/span&gt;pve_dev1&lt;span style="color:#eceff4"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;pve&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;dev1
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#616e87;font-style:italic"&gt;#192.168.100.28&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#eceff4"&gt;[&lt;/span&gt;pve_dev1&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;vars&lt;span style="color:#eceff4"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ansible_user&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;root
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ansible_become_password&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;password1234
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Instead of putting my credentials in a text file that&amp;rsquo;s pushed up to github, I use another file called a &amp;lsquo;vault&amp;rsquo; which is encrypted to keep them in. I&amp;rsquo;ve explained about &lt;a href="https://blog.iankulin.com/ansible-with-secrets/"&gt;that elsewhere,&lt;/a&gt; but to understand what&amp;rsquo;s going on here, you just need to know that &lt;code&gt;'{{pve_dev1_user}}'&lt;/code&gt; gets resolved to &lt;code&gt;root&lt;/code&gt; when the playbook is run.&lt;/p&gt;
&lt;p&gt;You might also be wondering about the IP address that&amp;rsquo;s commented out in the snippets above. I am using the Tailscale MagicDNS on my machines, so I can just refer to this dev Proxmox instance as &lt;code&gt;pve-dev1&lt;/code&gt;, but yours is probably setup with IP address instead- in which case use that:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#eceff4"&gt;[&lt;/span&gt;pve_dev1&lt;span style="color:#eceff4"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#b48ead"&gt;192.168&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;&lt;span style="color:#b48ead"&gt;100.28&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#eceff4"&gt;[&lt;/span&gt;pve_dev1&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;vars&lt;span style="color:#eceff4"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ansible_user&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;root
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ansible_become_password&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;password1234
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So now the name being used in Ansible is pve_dev1, but it&amp;rsquo;s referring to the machine at 192.168.100.28&lt;/p&gt;
&lt;h3 id="starting-a-proxmox-vm"&gt;Starting a Proxmox VM&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - name: start vm321-deb
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; community.general.proxmox_kvm:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; api_user : root@pam
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; api_password: &amp;#39;{{pve_dev1_become_pass}}&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; api_host : pve-dev1
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; name : vm321-deb
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; state : started
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The api_host is the address of the node, and the user and password above it are the same ones you use to log into the web gui of this Proxmox server. name is the you gave the VM in Proxmox when you created it. Note that this is for a stand-alone Proxmox server, not a node that&amp;rsquo;s part of a cluster. If we had a cluster called &amp;lsquo;mycluster&amp;rsquo; and the server/node that vm321-deb was hosted on was called &amp;rsquo;node2&amp;rsquo; the Ansible entry for it would be:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - name: start vm321-deb
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; community.general.proxmox_kvm:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; api_user : root@pam
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; api_password: &amp;#39;{{pve_dev1_become_pass}}&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; api_host : mycluster
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; node : node2
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; name : vm321-deb
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; state : started
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="starting-an-lxc-container"&gt;Starting an LXC container&lt;/h3&gt;
&lt;p&gt;Increasingly, I run services in their own LXC container. They are quick to create and start, use less resources, but can still be snapshot-ed for easy backups.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - name: start ct351-go
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; community.general.proxmox:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; api_user : root@pam
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; api_password: &amp;#39;{{pve_dev1_become_pass}}&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; api_host : pve-dev1
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; vmid : 351
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; state : started
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So for these containers, we use a different module, and call them by their VMID instead of name.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s the full playbook.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#8fbcbb"&gt;---&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;- &lt;span style="color:#81a1c1"&gt;name&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Start pve-dev hosts for updating
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#616e87;font-style:italic"&gt;# ansible-playbook start-apt-dev-vms.yaml --ask-vault-pass &lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;vars_files&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; ./vault.yml
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;hosts&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; pve-dev1
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;become&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; &lt;span style="color:#81a1c1;font-weight:bold"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;tasks&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#81a1c1"&gt;name&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Install proxmoxer
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;apt&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;name&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; python3-proxmoxer
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;state&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; latest
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#81a1c1"&gt;name&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; start babybuntu
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;community.general.proxmox_kvm&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;api_user &lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; root@pam
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;api_password&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; &lt;span style="color:#a3be8c"&gt;&amp;#39;{{pve_dev1_become_pass}}&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;api_host &lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; pve-dev1
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;name &lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; babybuntu
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;state &lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; started
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#81a1c1"&gt;name&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; start vm321-deb
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;community.general.proxmox_kvm&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;api_user &lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; root@pam
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;api_password&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; &lt;span style="color:#a3be8c"&gt;&amp;#39;{{pve_dev1_become_pass}}&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;api_host &lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; pve-dev1
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;name &lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; vm321-deb
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;state &lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; started
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#81a1c1"&gt;name&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; start vm322-deb
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;community.general.proxmox_kvm&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;api_user &lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; root@pam
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;api_password&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; &lt;span style="color:#a3be8c"&gt;&amp;#39;{{pve_dev1_become_pass}}&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;api_host &lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; pve-dev1
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;name &lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; vm322-deb
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;state &lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; started
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#81a1c1"&gt;name&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; start vm323-deb
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;community.general.proxmox_kvm&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;api_user &lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; root@pam
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;api_password&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; &lt;span style="color:#a3be8c"&gt;&amp;#39;{{pve_dev1_become_pass}}&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;api_host &lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; pve-dev1
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;name &lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; vm323-deb
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;state &lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; started
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#81a1c1"&gt;name&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; start ct351-go
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;community.general.proxmox&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;api_user &lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; root@pam
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;api_password&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; &lt;span style="color:#a3be8c"&gt;&amp;#39;{{pve_dev1_become_pass}}&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;api_host &lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; pve-dev1
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;vmid &lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; &lt;span style="color:#b48ead"&gt;351&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;state &lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; started
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#81a1c1"&gt;name&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; start ct353-omada
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;community.general.proxmox&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;api_user &lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; root@pam
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;api_password&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; &lt;span style="color:#a3be8c"&gt;&amp;#39;{{pve_dev1_become_pass}}&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;api_host &lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; pve-dev1
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;vmid &lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; &lt;span style="color:#b48ead"&gt;353&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;state &lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; started
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; - &lt;span style="color:#81a1c1"&gt;name&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; start ct356-proxy
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;community.general.proxmox&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;api_user &lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; root@pam
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;api_password&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; &lt;span style="color:#a3be8c"&gt;&amp;#39;{{pve_dev1_become_pass}}&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;api_host &lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; pve-dev1
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;vmid &lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; &lt;span style="color:#b48ead"&gt;356&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#81a1c1"&gt;state &lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; started
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Proxmox tags to solve a problem</title><link>https://blog.iankulin.com/proxmox-tags-to-solve-a-problem/</link><pubDate>Thu, 02 Nov 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/proxmox-tags-to-solve-a-problem/</guid><description>&lt;p&gt;Each weekend I run an Ansible script that updates all my apt based VMs and containers. For the production machines, that&amp;rsquo;s everything, but my dev Proxmox is full of half-finished projects. Some of these have IP addresses reserved and are in the Ansible hosts file (because whatever service they are running is almost ready to move to the production server) others do not.&lt;/p&gt;
&lt;p&gt;Long story short, the dev server has some containers and VM&amp;rsquo;s that need turned on before I run the updates, and some that don&amp;rsquo;t. I could just start them all up, for the ten minutes the updates usually take, but that seems wasteful somehow. If there was only some way to mark the ones I need to turn on in the Proxmox webgui! Well, there is. We can add tags to machines in Proxmox.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-10-14-at-11.23.57-am-copy.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-10-14-at-11.23.57-am-copy.png" width="512" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Proxmox has quite a &lt;a href="https://pve.proxmox.com/pve-docs/pve-admin-guide.html#_tags"&gt;comprehensive tagging system&lt;/a&gt; - there are different display formats, and tags can be limited to a specific set, or completely free form. Also, there&amp;rsquo;s a heap of command line tools to work with them. For this job, I don&amp;rsquo;t really need much of that stuff - I just want to click a few things in the web gui to mark some of my VM&amp;rsquo;s with a coloured marker so I know which ones to start when I&amp;rsquo;m going to run my updates.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s the steps.&lt;/p&gt;
&lt;p&gt;Go into &lt;code&gt;DataCenter | Options&lt;/code&gt;. One of the options is &lt;code&gt;Tag Style Override&lt;/code&gt;. It&amp;rsquo;s called &amp;ldquo;Override&amp;rdquo; because by default, the colours are deterministically figured out from the tag text. I want to just have a nice dark blue associated with the tag &lt;code&gt;apt&lt;/code&gt;, so I&amp;rsquo;m going to set it. It turns out I could have just skipped this step and got a nice light blue for &lt;code&gt;apt&lt;/code&gt;. This system (of just figuring out a colour from the text) means in most cases you can completely skip this step. Each machine you tag with a particular tag will be marked with the same colour - it will just work. &lt;code&gt;test&lt;/code&gt; = pink, &lt;code&gt;fred&lt;/code&gt; = green, and so on.&lt;/p&gt;
&lt;p&gt;Back to me being fussy. Opening up the &lt;code&gt;Tag Style Override&lt;/code&gt; I&amp;rsquo;m setting apt to be dark blue with white text.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-10-14-at-2.58.00-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-10-14-at-2.58.00-pm.png" width="900" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;To apply these tags, you just click on the machine you want to tag, then notice that up the top of the web gui, next to the machine name, it says &amp;ldquo;No Tags&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-10-14-at-3.07.11-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-10-14-at-3.07.11-pm.png" width="900" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You just click on the pencil, and enter the tag name. If you haven&amp;rsquo;t changed any of the other defaults, a coloured circle will appear next to the machine in the server view.&lt;/p&gt;
&lt;p&gt;There are three display options for the tags - &amp;ldquo;full&amp;rdquo; which is a coloured bar including the text of the tag, &amp;ldquo;circle&amp;rdquo; which is the one shown in the first screenshot above, and &amp;ldquo;dense&amp;rdquo; which is a small rectangular bar - designed for stacking several different tags against each machine. All these options are under &amp;ldquo;tree shape&amp;rdquo; in the &lt;code&gt;Tag Color Override&lt;/code&gt; dialogue we opened earlier.&lt;/p&gt;
&lt;p&gt;As well as being able to see the tag blobs in the tree view, if you look at all your machines on the &lt;code&gt;Datacenter | Search&lt;/code&gt; view, it&amp;rsquo;s possible to sort by tags - which will even further simplify the job for me of starting them all up before I run the updates.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-10-14-at-3.35.21-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-10-14-at-3.35.21-pm.png" width="900" alt=""&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Getting Tailscale working in LXC containers</title><link>https://blog.iankulin.com/getting-tailscale-working-in-lxc-containers/</link><pubDate>Wed, 18 Oct 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/getting-tailscale-working-in-lxc-containers/</guid><description>&lt;p&gt;I&amp;rsquo;ve taken to running lots of my services in LXC containers under Proxmox. I like the feeling of installing in a VM, but it&amp;rsquo;s lightweight. I like the backups, I like things being isolated from each other, I like moving them around between machines easily. I&amp;rsquo;m just a big LXC lover at the moment.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m also a Tailscale lover, and the generous number of nodes in the free tier means I now just routinely install them in my VMs and containers without a thought.&lt;/p&gt;
&lt;p&gt;There is an issue with unprivileged LXC containers and Tailscale though. Unprivileged containers have less access to the host system&amp;rsquo;s internals, and are therefore a bit safer, but part of that reduced access includes some of the networking stuff that Tailscale needs. If you try to install Tailscale, it will look fine, until you get to the &lt;code&gt;tailscale up&lt;/code&gt; command, at which point it will say something like:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;failed to connect to local tailscaled (which appears to be running as tailscaled, pid 3121). Got error: 503 Service Unavailable: no backend
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;There is an easy way to fix this, documented in a &lt;a href="https://tailscale.com/kb/1130/lxc-unprivileged/"&gt;Tailscale how to guide&lt;/a&gt;. Basically you need to stop the container and edit the LXC conf file. These are named by the container number. My container is 354, so the conf file is &lt;code&gt;/etc/pve/lxc/354.conf&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Add the lines:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;lxc.cgroup2.devices.allow: c 10:200 rwm
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-09-19-at-8.01.13-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;This creates a TUN/TAP device (commonly used for VM networking) and creates a bind point to it inside the container. The effect of this is to enable the container to work with TUN/TAP devices and use them for networking purposes. This can be essential for various networking-related applications or services running within the container - including, in this case, Tailscale.&lt;/p&gt;
&lt;p&gt;Start the container again, redo your &lt;code&gt;tailscale up&lt;/code&gt;, and you should be in business.&lt;/p&gt;</description></item><item><title>Solved DNS Issues - Proxmox, LXC, Ubuntu, Tailscale</title><link>https://blog.iankulin.com/solved-dns-issues-proxmox-lxc-ubuntu-tailscale/</link><pubDate>Fri, 06 Oct 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/solved-dns-issues-proxmox-lxc-ubuntu-tailscale/</guid><description>&lt;p&gt;&lt;a href="https://i.imgur.com/WmRbmf5.png"&gt;&lt;img src="https://blog.iankulin.com/images/wmrbmf5.jpg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve picked up an new TP-Link WAP with Omada, so I wanted to spin up an Ubuntu 20.04 LXC to run the controller software in, and ended up spending a couple of hours figuring out why things where not working.&lt;/p&gt;
&lt;p&gt;The initial problem was I was having connectivity issues pulling down the updates for all the packages required. I went down a bit of a tangent because I installed an apt cache the other day, so I was looking for problems there. Eventually I narrowed it down to DNS not working and started A/B testing like this:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-08-26-at-4.49.24-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;A more seasoned sysadmin probably would have been looking at the &lt;code&gt;/etc/resolv.conf&lt;/code&gt; a bit earlier where the glaring hint was. I&amp;rsquo;ll get to that in a second, but first a bit about my setup.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m running Proxmox 8.0.4 on one of my HP G2 800 Minis (love these little power-frugal &lt;a href="https://blog.iankulin.com/moving-a-vm-between-two-proxmox-hosts/"&gt;gems&lt;/a&gt;) and I use Tailscale to tie all my network (my homelab here, and two remote locations) together. The Tailscale version on this node is 1.48.1&lt;/p&gt;
&lt;p&gt;You can see in the table above, that a LXC using the Ubuntu 20.04 template had no domain name resolution, but the Debian 12 (and Debian 11 I tried earlier did). The &lt;code&gt;/etc/resolv.conf&lt;/code&gt; on the Debian containers looked like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;nameserver 192.168.100.1
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And on the Ubuntu container&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# --- BEGIN PVE ---
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;search tailaf96a.ts.net
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;nameserver 100.100.100.100
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# --- END PVE ---
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;192.168.100.1&lt;/code&gt; is my local DNS which is provided from the DHCP, but clearly Ubuntu is not using that. The &lt;code&gt;PVE&lt;/code&gt; comments tells me it&amp;rsquo;s Proxmox messing with my container, and that&amp;rsquo;s the Tailscale DNS server number in there. The container does not have a route to &lt;code&gt;100.100.100.100&lt;/code&gt; so that DNS is not going to be able to resolved anything.&lt;/p&gt;
&lt;p&gt;So, that&amp;rsquo;s a bit weird, but easily fixed by just editing this back to set the nameserver to &lt;code&gt;192.160.100.1&lt;/code&gt; right? Well, yes - if you do that, it works, but then as soon as the container is rebooted, the Tailnet DNS gets written back in. Those blocky PVE comments are probably part of the automated system for doing that. So, what&amp;rsquo;s going on here?&lt;/p&gt;
&lt;p&gt;There&amp;rsquo;s two screens for network configuration when you&amp;rsquo;re creating an &lt;a href="https://en.wikipedia.org/wiki/RAS_syndrome"&gt;LXC container&lt;/a&gt; in the Proxmox GUI.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-08-26-at-4.55.54-pm-1.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-08-26-at-4.56.03-pm-1.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;There&amp;rsquo;s no option in the GUI to just say &lt;em&gt;&amp;ldquo;Use the DNS settings provided by the DHCP server&amp;rdquo;&lt;/em&gt;, although we&amp;rsquo;ll see later, there is a work around for this.&lt;/p&gt;
&lt;p&gt;Since I&amp;rsquo;d been leaving the &lt;code&gt;DNS domain:&lt;/code&gt; set to &lt;code&gt;use host settings&lt;/code&gt;. You might reasonably wonder what the Proxmox node /etc/resolv.conf looks like:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# resolv.conf(5) file generated by tailscale
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# For more info, see https://tailscale.com/s/resolvconf-overwrite
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# DO NOT EDIT THIS FILE BY HAND -- CHANGES WILL BE OVERWRITTEN
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;nameserver 100.100.100.100
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;search tailaf96a.ts.net local
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So actually, although I was thinking there must be some bug with Ubuntu since Debian was working how I expected, it&amp;rsquo;s the other way around - Ubuntu and Proxmox are working together to do exactly what the settings have told it to - to use the host settings. And actually, the Debian containers are not working correctly (although they were working how I expected). The process of Proxmox making these types of changes is documented in the &lt;a href="https://pve.proxmox.com/pve-docs/pve-admin-guide.html#_guest_operating_system_configuration"&gt;Admin Guide&lt;/a&gt;. I&amp;rsquo;d actually never seen that guide till today (although there is a large &amp;ldquo;Documentation&amp;rdquo; button in the top right of the web GUI), but it looks pretty great so I&amp;rsquo;ll be revisiting it.&lt;/p&gt;
&lt;h3 id="solution-1"&gt;Solution 1&lt;/h3&gt;
&lt;p&gt;The first solution is just to specify the DNS address in the GUI - then our container works exactly as the PVE developers intended. A slight downside is that if I change the network configuration in future and update the DNS address in the DHCP server (which is the logical way to do that) then it won&amp;rsquo;t update for this container and domain name resolution will stop working for it.&lt;/p&gt;
&lt;p&gt;If I do that, the &lt;code&gt;/etc/resolv.conf&lt;/code&gt; looks like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# --- BEGIN PVE ---
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;search tailaf96a.ts.net
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;nameserver 192.168.100.1
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# --- END PVE ---
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And it all works fine.&lt;/p&gt;
&lt;h3 id="solution-2"&gt;Solution 2&lt;/h3&gt;
&lt;p&gt;This &lt;a href="https://forum.proxmox.com/threads/lxc-dns-from-dhcp.36200/"&gt;post on the Proxmox Forums&lt;/a&gt; lead me to a second solution. It&amp;rsquo;s possible to stop Proxmox from adding the host by adding a little signal file with&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;touch /etc/.pve-ignore.resolv.conf
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;When Proxmox sees that. it won&amp;rsquo;t mess with the &lt;code&gt;/etc/resolv.conf&lt;/code&gt; file, so if that&amp;rsquo;s been edited to:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;nameserver 192.168.100.1
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It will be left alone, and things will work fine. This is not quite what I&amp;rsquo;d like - I&amp;rsquo;d really prefer it picks everything up from DHCP, but I don&amp;rsquo;t know enough about how that works in Linux to fix it, yet.&lt;/p&gt;</description></item><item><title>Problems backing up LXC to NFS in Proxmox</title><link>https://blog.iankulin.com/problems-backing-up-lxc-to-nfs-in-proxmox/</link><pubDate>Sun, 24 Sep 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/problems-backing-up-lxc-to-nfs-in-proxmox/</guid><description>&lt;p&gt;If you create an unprivileged LXC container on Proxmox, then try to back it up to an NFS share, for example on a NAS, you&amp;rsquo;ll get an error when it tries to build the temporary file.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-08-14-at-9.15.29-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-08-14-at-9.15.29-pm.png" width="900" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The clue is in the &lt;code&gt;Permission denied&lt;/code&gt; line. It is trying to create a temporary file on my NAS, and failing because of a &lt;a href="https://blog.iankulin.com/could-it-be-a-permissions-problem/"&gt;permissions&lt;/a&gt; problem. If I try the same backup to the local storage, it works fine.&lt;/p&gt;
&lt;p&gt;The solution is to build the temporary file in the local storage. To do this, you need to edit the &lt;code&gt;/etc/vzdump.conf&lt;/code&gt; on the Proxmox node to set the &lt;code&gt;tmpdir: /tmp&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-08-14-at-9.16.14-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-08-14-at-9.16.14-pm.png" width="900" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Then if you run the backup again, it will be able to create the temporary file, and successfully copy it to the share.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-08-14-at-9.15.20-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-08-14-at-9.15.20-pm.png" width="900" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It doesn&amp;rsquo;t make sense to me how it has the permissions to copy the finished backup file to the share, but not create a temporary file there - but I&amp;rsquo;m not curious enough today to find out. Shout out to user &lt;a href="https://forum.proxmox.com/members/dunuin.96080/"&gt;Dunuin&lt;/a&gt; in the Proxmox &lt;a href="https://forum.proxmox.com/threads/cannot-backup-only-lxc-to-nfs-vm-works.90797/"&gt;forums&lt;/a&gt; for the suggestion to change the &lt;code&gt;tmpdir&lt;/code&gt; in &lt;code&gt;/etc/vzdump.conf&lt;/code&gt;&lt;/p&gt;</description></item><item><title>Error wiping old drive in Proxmox</title><link>https://blog.iankulin.com/error-wiping-old-drive-in-proxmox/</link><pubDate>Thu, 31 Aug 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/error-wiping-old-drive-in-proxmox/</guid><description>&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-07-22-at-12.19.42-pm-copy.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-07-22-at-12.19.42-pm-copy.png" width="568" alt="Error: disk/partition '/dev/sda3' has a holder (500)"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;When I popped in an NVME drive and freshly installed Proxmox to it, I assumed I&amp;rsquo;d just be able to wipe the SDD that had previously been the boot drive to set it up as a ZFS pool. However, when I tried to do the wipe, I was greeted with the error:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;disk/partition &amp;#39;/dev/sda3&amp;#39; has a holder (500)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I assume this means there&amp;rsquo;s a flag set on one of the Proxmox partitions to prevent accidental deletion or Proxmox thought that&amp;rsquo;s where it was running from. It&amp;rsquo;s likely that it&amp;rsquo;s related to this message I had during installation that I haven&amp;rsquo;t seen before:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/img_5830.jpg" alt="Detected existing &amp;lsquo;pve&amp;rsquo; Volume Group(s)! Do you want to: rename VG backed by PV &amp;lsquo;/dev/sda3&amp;rsquo; to &amp;lsquo;pve-OLD-D4DDE7DC&amp;rsquo; or cancel the installation?"&gt;&lt;/p&gt;
&lt;p&gt;Since I didn&amp;rsquo;t want to cancel the installation, I went ahead and told it okay. On the non-graphical &amp;lsquo;console&amp;rsquo; version of the installer, this message is truncated, and the only option available is abort. I guess that&amp;rsquo;s an installer bug. So if you are adding a extra boot drive to an existing Proxmox node, I suggest using the graphical installer.&lt;/p&gt;
&lt;p&gt;When I Googled around for the &amp;ldquo;has a holder&amp;rdquo; error, there were several unanswered requests for help for this, several speculative answers, and &lt;a href="https://www.reddit.com/r/Proxmox/comments/xff5ri/how_do_i_wipe_an_old_drive/"&gt;one that worked&lt;/a&gt;.&lt;/p&gt;
&lt;img src="https://blog.iankulin.com/images/66d29d7d-bc29-4747-b92a-7fc7c790227f_text.gif" width="400" alt=""&gt;
&lt;p&gt;You need to use &lt;code&gt;fdisk&lt;/code&gt; to remove each partition. Take a note of the drive name - I could see in the Proxmox GUI that mine was sda, so the command to run was:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;fdisk /dev/sda&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;You probably need to have a &lt;a href="https://www.howtogeek.com/106873/how-to-use-fdisk-to-manage-partitions-on-linux/"&gt;read-up on&lt;/a&gt; &lt;code&gt;[fdisk](https://www.howtogeek.com/106873/how-to-use-fdisk-to-manage-partitions-on-linux/)&lt;/code&gt; if you&amp;rsquo;re not familiar with it, but basically, you&amp;rsquo;re in the command mode, for one of the partitions (my &lt;code&gt;sda&lt;/code&gt; had three) if you press the &lt;code&gt;d&lt;/code&gt; key here it marks that partition for deletion. Even though the error message had said it was the last partition that was causing the headache, I just went ahead and deleted all of them. There&amp;rsquo;s no warnings as you do this, and actually no changes have been made yet, that happens when you press &lt;code&gt;w&lt;/code&gt; to write the changes. No warning here either. 🙂&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-07-22-at-12.29.16-pm.png" alt="fdisk screenshot"&gt;&lt;/p&gt;
&lt;p&gt;That gave an error saying the third partition was still in use by the kernel, so I followed the advice to reboot, then I was able to wipe the drive in the Proxmox web GUI.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-07-22-at-12.30.09-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-07-22-at-12.30.09-pm.png" width="800" alt=""&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>ZFS Basics on Proxmox</title><link>https://blog.iankulin.com/zfs-basics-on-proxmox/</link><pubDate>Sat, 29 Jul 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/zfs-basics-on-proxmox/</guid><description>&lt;p&gt;I&amp;rsquo;m a keen listener of the &lt;a href="https://2.5admins.com/"&gt;2.5 Admins&lt;/a&gt; podcast in which there&amp;rsquo;s frequent enumeration of the advantages of &lt;a href="https://itsfoss.com/what-is-zfs/"&gt;ZFS&lt;/a&gt; as a file system. So much so, that I&amp;rsquo;ve had occasional twinges or regret about the money I spent on the Synology - although it has been boringly reliable and does everything I need.&lt;/p&gt;
&lt;p&gt;Proxmox has some built in support for ZFS, including through the web GUI. So I&amp;rsquo;ve been itching to give it a try.&lt;/p&gt;
&lt;p&gt;I had a 256GB M2 NVME sitting around - I bought it with the plan to try it as the root drive in one of the servers. That was when I was worried that one of the servers&amp;rsquo; drives was about dead because the SMART data said it was at 100% use. I&amp;rsquo;ve since discovered that various companies interpret that different ways, so probably it&amp;rsquo;s 100% okay.&lt;/p&gt;
&lt;p&gt;I started to think a little &lt;a href="https://www.techtarget.com/searchstorage/definition/JBOD"&gt;JBOD&lt;/a&gt; with a couple of NVME SSD mirrored drives would be a fun project. There&amp;rsquo;s no way I could do that inside the case to get the proper PCI access, but the my HP 800 G2&amp;rsquo;s all have USB 3 so it shouldn&amp;rsquo;t be terrible - probably a lot better than the spinning rust NAS over 1GB Ethernet.&lt;/p&gt;
&lt;p&gt;I purchased this little UNITEK S1206A dual bay enclosure and another stick of 256GB Samsung SSD.&lt;/p&gt;
&lt;img src="https://blog.iankulin.com/images/img_5742.jpg" width="600" alt=""&gt;
&lt;img src="https://blog.iankulin.com/images/s-l960.jpg" width="600" alt=""&gt;
&lt;p&gt;The instructions for the unit show sticking a layer of silicon over the top of the gum sticks, and then a thin piece of aluminum. I&amp;rsquo;ve heard these get hot, but it wasn&amp;rsquo;t clear to me if I should peel that paper off first. So I&amp;rsquo;ve done nothing for the moment while I do some more research.&lt;/p&gt;
&lt;p&gt;The process of getting it set up in Proxmox was simple. If you select the node in the web interface, and go in to &lt;em&gt;Disks&lt;/em&gt;, you can see a list of the physical disks attached. The NVME drives showed up as NTFS so I wiped them by selecting the drive and pressing the &lt;em&gt;Wipe Disk&lt;/em&gt; button.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-07-04-at-6.19.00-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;You can see on the screenshot above, that further down in the Disks list it says ZFS. That&amp;rsquo;s where you go to create the ZFS pool. I probably need to pause here, and go over some of the ZFS terminology.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.victormendonca.com/2020/11/03/zfs-for-dummies/"&gt;&lt;img src="https://blog.iankulin.com/images/zfs-components-1.png" width="706" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;To start in the middle, we have the concept of a ZFS Pool. This is, well, a pool of storage that&amp;rsquo;s available to be used. It has a size, and we can see how much space is available. The pool is made up of vdev (virtual devices). A vdev could be a single physical drive, or multiple drives in some kind of RAID arrangement.&lt;/p&gt;
&lt;p&gt;In my situation, with the two NVME drives, my zpool will be made up of a single vdev comprising two physical drives which have been mirrored.&lt;/p&gt;
&lt;p&gt;In the zpool, we can create &lt;em&gt;datasets&lt;/em&gt; where we can actually put some data. You can think of these as directories in the sense they have a name and we can create directories and store data inside them, but in ZFS, the datasets in a zpool can have different settings (such as compression, de-duplication) applied to them. This is also the level where snapshots can be taken for backups.&lt;/p&gt;
&lt;p&gt;To create the ZFS pool in Proxmox, again select the node, then select ZFS in the list under &lt;em&gt;Disks&lt;/em&gt;. At the top is a button for &lt;em&gt;Create ZFS&lt;/em&gt;. Select the wiped drives, chose your RAID and give it a name. By tradition the pools are usually called &amp;rsquo;tank&amp;rsquo; - if you look at a few tutorials you&amp;rsquo;ll see that all over the place.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-07-04-at-8.26.42-pm.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Once that was done, tank appeared as storage in the list under my node. I moved the drives of these dev guests across to it so the zpool would have something to do. I did notice that this process would rush through, then pause for a few seconds - something I haven&amp;rsquo;t noticed when moving guest droves between the NAS and internal SSDs. Early reviews of Samsung pm981 NVME SSD &lt;a href="https://www.tomshardware.com/reviews/samsung-pm981-980-nvme-ssd,5323.html"&gt;noted a sustained write dropoff&lt;/a&gt;, so this might be something to come back and have a look at later.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-07-04-at-8.23.10-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;If we drop into the shell now, we can have a look at the datasets.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;root@pve-prod1:/# zfs list
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;NAME USED AVAIL REFER MOUNTPOINT
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;tank 32.0G 199G 96K /tank
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;tank/vm-300-disk-0 16.5G 209G 6.04G -
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;tank/vm-321-disk-0 5.16G 202G 1.67G -
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;tank/vm-322-disk-0 5.16G 202G 1.62G -
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;tank/vm-323-disk-0 5.16G 202G 1.60G -
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;root@pve-prod1:/# 
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So my pool is &lt;code&gt;tank&lt;/code&gt;, and there&amp;rsquo;s been datasets created for each of the VM guests&amp;rsquo; disks. We can create a data set to start using the pool as well.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;zfs create tank/temp_set
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That creates a dataset called &lt;code&gt;temp_set&lt;/code&gt; in the &lt;code&gt;tank&lt;/code&gt; zpool. It will have been mounted for us too. Let&amp;rsquo;s create a 1 GB file in there.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;root@pve-prod1:/# cd /tank/temp_set
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;root@pve-prod1:/tank/temp_set# head -c 1G &amp;lt;/dev/urandom &amp;gt;myfile
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;root@pve-prod1:/tank/temp_set# ls
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;myfile
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then if we list the datasets again.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;root@pve-prod1:/tank/temp_set# zfs list
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;NAME USED AVAIL REFER MOUNTPOINT
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;tank 33.0G 198G 104K /tank
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;tank/temp_set 1.00G 198G 1.00G /tank/temp_set
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;tank/vm-300-disk-0 16.5G 208G 6.04G -
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;tank/vm-321-disk-0 5.16G 201G 1.67G -
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;tank/vm-322-disk-0 5.16G 201G 1.62G -
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;tank/vm-323-disk-0 5.16G 201G 1.60G -
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;root@pve-prod1:/tank/temp_set# 
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Once you&amp;rsquo;ve created a dataset, you can just use it as a regular place to store stuff. ZFS will go on doing it&amp;rsquo;s magic in the background to keep your data safe with copy-on-write and other magic. It&amp;rsquo;s good ZFS practice to do a &lt;em&gt;scrub&lt;/em&gt; every now and then. This causes ZFS to use whatever information it&amp;rsquo;s got to check the integrity of all your data.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;root@pve-prod1:/# zpool scrub tank
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;root@pve-prod1:/# zpool status -v tank
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; pool: tank
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; state: ONLINE
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; scan: scrub repaired 0B in 00:00:53 with 0 errors on Tue Jul 4 20:58:16 2023
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;config:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; NAME STATE READ WRITE CKSUM
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; tank ONLINE 0 0 0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; mirror-0 ONLINE 0 0 0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; sdb ONLINE 0 0 0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; sdc ONLINE 0 0 0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;errors: No known data errors
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;root@pve-prod1:/# 
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;While I&amp;rsquo;ve been writing this post, I&amp;rsquo;ve been copying data to and fro (I&amp;rsquo;d try things out, then have to delete and repeat to get the screen shot I wanted, and at one stage I decided to change the name of the zpool so all the disk images had to be moved off then back on after I&amp;rsquo;d recreated it etc) for about 90 minutes, and I&amp;rsquo;ve just been in the server rooms to see if the external NVME enclosure is hot. It&amp;rsquo;s warm to the touch, I&amp;rsquo;d guess 40° - so not alarming for this level of use. That box is pretty well ventilated.&lt;/p&gt;
&lt;p&gt;If you want a good summary of ZFS, particularly the thinking behind it, this is a great overview.&lt;/p&gt;
&lt;div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"&gt;
 &lt;iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/lsFDp-W1Ks0?autoplay=0&amp;amp;controls=1&amp;amp;end=0&amp;amp;loop=0&amp;amp;mute=0&amp;amp;start=0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"&gt;&lt;/iframe&gt;
 &lt;/div&gt;
</description></item><item><title>Proxmox 8.0 Install</title><link>https://blog.iankulin.com/proxmox-8-0-install/</link><pubDate>Sun, 23 Jul 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/proxmox-8-0-install/</guid><description>&lt;p&gt;I&amp;rsquo;m normally a x.1 release type of sysadmin, but the increasing temptation of installing Proxmox 8.0 while I&amp;rsquo;ve got some time off, and the fact that I&amp;rsquo;ve got a cluster, so I can just move the VM&amp;rsquo;s around all adds up to thinking I&amp;rsquo;ll do that today.&lt;/p&gt;
&lt;img src="https://blog.iankulin.com/images/cluster-2.png" width="328" alt=""&gt;
&lt;p&gt;Here&amp;rsquo;s how my system works. It consists of three HP-800 mini G2&amp;rsquo;s. &lt;code&gt;pve-prod1&lt;/code&gt; is a bit fancier - i7 6700T and 32GB, the other two are i5 6500T and 16GB. The production VM&amp;rsquo;s use the local SSD but backups go to the NAS. All the machines are currently running Proxmox 7.4. They are not clustered in the proper sense - I don&amp;rsquo;t need high availability, and I don&amp;rsquo;t want to run them all the time. &lt;code&gt;pve-prod1&lt;/code&gt; runs 24/7 and I just power up &lt;code&gt;pve-dev1&lt;/code&gt; when I&amp;rsquo;m working on something.&lt;/p&gt;
&lt;p&gt;The intention is that although I&amp;rsquo;m not on high availability, I can quickly come back from a machine failure by powering &lt;code&gt;pve-prod2&lt;/code&gt; up and restoring from the latest VM backup from the NAS. &lt;code&gt;pve-prod1&lt;/code&gt; does not have a full load yet (I&amp;rsquo;m slowly cancelling cloud services and moving them in-house) but once it does, I&amp;rsquo;d have the capacity to fully replace it by sharing any guests between &lt;code&gt;pve-prod2&lt;/code&gt; and &lt;code&gt;pve-dev1&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id="migration-plan"&gt;Migration plan&lt;/h3&gt;
&lt;img src="https://blog.iankulin.com/images/migration-1.png" width="273" alt=""&gt;
&lt;p&gt;Currently &lt;code&gt;pve-prod1&lt;/code&gt; is only running two guests, jellyfin, and a docker host with a collection of smallish services. The plan is to move those to &lt;code&gt;pve-prod2&lt;/code&gt;, check everything is working, then install the new Proxmox 8 onto &lt;code&gt;pve-prod1&lt;/code&gt;. Apart from giving me the opportunity to do that, it&amp;rsquo;s a good test of the plan for recovering from a &lt;code&gt;pve-prod1&lt;/code&gt; failure. I&amp;rsquo;ll live off it for a few days to ensure that it&amp;rsquo;s a viable process.&lt;/p&gt;
&lt;p&gt;A small hitch with this is that the RAM in &lt;code&gt;pve-prod1&lt;/code&gt; cost me $100, and I didn&amp;rsquo;t want to not use it, so I created the jellyfin VM with 16GB RAM. It&amp;rsquo;s a simple matter to stop it, give it less, and restart it - except it seems to be using it all.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-07-04-at-7.31.59-am.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;You can see from this, I tried shutting it down and restarting - thinking that the memory use might climb up slowly as the app was used, but it just went straight back to 15GB. In a way, I approve of a VM using the memory I&amp;rsquo;ve given it - presumably it is caching or something. Jellyfin should certainly be able to run on a machine with much less memory, so I suppose I&amp;rsquo;ll stop it, back it up, and try it in a smaller VM.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-07-04-at-7.42.58-am.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Yep, that works fine. And I can&amp;rsquo;t notice any difference in the app performance. So I stopped it, backed it up, and restored onto prod2. And immediately bumped into a couple of problems when I tried to start it.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-07-04-at-8.52.34-am.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;There was two hardware incompatibilities - the first was that on prod1 I had passed through the GPU from the host (in an unsuccessful attempt to use quicksync hardware transcoding for video). I don&amp;rsquo;t need that, so that gets deleted out of the &amp;lsquo;hardware&amp;rsquo; for the VM.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-07-04-at-8.47.00-am.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;And the second was that I still had the Debian 11 ISO mounted in the &amp;lsquo;cd-rom&amp;rsquo;. Lol - the Debian installer specifically tells you to remove this before it reboots. That can be removed exactly as I had done for the GPU pass through, and the VM boots fine, and the app tests out ok.&lt;/p&gt;
&lt;p&gt;The first time I ever did this - move a guest VM from one lot of hardware to another, then boot it up and all my apps are working perfectly on their old IP addresses - I was amazed and danced around in excitement. I didn&amp;rsquo;t dance today, but it is so cool.&lt;/p&gt;
&lt;p&gt;Interestingly, it&amp;rsquo;s decided to use much less RAM now. I caused that increase at the end of the graph by rescanning the media library, then browsing through all the titles so the cover images would have to be loaded - so perhaps it&amp;rsquo;s the web server caching them all. It&amp;rsquo;s hard to know for sure without some objective measurements, but I suspect the app was crisper and more responsive than before. In any case, it certainly wasn&amp;rsquo;t any worse.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-07-04-at-9.02.56-am.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Moving the docker host over was straightforward and only took five minutes of downtime as it&amp;rsquo;s a smaller image. I guess a lot of that time is just my 1GB network limitation or the spinning disk transfer speed from the NAS - the docker hoats was 4GB and Jellyfin 14GB.&lt;/p&gt;
&lt;h3 id="nuke-and-pave"&gt;Nuke and pave&lt;/h3&gt;
&lt;p&gt;I try and keep my hosts very clean, so wiping them and starting over is no biggie, but since this node has been up I have installed a chron job for &lt;a href="https://blog.iankulin.com/linux-shell-script-for-temperature-logging/"&gt;temperature logging&lt;/a&gt;. I&amp;rsquo;ve documented that in a blog post so I&amp;rsquo;ll be able to recreate it, but this sort of thing is the reason I&amp;rsquo;m interested in &lt;a href="https://blog.iankulin.com/getting-started-with-ansible/"&gt;Ansible&lt;/a&gt;. Another project while I&amp;rsquo;ve got some time will be to recreate that on the new machine with Ansible so it&amp;rsquo;s trivial to restore in future. I pulled the temperature log file down though - because who doesn&amp;rsquo;t like eighty thousand data points.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/temp1.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;There is a &lt;a href="https://pve.proxmox.com/wiki/Upgrade_from_7_to_8"&gt;published process to upgrade Proxmox&lt;/a&gt; from 7.x to 8, so I briefly considered it, but fresh installs are generally less likely to lead to drama, especially this early in the major release cycle. Plus, I keep my installs clean to allow it - this is a freedom allowed by my sysadmin discipline along with the investment in redundant hardware so there&amp;rsquo;s zero time pressure while I&amp;rsquo;m doing it.&lt;/p&gt;
&lt;h3 id="run-book-for-new-proxmox-install"&gt;Run Book for New Proxmox Install&lt;/h3&gt;
&lt;p&gt;My install process for Proxmox goes something like this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Flash the ISO onto a USB drive with &lt;a href="https://etcher.balena.io/"&gt;Balena Etcher&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Plug in the USB drive, my bluetooth keyboard/mouse USB, and the screen - I&amp;rsquo;ve got a special long HDMI cord that reaches from my desk to the servers&lt;/li&gt;
&lt;li&gt;Boot up, mashing the boot menu key (F9 on my G2&amp;rsquo;s)&lt;/li&gt;
&lt;li&gt;Follow my nose through the prompts - since this is an existing server, the DHCP serves up the correct IP address&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ssh&lt;/code&gt; into it to check everything&amp;rsquo;s fine. Since this IP was already in my known hosts file, I had to go an delete it out&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ssh-copy-id&lt;/code&gt; to get my ssh keys across&lt;/li&gt;
&lt;li&gt;Update the repositories - by default, Proxmox comes set up to use with a subscription. I wish they had a lower tier and I&amp;rsquo;d by one since it gives me so much joy - even if it didn&amp;rsquo;t remove the nags. In the meantime, you can follow the instructions &lt;a href="https://pve.proxmox.com/wiki/Package_Repositories#sysadmin_no_subscription_repo"&gt;here&lt;/a&gt; to set it up to use the non-subscription repoistories:
&lt;ul&gt;
&lt;li&gt;edit &lt;code&gt;/etc/apt/sources.list&lt;/code&gt; to add &lt;code&gt;deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;edit &lt;code&gt;/etc/apt/sources.list.d/pve-enterprise.list&lt;/code&gt; to comment out the line in there&lt;/li&gt;
&lt;li&gt;and a new one that&amp;rsquo;s not mentioned on that wiki page, edit &lt;code&gt;/etc/apt/sources.list.d/ceph.list&lt;/code&gt; to comment out the line in there. I don&amp;rsquo;t know where that leaves you if you are using Ceph (which is a cool file system if you&amp;rsquo;re using high availability) but I&amp;rsquo;m not, so all good. If you don&amp;rsquo;t do this, you&amp;rsquo;ll get errors like &lt;code&gt;E: Failed to fetch https://enterprise.proxmox.com/debian/ceph-quincy/dists/bookw orm/InRelease 401 Unauthorized IP: 103.76.41.50 4431 E: The repository &amp;quot;https://enterprise.proxmox.com/debian/ceph-quincy bookworm In Release' is not signed.&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Run the updates with &lt;code&gt;apt update&lt;/code&gt; &amp;amp;&amp;amp; &lt;code&gt;apt upgrade&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Install the certificate - you need SSL setup for the web interface if you want Chrome to let it save your password, which I do. Also the red &lt;em&gt;insecure&lt;/em&gt; message bugs me
&lt;ul&gt;
&lt;li&gt;Log into the web interface at https://&lt;ip address&gt;:8006 - you&amp;rsquo;ll need to jump through all those hoops to take on the responsibility of opening an unsecured site&lt;/li&gt;
&lt;li&gt;If you click on the node, then certificates&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-07-04-at-12.08.29-pm.png" alt=""&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;ul&gt;
&lt;li&gt;You can open up that certificate, and copy out the raw certificate, paste it into a text editor and save it somewhere. I drag that into my macOS keychain app. It shows up with a red cross, but if you open it up you can mark it as &amp;ldquo;always trust&amp;rdquo;&lt;/li&gt;
&lt;li&gt;We&amp;rsquo;re not done yet, now back in Chrome, click on the &lt;em&gt;insecure&lt;/em&gt; message next to the URL. Go into &lt;em&gt;Site Settings&lt;/em&gt; | &lt;em&gt;Insecure Content&lt;/em&gt; and change it to &lt;em&gt;Allow&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Almost there - at the top of those settings is a button to clear the cache, do that&lt;/li&gt;
&lt;li&gt;Reload the page. Profit.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Then I &lt;a href="https://tailscale.com/kb/1031/install-linux/"&gt;install Tailscale&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Last of all, add my NAS to the storage. I use NFS. The only trick here is to go into the dropdown of what type of content is on that storage, and select everything&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-07-04-at-12.17.35-pm.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;And that&amp;rsquo;s it. Nice new Proxmox. I&amp;rsquo;ll leave my production VM&amp;rsquo;s on pve-prod2 for a week, and move all of my dev work over to this machine so it gets some exercise before I upgrade the other machines.&lt;/p&gt;
&lt;h3 id="tailscale"&gt;Tailscale&lt;/h3&gt;
&lt;p&gt;The only small issue I ran into (apart from the Ceph repository) was I couldn&amp;rsquo;t access the machine via it&amp;rsquo;s &amp;ldquo;magic DNS&amp;rdquo; Tailscale name. Since it was going to be the same name as a machine in my existing network, I&amp;rsquo;d thought ahead and deleted the old one out via the &lt;a href="https://login.tailscale.com/admin/machines"&gt;Tailscale machines&lt;/a&gt; page, but even so, it wouldn&amp;rsquo;t connect from my laptop.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-07-04-at-11.45.38-am.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;I assume the old Tailscale IP address was cached somewhere, and fixed it by turning Tailscale off and on again on my laptop.&lt;/p&gt;</description></item><item><title>Proxmox LXC backup to NFS share failing</title><link>https://blog.iankulin.com/proxmox-lxc-backup-to-nfs-share-failing/</link><pubDate>Wed, 12 Apr 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/proxmox-lxc-backup-to-nfs-share-failing/</guid><description>&lt;p&gt;I was doing updates on all my nodes and VM&amp;rsquo;s today, and backing up the VMs that aren&amp;rsquo;t already on a backup schedule. On my dev machine I have a Debian LXC container that I mostly just use for trying out Linux commands and playing around. I used to have a backup of it that I used a lot - after playing around I like to set it back to a fresh install plus my ssh keys - but I lost it somehow when moving the VM to new metal.&lt;/p&gt;
&lt;p&gt;When I tried to back it up today, I got this drama.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; starting new backup job&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; vzdump &lt;span style="color:#b48ead"&gt;200&lt;/span&gt; &lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;node pve&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;dev1 &lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;mode snapshot &lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;remove &lt;span style="color:#b48ead"&gt;0&lt;/span&gt; &lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;notes&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;template &lt;span style="color:#a3be8c"&gt;&amp;#39;{{vmid}}-{{guestname}} ({{node}}) - after timezone fix&amp;#39;&lt;/span&gt; &lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;storage NAS&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;DS2 &lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;compress zstd
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Starting Backup of VM &lt;span style="color:#b48ead"&gt;200&lt;/span&gt; &lt;span style="color:#eceff4"&gt;(&lt;/span&gt;lxc&lt;span style="color:#eceff4"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Backup started at &lt;span style="color:#b48ead"&gt;2023&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;04&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;07&lt;/span&gt; &lt;span style="color:#b48ead"&gt;17&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#b48ead"&gt;11&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#b48ead"&gt;08&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; status &lt;span style="color:#81a1c1"&gt;=&lt;/span&gt; running
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; CT Name&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; babydeb
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; including mount point rootfs &lt;span style="color:#eceff4"&gt;(&lt;/span&gt;&lt;span style="color:#a3be8c"&gt;&amp;#39;/&amp;#39;&lt;/span&gt;&lt;span style="color:#eceff4"&gt;)&lt;/span&gt; &lt;span style="color:#81a1c1;font-weight:bold"&gt;in&lt;/span&gt; backup
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; backup mode&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; snapshot
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; ionice priority&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; &lt;span style="color:#b48ead"&gt;7&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; create storage snapshot &lt;span style="color:#a3be8c"&gt;&amp;#39;vzdump&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; Logical volume &lt;span style="color:#a3be8c"&gt;&amp;#34;snap_vm-200-disk-0_vzdump&amp;#34;&lt;/span&gt; created&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; creating vzdump archive &lt;span style="color:#a3be8c"&gt;&amp;#39;/mnt/pve/NAS-DS2/dump/vzdump-lxc-200-2023_04_07-17_11_08.tar.zst&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; tar&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; &lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;mnt&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;pve&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;NAS&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;DS2&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;dump&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;vzdump&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;lxc&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;200&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;2023&lt;/span&gt;_04_07&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;17&lt;/span&gt;_11_08&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;tmp&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Cannot open&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Permission denied
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; tar&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Error is &lt;span style="color:#81a1c1;font-weight:bold"&gt;not&lt;/span&gt; recoverable&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; exiting now
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; cleanup temporary &lt;span style="color:#a3be8c"&gt;&amp;#39;vzdump&amp;#39;&lt;/span&gt; snapshot
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; Logical volume &lt;span style="color:#a3be8c"&gt;&amp;#34;snap_vm-200-disk-0_vzdump&amp;#34;&lt;/span&gt; successfully removed
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ERROR&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Backup of VM &lt;span style="color:#b48ead"&gt;200&lt;/span&gt; failed &lt;span style="color:#81a1c1"&gt;-&lt;/span&gt; command &lt;span style="color:#a3be8c"&gt;&amp;#39;set -o pipefail &amp;amp;&amp;amp; lxc-usernsexec -m u:0:100000:65536 -m g:0:100000:65536 -- tar cpf - --totals --one-file-system -p --sparse --numeric-owner --acls --xattrs &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;xattrs&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;include&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;user&lt;span style="color:#81a1c1"&gt;.*&lt;/span&gt;&lt;span style="color:#a3be8c"&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;xattrs&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;include&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;security&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;capability&lt;span style="color:#a3be8c"&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;warning&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;no&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;file&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;ignored&lt;span style="color:#a3be8c"&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;warning&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;no&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;xattr&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;write&lt;span style="color:#a3be8c"&gt;&amp;#39; --one-file-system &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;warning&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;no&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;file&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;ignored&lt;span style="color:#a3be8c"&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;directory&lt;span style="color:#81a1c1"&gt;=/&lt;/span&gt;mnt&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;pve&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;NAS&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;DS2&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;dump&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;vzdump&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;lxc&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;200&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;2023&lt;/span&gt;_04_07&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;17&lt;/span&gt;_11_08&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;tmp&lt;span style="color:#a3be8c"&gt;&amp;#39; ./etc/vzdump/pct.conf ./etc/vzdump/pct.fw &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;directory&lt;span style="color:#81a1c1"&gt;=/&lt;/span&gt;mnt&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;vzsnap0&lt;span style="color:#a3be8c"&gt;&amp;#39; --no-anchored &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;exclude&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;lost&lt;span style="color:#81a1c1"&gt;+&lt;/span&gt;found&lt;span style="color:#a3be8c"&gt;&amp;#39; --anchored &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;exclude&lt;span style="color:#81a1c1"&gt;=./&lt;/span&gt;tmp&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;&lt;span style="color:#bf616a"&gt;?&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;*&lt;/span&gt;&lt;span style="color:#a3be8c"&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;exclude&lt;span style="color:#81a1c1"&gt;=./&lt;/span&gt;&lt;span style="color:#81a1c1;font-weight:bold"&gt;var&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;tmp&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;&lt;span style="color:#bf616a"&gt;?&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;*&lt;/span&gt;&lt;span style="color:#a3be8c"&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;exclude&lt;span style="color:#81a1c1"&gt;=./&lt;/span&gt;&lt;span style="color:#81a1c1;font-weight:bold"&gt;var&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;run&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;&lt;span style="color:#bf616a"&gt;?&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;*.&lt;/span&gt;pid&lt;span style="color:#a3be8c"&gt;&amp;#39; ./ | zstd --rsyncable &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;threads&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;&lt;span style="color:#b48ead"&gt;1&lt;/span&gt;&lt;span style="color:#a3be8c"&gt;&amp;#39; &amp;gt;/mnt/pve/NAS-DS2/dump/vzdump-lxc-200-2023_04_07-17_11_08.tar.dat&amp;#39;&lt;/span&gt; failed&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; exit code &lt;span style="color:#b48ead"&gt;2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Failed at &lt;span style="color:#b48ead"&gt;2023&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;04&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;07&lt;/span&gt; &lt;span style="color:#b48ead"&gt;17&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#b48ead"&gt;11&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#b48ead"&gt;09&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Backup job finished with errors
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;TASK ERROR&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; job errors
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="https://blog.iankulin.com/could-it-be-a-permissions-problem/"&gt;Permissions&lt;/a&gt;! I was puzzled - the line before (creating the backup file) is working, but not creating the temp file on the same share and directory? Very odd. Backing up a real VM on the same node and to the same share was working fine. Luckily it&amp;rsquo;s a simple, and fast, matter to create a heap of LXCs with different settings and see if the error can be reproduced, so I was soon confidently able to say the problem only existed for unprivileged LXC containers backing up to the share - I didn&amp;rsquo;t have the problem if I used the local disk.&lt;/p&gt;
&lt;p&gt;If I dropped to the console for the node, I could create an identically named file in the same directory with no problems.&lt;/p&gt;
&lt;p&gt;During all that testing, I saw some output that led to more helpful thinking.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; starting new backup job&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; vzdump &lt;span style="color:#b48ead"&gt;303&lt;/span&gt; &lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;storage NAS&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;DS2 &lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;compress zstd &lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;notes&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;template &lt;span style="color:#a3be8c"&gt;&amp;#39;{{guestname}}&amp;#39;&lt;/span&gt; &lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;remove &lt;span style="color:#b48ead"&gt;0&lt;/span&gt; &lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;node pve&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;dev1 &lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;mode snapshot
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Starting Backup of VM &lt;span style="color:#b48ead"&gt;303&lt;/span&gt; &lt;span style="color:#eceff4"&gt;(&lt;/span&gt;lxc&lt;span style="color:#eceff4"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Backup started at &lt;span style="color:#b48ead"&gt;2023&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;04&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;07&lt;/span&gt; &lt;span style="color:#b48ead"&gt;18&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#b48ead"&gt;43&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#b48ead"&gt;44&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; status &lt;span style="color:#81a1c1"&gt;=&lt;/span&gt; running
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; CT Name&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; apline&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;unpriv
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; including mount point rootfs &lt;span style="color:#eceff4"&gt;(&lt;/span&gt;&lt;span style="color:#a3be8c"&gt;&amp;#39;/&amp;#39;&lt;/span&gt;&lt;span style="color:#eceff4"&gt;)&lt;/span&gt; &lt;span style="color:#81a1c1;font-weight:bold"&gt;in&lt;/span&gt; backup
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; mode failure &lt;span style="color:#81a1c1"&gt;-&lt;/span&gt; some volumes &lt;span style="color:#81a1c1;font-weight:bold"&gt;do&lt;/span&gt; &lt;span style="color:#81a1c1;font-weight:bold"&gt;not&lt;/span&gt; support snapshots
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; trying &lt;span style="color:#a3be8c"&gt;&amp;#39;suspend&amp;#39;&lt;/span&gt; mode instead
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; backup mode&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; suspend
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; ionice priority&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; &lt;span style="color:#b48ead"&gt;7&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; CT Name&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; apline&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;unpriv
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; including mount point rootfs &lt;span style="color:#eceff4"&gt;(&lt;/span&gt;&lt;span style="color:#a3be8c"&gt;&amp;#39;/&amp;#39;&lt;/span&gt;&lt;span style="color:#eceff4"&gt;)&lt;/span&gt; &lt;span style="color:#81a1c1;font-weight:bold"&gt;in&lt;/span&gt; backup
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; temporary directory is on NFS&lt;span style="color:#eceff4"&gt;,&lt;/span&gt; disabling xattr &lt;span style="color:#81a1c1;font-weight:bold"&gt;and&lt;/span&gt; acl support&lt;span style="color:#eceff4"&gt;,&lt;/span&gt; consider configuring a local tmpdir via &lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;etc&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;vzdump&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;conf
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; starting first sync &lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;proc&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;&lt;span style="color:#b48ead"&gt;39778&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;root&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt; to &lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;mnt&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;pve&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;NAS&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;DS2&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;dump&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;vzdump&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;lxc&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;303&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;2023&lt;/span&gt;_04_07&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;18&lt;/span&gt;_43_44&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;tmp
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; first sync finished &lt;span style="color:#81a1c1"&gt;-&lt;/span&gt; transferred &lt;span style="color:#b48ead"&gt;9.35&lt;/span&gt;M bytes &lt;span style="color:#81a1c1;font-weight:bold"&gt;in&lt;/span&gt; &lt;span style="color:#b48ead"&gt;2&lt;/span&gt;s
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; suspending guest
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; starting final sync &lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;proc&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;&lt;span style="color:#b48ead"&gt;39778&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;root&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt; to &lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;mnt&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;pve&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;NAS&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;DS2&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;dump&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;vzdump&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;lxc&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;303&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;2023&lt;/span&gt;_04_07&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;18&lt;/span&gt;_43_44&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;tmp
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; final sync finished &lt;span style="color:#81a1c1"&gt;-&lt;/span&gt; transferred &lt;span style="color:#b48ead"&gt;0&lt;/span&gt; bytes &lt;span style="color:#81a1c1;font-weight:bold"&gt;in&lt;/span&gt; &lt;span style="color:#b48ead"&gt;0&lt;/span&gt;s
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; resuming guest
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; guest is online again after &lt;span style="color:#81a1c1"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#b48ead"&gt;1&lt;/span&gt; seconds
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; creating vzdump archive &lt;span style="color:#a3be8c"&gt;&amp;#39;/mnt/pve/NAS-DS2/dump/vzdump-lxc-303-2023_04_07-18_43_44.tar.zst&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; tar&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; &lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;mnt&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;pve&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;NAS&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;DS2&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;dump&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;vzdump&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;lxc&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;303&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;2023&lt;/span&gt;_04_07&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;18&lt;/span&gt;_43_44&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;tmp&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Cannot open&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Permission denied
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; tar&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Error is &lt;span style="color:#81a1c1;font-weight:bold"&gt;not&lt;/span&gt; recoverable&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; exiting now
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ERROR&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Backup of VM &lt;span style="color:#b48ead"&gt;303&lt;/span&gt; failed &lt;span style="color:#81a1c1"&gt;-&lt;/span&gt; command &lt;span style="color:#a3be8c"&gt;&amp;#39;set -o pipefail &amp;amp;&amp;amp; lxc-usernsexec -m u:0:100000:65536 -m g:0:100000:65536 -- tar cpf - --totals --one-file-system -p --sparse --numeric-owner --acls --xattrs &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;xattrs&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;include&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;user&lt;span style="color:#81a1c1"&gt;.*&lt;/span&gt;&lt;span style="color:#a3be8c"&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;xattrs&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;include&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;security&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;capability&lt;span style="color:#a3be8c"&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;warning&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;no&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;file&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;ignored&lt;span style="color:#a3be8c"&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;warning&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;no&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;xattr&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;write&lt;span style="color:#a3be8c"&gt;&amp;#39; --one-file-system &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;warning&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;no&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;file&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;ignored&lt;span style="color:#a3be8c"&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;directory&lt;span style="color:#81a1c1"&gt;=/&lt;/span&gt;mnt&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;pve&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;NAS&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;DS2&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;dump&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;vzdump&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;lxc&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;303&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;2023&lt;/span&gt;_04_07&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;18&lt;/span&gt;_43_44&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;tmp&lt;span style="color:#a3be8c"&gt;&amp;#39; ./etc/vzdump/pct.conf ./etc/vzdump/pct.fw &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;directory&lt;span style="color:#81a1c1"&gt;=/&lt;/span&gt;mnt&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;pve&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;NAS&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;DS2&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;dump&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;vzdump&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;lxc&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;303&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;2023&lt;/span&gt;_04_07&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;18&lt;/span&gt;_43_44&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;tmp&lt;span style="color:#a3be8c"&gt;&amp;#39; --no-anchored &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;exclude&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;lost&lt;span style="color:#81a1c1"&gt;+&lt;/span&gt;found&lt;span style="color:#a3be8c"&gt;&amp;#39; --anchored &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;exclude&lt;span style="color:#81a1c1"&gt;=./&lt;/span&gt;tmp&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;&lt;span style="color:#bf616a"&gt;?&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;*&lt;/span&gt;&lt;span style="color:#a3be8c"&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;exclude&lt;span style="color:#81a1c1"&gt;=./&lt;/span&gt;&lt;span style="color:#81a1c1;font-weight:bold"&gt;var&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;tmp&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;&lt;span style="color:#bf616a"&gt;?&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;*&lt;/span&gt;&lt;span style="color:#a3be8c"&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;exclude&lt;span style="color:#81a1c1"&gt;=./&lt;/span&gt;&lt;span style="color:#81a1c1;font-weight:bold"&gt;var&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;run&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;&lt;span style="color:#bf616a"&gt;?&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;*.&lt;/span&gt;pid&lt;span style="color:#a3be8c"&gt;&amp;#39; . | zstd --rsyncable &amp;#39;&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;--&lt;/span&gt;threads&lt;span style="color:#81a1c1"&gt;=&lt;/span&gt;&lt;span style="color:#b48ead"&gt;1&lt;/span&gt;&lt;span style="color:#a3be8c"&gt;&amp;#39; &amp;gt;/mnt/pve/NAS-DS2/dump/vzdump-lxc-303-2023_04_07-18_43_44.tar.dat&amp;#39;&lt;/span&gt; failed&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; exit code &lt;span style="color:#b48ead"&gt;2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Failed at &lt;span style="color:#b48ead"&gt;2023&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;04&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#b48ead"&gt;07&lt;/span&gt; &lt;span style="color:#b48ead"&gt;18&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#b48ead"&gt;43&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#b48ead"&gt;47&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;INFO&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Backup job finished with errors
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;TASK ERROR&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; job errors
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And sure enough, there is a helpful &lt;code&gt;/etc/vzdump.conf&lt;/code&gt; file. Uncommenting the &lt;code&gt;tmpdir&lt;/code&gt; line and pointing it to &lt;code&gt;/tmp&lt;/code&gt; fixed all my problems.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-04-07-at-6.50.45-pm-copy.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;So what&amp;rsquo;s going on? I did some googling and found some discussions &lt;a href="https://forum.proxmox.com/threads/cannot-backup-only-lxc-to-nfs-vm-works.90797/"&gt;1&lt;/a&gt;/&lt;a href="https://forum.proxmox.com/threads/in-7-0-i-cant-backup-a-container-to-a-nfs-that-worked-in-6-0.97808/"&gt;2&lt;/a&gt;/&lt;a href="https://forum.proxmox.com/threads/backup-of-lxc-containers-to-nfs-mount-fail.95146/"&gt;3&lt;/a&gt; in the &lt;a href="https://forum.proxmox.com/"&gt;Proxmox forums&lt;/a&gt;. They are saying it&amp;rsquo;s because the unprivileged containers (they don&amp;rsquo;t run as root, which seems like good practice) don&amp;rsquo;t have permissions for the NFS share directory. I feel there&amp;rsquo;s a few problems with this theory:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It seems to do fine creating the other files&lt;/li&gt;
&lt;li&gt;Why would the LXC container be doing this work? Surely the process is being run at the Proxmox level.&lt;/li&gt;
&lt;li&gt;Actually the LXC container should not have access to the NAS at all, even if it&amp;rsquo;s privileged - it&amp;rsquo;s not mounted in there, the LXC knows nothing about it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Nevertheless, I&amp;rsquo;m sure they know better than me. If I was shipping this product, I&amp;rsquo;d probably engineer around this problem. Maybe by detecting it and switching to &lt;code&gt;/var/tmp&lt;/code&gt; or even just by making that the default in the config file.&lt;/p&gt;</description></item><item><title>Using NAS for Proxmox backups</title><link>https://blog.iankulin.com/using-nas-for-proxmox-backups/</link><pubDate>Mon, 10 Apr 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/using-nas-for-proxmox-backups/</guid><description>&lt;p&gt;&lt;a href="https://blog.iankulin.com/moving-a-vm-between-two-proxmox-hosts/"&gt;A few weeks ago&lt;/a&gt;, I was very excited to be able to take a snapshot of a virtual machine, copy it across the network from that Proxmox node, copy it back across the network to a different Proxmox node, start it there, and have it up and running, without it noticing it was actually on different hardware.&lt;/p&gt;
&lt;p&gt;Backing up a VM is pretty simple, you just click on the node, choose &lt;em&gt;Backup&lt;/em&gt; and click the &lt;em&gt;Backup Now&lt;/em&gt; button. The ease, and completeness of backing up a VM is one of the main reasons I&amp;rsquo;m using Proxmox for my systems.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-04-07-at-12.02.59-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-04-07-at-12.02.59-pm.png" width="800" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;By default, VM backups are saved to the &amp;ldquo;local drive&amp;rdquo; - actually the &lt;code&gt;/var/lib/vz&lt;/code&gt; directory. This would not be useful if the physical machine dies, but also it&amp;rsquo;s not convenient to restore to a different machine. Ideally you&amp;rsquo;d have a central place to store these files that was accessible to all the Proxmox nodes.&lt;/p&gt;
&lt;p&gt;This is exactly the situation I&amp;rsquo;ve setup with my lab, the NAS is the storage for the VM backups. Each of the Proxmox nodes uses the same directory for backups, so moving a machine from one node to another is a simple as backing it up on one node, stopping the VM, and restoring it on another node just by choosing the backup file to restore in the web GUI.&lt;/p&gt;
&lt;h3 id="steps"&gt;Steps&lt;/h3&gt;
&lt;p&gt;Proxmox can use all sorts of shares as a location for backups (and other files such as the ISO&amp;rsquo;s used to boot new machines), but the simplest is probably &lt;a href="https://en.wikipedia.org/wiki/Network_File_System"&gt;NFS&lt;/a&gt;. This is also straightforward to do from the Synology NAS.&lt;/p&gt;
&lt;p&gt;In the web interface for the NAS, go into &lt;em&gt;Control Panel&lt;/em&gt;, &lt;em&gt;Shared Folder&lt;/em&gt; and create a new shared folder. I called mine Proxmox. One of the tabs there is for NFS permissions - just add the IP address of the Proxmox node that you&amp;rsquo;d life to access the folder.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-04-07-at-1.46.02-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s not much harder from the Proxmox end. Although the storage you add will appear at the node level in the &lt;em&gt;Server View&lt;/em&gt; of the web GUI, it is added at the &lt;em&gt;Datacenter&lt;/em&gt; level.&lt;/p&gt;
&lt;p&gt;Go into &lt;em&gt;Storage&lt;/em&gt;, select &lt;em&gt;Add&lt;/em&gt; and choose &lt;em&gt;NFS&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-04-07-at-2.00.04-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-04-07-at-2.00.04-pm.png" width="800" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Then enter an ID (this will be the name of the storage in Proxmox) and the IP address. If you wait half a second, then you can click the dropdown for all the folders that are shared from that IP address.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-04-07-at-2.06.19-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;The last field is content - this refers the the type of Proxmox stuff you want to keep in there - for backups, you just need VZDumps, but I usually click on everything since I&amp;rsquo;ll also use it for ISOs for new VMs and templates for LXCs.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-04-07-at-2.11.03-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Once you&amp;rsquo;ve added that, the storage will appear in the server view, but also as an option when you go into &lt;em&gt;Backup&lt;/em&gt; for a VM and select &lt;em&gt;Backup Now&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-04-07-at-2.15.53-pm.png" alt=""&gt;&lt;/p&gt;</description></item><item><title>Allowing Proxmox to use a Dynamic IP</title><link>https://blog.iankulin.com/allowing-proxmox-to-use-a-dynamic-ip/</link><pubDate>Thu, 06 Apr 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/allowing-proxmox-to-use-a-dynamic-ip/</guid><description>&lt;p&gt;I&amp;rsquo;ve &lt;a href="https://blog.iankulin.com/proxmox-dynamic-ip/"&gt;discussed before&lt;/a&gt;, that when you first install Proxmox, it grabs an IP address from your DHCP server (this usually runs in your ISP modem if you haven&amp;rsquo;t created a better setup), but then it stores it as a static ip. This is a sort of compromise that makes sense and works for most circumstances.&lt;/p&gt;
&lt;p&gt;As soon as I&amp;rsquo;ve provisioned a new Proxmox server, I then usually tell the DHCP server, to always serve that address to the MAC address of the new Proxmox server. Since Proxmox does not use the DHCP server on subsequent boots, all that really does is prevent the DHCP server give the same IP address out to another device - which had happened to me prompting the earlier post. The DHCP server had given the address to a wifi lightbulb while the server was off, then when the Proxmox server booted up, the netwrok access was all messed up.&lt;/p&gt;
&lt;p&gt;In general, servers should have a static IP address - they are providing resources that other devices on the network need to access, so the combination of grabbing a DHCP address, using it statically, then me locking it in at the DHCP server makes sense.&lt;/p&gt;
&lt;p&gt;Except that I&amp;rsquo;m building a system with a couple of VM&amp;rsquo;s and a NAS that I&amp;rsquo;m going to post off, and have it set up by a non-techie at a remote site. So I really need Proxmox on that machine to look for a DHCP server when it boots and collect a dynamic IP address. Like a lot of things in Linux, this is quite a simple change if you know where to look.&lt;/p&gt;
&lt;h3 id="what-to-change"&gt;What to Change&lt;/h3&gt;
&lt;p&gt;The configuration file for the network interfaces is /&lt;code&gt;etc/network/interfaces&lt;/code&gt; the one on the Proxmox machine I&amp;rsquo;m setting up looked like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;iface lo inet loopback
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;iface eno1 inet manual
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;auto vmbr0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;iface vmbr0 inet static
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	address 192.168.100.30/24
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	gateway 192.168.100.1
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	bridge-ports eno1
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	bridge-stp off
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	bridge-fd 0
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;iface&lt;/code&gt; is short for interface, and is followed by the interface name. These are the same names you see when you type in &lt;code&gt;ip addr&lt;/code&gt; to see the IP addresses.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/edit.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;So this is the bit we are interested in:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;iface vmbr0 inet static
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	address 192.168.100.30/24
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	gateway 192.168.100.1
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	bridge-ports eno1
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	bridge-stp off
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	bridge-fd 0
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;All that bridge stuff can stay the same, I&amp;rsquo;ll comment out the static bits and change it to use the DHCP. The final file looks like:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;auto lo
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;iface lo inet loopback
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;iface eno1 inet manual
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;auto vmbr0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;#iface vmbr0 inet static
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;#	address 192.168.100.30/24
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;#	gateway 192.168.100.1
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;iface vmbr0 inet dhcp
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	bridge-ports eno1
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	bridge-stp off
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	bridge-fd 0
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I used the mac address to tell the DCHP server to allocate it a different address, and rebooted and Proxmox picked up the new address perfectly.&lt;/p&gt;
&lt;h3 id="hosts"&gt;Hosts&lt;/h3&gt;
&lt;p&gt;Now the server had a new address, there&amp;rsquo;s one more place I need to update; /etc/hosts contains the domain information you set during the Proxmox install, and it will include that old IP address. Once the system has a new one, it needs to be edited to include that.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;127.0.0.1 localhost.localdomain localhost
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;192.168.100.28 pve-kr01.local pve-kr01
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# The following lines are desirable for IPv6 capable hosts
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;::1 ip6-localhost ip6-loopback
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;fe00::0 ip6-localnet
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ff00::0 ip6-mcastprefix
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ff02::1 ip6-allnodes
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ff02::2 ip6-allrouters
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ff02::3 ip6-allhosts
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;After the system is installed at the remote site and booted up, I&amp;rsquo;ll ssh in (with Tailscale) and make that change, and hopefully be able to access the DHCP server so it does not change in future.&lt;/p&gt;
&lt;h3 id="resources"&gt;Resources&lt;/h3&gt;
&lt;p&gt;I found these posts useful when figuring this out:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://forum.proxmox.com/threads/set-a-dynamic-address-to-pve.119847/"&gt;Set a dynamic address to PVE&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://schoolitexpert.com/network-tools/proxmox-ve/dynamic-ip-address"&gt;Dynamic IP address&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Versions: Proxmox 7.4-3&lt;/p&gt;</description></item><item><title>Proxmox Backup Files</title><link>https://blog.iankulin.com/proxmox-backup-files/</link><pubDate>Fri, 31 Mar 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/proxmox-backup-files/</guid><description>&lt;p&gt;I&amp;rsquo;ve got some extra RAM to drop into the HP 800 G2 mini that I use as my production server. I feel like that&amp;rsquo;s a low risk change, but since it&amp;rsquo;s easy to take VM snapshots I shutdown the VM&amp;rsquo;s and did that, and wanted to just copy them off the local storage.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m moving towards having these backups (and the ISOs) on the NAS rather than locally, but have not implemented that. So to get my backups I need to SSH in and find them.&lt;/p&gt;
&lt;p&gt;The &lt;a href="https://pve.proxmox.com/wiki/Storage:_Directory"&gt;Proxmox documentation for storage&lt;/a&gt; says to have a look in &lt;code&gt;/etc/pve/storage.cfg&lt;/code&gt; to see what&amp;rsquo;s up. Mine looks like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;dir&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; local
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	path &lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;&lt;span style="color:#81a1c1;font-weight:bold"&gt;var&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;lib&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;vz
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	content iso&lt;span style="color:#eceff4"&gt;,&lt;/span&gt;vztmpl&lt;span style="color:#eceff4"&gt;,&lt;/span&gt;backup
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;lvmthin&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; local&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;lvm
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	thinpool data
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	vgname pve
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	content rootdir&lt;span style="color:#eceff4"&gt;,&lt;/span&gt;images
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And sure enough, if I look in &lt;code&gt;/var/lib/vz/dump&lt;/code&gt; (dump is the backup location mentioned in the docs):&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-03-26-at-11.59.10-am.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-03-26-at-11.59.10-am.png" width="1000" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I ain&amp;rsquo;t messing around this morning, so I&amp;rsquo;ll just grab these onto my laptop with scp.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;scp root&lt;span style="color:#bf616a"&gt;@&lt;/span&gt;&lt;span style="color:#b48ead"&gt;192.168&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;&lt;span style="color:#b48ead"&gt;100.23&lt;/span&gt;&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;&lt;span style="color:#81a1c1;font-weight:bold"&gt;var&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;lib&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;vz&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;dump&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;\&lt;span style="color:#81a1c1"&gt;*&lt;/span&gt; Downloads
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You may notice in the command above that I&amp;rsquo;ve got a backslash in front of the wildcard. This was a little gotcha that is specific to using zsh/OhMyZsh that I had to escape the wildcard. I found I could specify the whole filename and it worked okay, but the wildcards needed escaping. Thanks again &lt;a href="https://superuser.com/questions/420525/scp-with-zsh-no-matches-found"&gt;StackExchange&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-03-26-at-12.15.35-pm.png" alt=""&gt;&lt;/p&gt;</description></item><item><title>Proxmox VM Memory Upgrade</title><link>https://blog.iankulin.com/proxmox-vm-memory-upgrade/</link><pubDate>Sun, 19 Mar 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/proxmox-vm-memory-upgrade/</guid><description>&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-03-16-at-6.36.10-pm.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;I ordered some RAM this week for my production server - it&amp;rsquo;s quickly becoming clear that memory is the limiting factor when running lots of services and VM&amp;rsquo;s that don&amp;rsquo;t get much use - rather than processing power. I&amp;rsquo;m not really a hardware guy, so figuring out exactly what RAM I need is a slightly fraught process - I won&amp;rsquo;t be fully confident I&amp;rsquo;ve ordered the right thing until I install it, boot up, and see my &lt;a href="https://support.hp.com/us-en/product/hp-elitedesk-800-35w-g2-desktop-mini-pc/7633266/document/c04816235"&gt;G2 800&lt;/a&gt; come to life maxed out at 32GB.&lt;/p&gt;
&lt;p&gt;Something that&amp;rsquo;s not fraught however, is upgrading the RAM in a virtual machine (VM) running under &lt;a href="https://www.proxmox.com/en/proxmox-ve"&gt;Proxmox&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="ram-hunger"&gt;RAM Hunger&lt;/h3&gt;
&lt;p&gt;I run two VM&amp;rsquo;s full time on the production node - a general docker host for a variety of small services, and a separate VM for &lt;a href="https://jellyfin.org/"&gt;Jellyfin&lt;/a&gt;. I&amp;rsquo;d allocated 6GB for this VM, but when I checked tonight ProxMox was reporting that 5GB was already being used.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-03-16-at-6.16.57-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-03-16-at-6.16.57-pm.png" width="974" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I have noticed that the Jellyfin memory usage seems to slowly grow over time. That might be related to my current usage pattern - I&amp;rsquo;m frequently re-scanning the libraries as I check and update the metadata.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-03-16-at-6.17.40-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;In any case, it needs more RAM, and I&amp;rsquo;ve got some up my sleeve on this physical machine so let&amp;rsquo;s allocate some more to the Jellyfin VM.&lt;/p&gt;
&lt;p&gt;Normally, you specify the amount of RAM to allocate when you&amp;rsquo;re creating the machine, but it&amp;rsquo;s quite straightforward to change it afterwards. With your VM selected, click into the &amp;ldquo;Hardware&amp;rdquo; page. Then if you double click on &amp;ldquo;Memory&amp;rdquo; a dialogue will open up to&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-03-16-at-6.18.19-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;You can just edit this number, in MB. Once you OK it, there will be two values listed for memory in the Hardware specs. The first is what the VM is running with now, and the second, orange value is what you are changing it to. In my case, I&amp;rsquo;ve bumped it up to 8GB from 6.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-03-16-at-6.19.47-pm.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s not possible to change the memory dynamically - it requires a reboot. Of course, rebooting the machine also restarts Jellyfin, so after the reboot we have plenty of headroom.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-03-16-at-6.58.21-pm.png" alt=""&gt;&lt;/p&gt;</description></item><item><title>No DNS on Proxmox machine</title><link>https://blog.iankulin.com/no-dns-on-proxmox-machine/</link><pubDate>Fri, 17 Mar 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/no-dns-on-proxmox-machine/</guid><description>&lt;p&gt;I had some more network weirdness setting up this new Proxmox machine. When I went to run the updates it couldn&amp;rsquo;t resolve any of the addresses:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;root&lt;span style="color:#bf616a"&gt;@&lt;/span&gt;pve&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;kr01&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;~&lt;/span&gt;&lt;span style="color:#616e87;font-style:italic"&gt;# apt update&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Err&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#b48ead"&gt;1&lt;/span&gt; http&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;//&lt;/span&gt;ftp&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;au&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;debian&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;org&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;debian bullseye InRelease
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; Temporary failure resolving &lt;span style="color:#a3be8c"&gt;&amp;#39;ftp.au.debian.org&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Err&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#b48ead"&gt;2&lt;/span&gt; http&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;//&lt;/span&gt;download&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;proxmox&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;com&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;debian&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;pve bullseye InRelease
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; Temporary failure resolving &lt;span style="color:#a3be8c"&gt;&amp;#39;download.proxmox.com&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Err&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#b48ead"&gt;3&lt;/span&gt; http&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;//&lt;/span&gt;security&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;debian&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;org bullseye&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;security InRelease
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; Temporary failure resolving &lt;span style="color:#a3be8c"&gt;&amp;#39;security.debian.org&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Err&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#b48ead"&gt;4&lt;/span&gt; https&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;//&lt;/span&gt;enterprise&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;proxmox&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;com&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;debian&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;pve bullseye InRelease
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; Temporary failure resolving &lt;span style="color:#a3be8c"&gt;&amp;#39;enterprise.proxmox.com&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Err&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#b48ead"&gt;5&lt;/span&gt; http&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;//&lt;/span&gt;ftp&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;au&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;debian&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;org&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;debian bullseye&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;updates InRelease
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; Temporary failure resolving &lt;span style="color:#a3be8c"&gt;&amp;#39;ftp.au.debian.org&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Reading package lists&lt;span style="color:#81a1c1"&gt;...&lt;/span&gt; Done
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Building dependency tree&lt;span style="color:#81a1c1"&gt;...&lt;/span&gt; Done
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Reading state information&lt;span style="color:#81a1c1"&gt;...&lt;/span&gt; Done
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;All packages are up to date&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;W&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Failed to fetch http&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;//&lt;/span&gt;ftp&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;au&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;debian&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;org&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;debian&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;dists&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;bullseye&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;InRelease Temporary failure resolving &lt;span style="color:#a3be8c"&gt;&amp;#39;ftp.au.debian.org&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;W&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Failed to fetch http&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;//&lt;/span&gt;ftp&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;au&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;debian&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;org&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;debian&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;dists&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;bullseye&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;updates&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;InRelease Temporary failure resolving &lt;span style="color:#a3be8c"&gt;&amp;#39;ftp.au.debian.org&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;W&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Failed to fetch http&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;//&lt;/span&gt;download&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;proxmox&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;com&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;debian&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;pve&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;dists&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;bullseye&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;InRelease Temporary failure resolving &lt;span style="color:#a3be8c"&gt;&amp;#39;download.proxmox.com&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;W&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Failed to fetch http&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;//&lt;/span&gt;security&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;debian&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;org&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;dists&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;bullseye&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;security&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;InRelease Temporary failure resolving &lt;span style="color:#a3be8c"&gt;&amp;#39;security.debian.org&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;W&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Failed to fetch https&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;//&lt;/span&gt;enterprise&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;proxmox&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;com&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;debian&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;pve&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;dists&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;bullseye&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;InRelease Temporary failure resolving &lt;span style="color:#a3be8c"&gt;&amp;#39;enterprise.proxmox.com&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;W&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Some index files failed to download&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt; They have been ignored&lt;span style="color:#eceff4"&gt;,&lt;/span&gt; &lt;span style="color:#81a1c1;font-weight:bold"&gt;or&lt;/span&gt; old ones used instead&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So some sort of DNS problem. The entry for the DNS is in &lt;code&gt;/etc/resolv.conf&lt;/code&gt; when I looked in there, it said:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;search local
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;nameserver 127.0.0.1
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Well, that does not seem great. I feel like it should be pointing at the DNS in my router, or even upstream at my ISP or google&amp;rsquo;s DNS server. Before I dive in and start editing, I thought I&amp;rsquo;d check my other servers. The first one has clearly been altered as part of installing TailScale, so that wasn&amp;rsquo;t much help, but on the dev machine it said:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;search local
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;nameserver 192.168.100.1
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Which is more like what I was expecting, that&amp;rsquo;s the address given out by my DHCP server for DNS. I could just edit the new machine to this, but since this is the third lot of network related weirdness related to this install (the second was that my managed switch&amp;rsquo;s web interface was down, and I couldn&amp;rsquo;t ping it, but it was still passing traffic, &lt;a href="https://blog.iankulin.com/netgear-gs108e-switch-problem/"&gt;again&lt;/a&gt;), and the first, discussed in yesterday&amp;rsquo;s post, was that DHCP had provided a dynamic address that was already assigned to another device.&lt;/p&gt;
&lt;p&gt;I swapped out the network cable, and noticed the port lights flashing. Perhaps there is a broken pair in the other cable? It was odd that it was working sort of.&lt;/p&gt;
&lt;p&gt;I reinstalled Proxmox from scratch, and carefully watched the console messages and checked all the network settings (it correctly picked up the reserved address and correct DNS server). Then everything worked.&lt;/p&gt;</description></item><item><title>Proxmox Dynamic IP</title><link>https://blog.iankulin.com/proxmox-dynamic-ip/</link><pubDate>Thu, 16 Mar 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/proxmox-dynamic-ip/</guid><description>&lt;p&gt;I ran into a little hiccup today. I&amp;rsquo;m building out a Jellyfin media server in a little HP G2 Mini PC. The config was going to be a Debian server inside Proxmox (because I love VM snapshots for backups) running Jellyfin in a container. There&amp;rsquo;ll be an external USB3 hard drive for the media storage.&lt;/p&gt;
&lt;p&gt;I was intending to build it all out and test it, then ship it to it&amp;rsquo;s final home.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve probably installed Proxmox five or six times by now since I&amp;rsquo;m always playing around with my test machine, and never really thought about the screen that comes up during the install showing the network details it&amp;rsquo;s picked up from DHCP.&lt;/p&gt;
&lt;p&gt;Today once I&amp;rsquo;d finished installing Proxmox, I couldn&amp;rsquo;t SSH into it&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-03-12-at-3.57.03-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;I knew I had the right IP address since it shows that on the console at the end of the boot process. Looking in my router, it said 192.168.100.2 was connected, but by wifi on the SSID I use for IOT devices.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-03-12-at-4.01.09-pm.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;That ESP device name is a giveaway - it&amp;rsquo;s one of my wifi light bulbs. A quick &lt;code&gt;ip addr&lt;/code&gt; on the new Proxmox via the console shows it is convinced that it is 192.168.100.2 I can ping 8.8.8.8 from it, but DNS is not working. My conclusion is that I&amp;rsquo;ve got two devices with the same IP on my network.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m not sure how this came about. The network cable I was using is an old CAT5 with the clips broken off both ends I use for fiddling around, so perhaps there was a dodgy connection right at a crucial moment? It seems odd. usually when I encounter the &amp;rsquo;two machines with the same IP&amp;rsquo; problem, I&amp;rsquo;ve caused it somehow.&lt;/p&gt;
&lt;p&gt;No problem &lt;em&gt;I thought&lt;/em&gt;, now I&amp;rsquo;ve got the MAC address from the Proxmox machine, I&amp;rsquo;ll just reserve an available IP address for it. I did that, and rebooted Proxmox, but it was still on the old address. Then I remembered that question during the install process - it must collect an address from DHCP, then after the users has committed to it, write it into &lt;code&gt;/etc/hosts&lt;/code&gt; and &lt;code&gt;/etc/network/interfaces&lt;/code&gt; I reinstalled Proxmox, it picked up the new address and I saved it as the static IP.&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s not really problem solved though - I&amp;rsquo;m sending this off to a network where I don&amp;rsquo;t know the network configuration. I was hoping just to let it pick up a DHCP address that would remain somewhat stable since the machine is going to be on 24/7.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s not unreasonable for Proxmox to expect a VM host machine is going to have a static IP address, but it&amp;rsquo;s inconvenient for this situation. I&amp;rsquo;ll have to discover how to make it dynamic (probably by editing those two files). I&amp;rsquo;ll have Tailscale on it, so I can remote in afterwards to make it static, although without also reserving it in their router that carries a small risk too.&lt;/p&gt;</description></item><item><title>Configuring Proxmox for Free Use</title><link>https://blog.iankulin.com/configuring-proxmox-for-free-use/</link><pubDate>Thu, 16 Feb 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/configuring-proxmox-for-free-use/</guid><description>&lt;p&gt;I installed Proxmox on my second server last night, and tonight when I ran &lt;code&gt;apt update&lt;/code&gt; I ran into the error you get when you haven&amp;rsquo;t bought a license.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-go" data-lang="go"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Err&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#b48ead"&gt;5&lt;/span&gt; https&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#5e81ac;font-style:italic"&gt;//enterprise.proxmox.com/debian/pve bullseye InRelease &lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#b48ead"&gt;401&lt;/span&gt; Unauthorized &lt;span style="color:#eceff4"&gt;[&lt;/span&gt;IP&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; &lt;span style="color:#b48ead"&gt;103.67.14.50&lt;/span&gt; &lt;span style="color:#b48ead"&gt;443&lt;/span&gt;&lt;span style="color:#eceff4"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Reading &lt;span style="color:#81a1c1;font-weight:bold"&gt;package&lt;/span&gt; lists&lt;span style="color:#81a1c1"&gt;...&lt;/span&gt; Done 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;E&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Failed to fetch https&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#5e81ac;font-style:italic"&gt;//enterprise.proxmox.com/debian/pve/dists/bullseye/InRelease 401 Unauthorized [IP: 103.67.14.50 443]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;E&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; The repository &lt;span style="color:#bf616a"&gt;&amp;#39;&lt;/span&gt;https&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#5e81ac;font-style:italic"&gt;//enterprise.proxmox.com/debian/pve bullseye InRelease&amp;#39; is not signed.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;N&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; Updating from such a repository can&lt;span style="color:#bf616a"&gt;&amp;#39;&lt;/span&gt;t be done securely&lt;span style="color:#eceff4"&gt;,&lt;/span&gt; and is therefore disabled by &lt;span style="color:#81a1c1;font-weight:bold"&gt;default&lt;/span&gt;&lt;span style="color:#eceff4"&gt;.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;N&lt;span style="color:#eceff4"&gt;:&lt;/span&gt; See apt&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;&lt;span style="color:#88c0d0"&gt;secure&lt;/span&gt;&lt;span style="color:#eceff4"&gt;(&lt;/span&gt;&lt;span style="color:#b48ead"&gt;8&lt;/span&gt;&lt;span style="color:#eceff4"&gt;)&lt;/span&gt; manpage &lt;span style="color:#81a1c1;font-weight:bold"&gt;for&lt;/span&gt; repository creation and user configuration details&lt;span style="color:#eceff4"&gt;.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Even though I guess it was only a month ago (let that sink in people who think the raspberry Pi they just bought is going to be the last homelab hardware they buy 😊) since I set up my first Proxmox server, I&amp;rsquo;d already forgotten there&amp;rsquo;s a step to enable it to get updates without a subscription.&lt;/p&gt;
&lt;p&gt;There&amp;rsquo;s a couple of little steps for this. They are both &lt;a href="https://pve.proxmox.com/wiki/Package_Repositories#sysadmin_enterprise_repo"&gt;here on the Proxmox wiki&lt;/a&gt;.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;edit &lt;code&gt;/etc/apt/sources.list.d/pve-enterprise.list&lt;/code&gt; to comment out the single repository listed in there.&lt;/li&gt;
&lt;li&gt;edit &lt;code&gt;/etc/apt/sources.list&lt;/code&gt; to look like this:&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;deb http&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;//&lt;/span&gt;ftp&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;debian&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;org&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;debian bullseye main contrib
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;deb http&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;//&lt;/span&gt;ftp&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;debian&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;org&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;debian bullseye&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;updates main contrib
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#616e87;font-style:italic"&gt;# PVE pve-no-subscription repository provided by proxmox.com,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#616e87;font-style:italic"&gt;# NOT recommended for production use&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;deb http&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;//&lt;/span&gt;download&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;proxmox&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;com&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;debian&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;pve bullseye pve&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;no&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;subscription
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#616e87;font-style:italic"&gt;# security updates&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;deb http&lt;span style="color:#eceff4"&gt;:&lt;/span&gt;&lt;span style="color:#81a1c1"&gt;//&lt;/span&gt;security&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;debian&lt;span style="color:#81a1c1"&gt;.&lt;/span&gt;org&lt;span style="color:#81a1c1"&gt;/&lt;/span&gt;debian&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;security bullseye&lt;span style="color:#81a1c1"&gt;-&lt;/span&gt;security main contrib
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then you&amp;rsquo;ll be good to go.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-02-07-at-8.41.15-pm.jpg" alt=""&gt;&lt;/p&gt;</description></item><item><title>Moving a VM between two Proxmox hosts</title><link>https://blog.iankulin.com/moving-a-vm-between-two-proxmox-hosts/</link><pubDate>Thu, 16 Feb 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/moving-a-vm-between-two-proxmox-hosts/</guid><description>&lt;img src="https://blog.iankulin.com/images/s-l640.jpg" width="264" alt=""&gt;
&lt;p&gt;So, the very small datacentre has undergone a major hardware upgrade today. The HP 800 G1 is joined by an HP 800 G2. Four core i7 vs the old two core i5. Double the RAM to 16GB, four times the disk. The old machine will become a dev/play machine - still virtualised, and the new machine will run the production apps, mostly in Docker containers.&lt;/p&gt;
&lt;p&gt;Since everything is containerised, I did consider running Unbuntu Server on the bare metal of the new machine, but running it on Proxmox will give me some flexibility, and since we&amp;rsquo;ve stepped up the underlying hardware resource so substantially, performance will be well in front anyway. Plus it will give me some flexibility if needed in the future.&lt;/p&gt;
&lt;p&gt;Another massive benefit of virtualisation is the ability to backup a VM to a single file.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve invested several hours in the old server - downloading ISOs, updating everything, installing Docker, adding my containers, reserving the IP addresses in DNS and so on. Wouldn&amp;rsquo;t it be amazing if I could stop my main VM, back it up, copy the backup to the new server, then boot it there and have every thing just work.&lt;/p&gt;
&lt;p&gt;In theory this should be entirely possible. So let&amp;rsquo;s give it a go.&lt;/p&gt;
&lt;p&gt;In the Proxmox web interface, you can execute a backup on a VM. There&amp;rsquo;s three flavours with &lt;code&gt;STOP&lt;/code&gt; being the most reliable as it actually stops the VM to grab it&amp;rsquo;s copy. On this system I can easily afford to stop everything for ten minutes so I&amp;rsquo;ll actually be shutting down my VM and doing this sort of back up. We do this by clicking on the VM, then selecting backup. At the top is a backup button.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-02-06-at-8.35.38-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-02-06-at-8.35.38-pm.png" width="800" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Once you&amp;rsquo;ve done your backup it appears in a couple of places in the web interface - in this backup screen associated with the VM, but also if you select the &lt;code&gt;local&lt;/code&gt; disk then backup.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-02-06-at-8.41.43-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;So that&amp;rsquo;s my VM nicely backed up into a single tarball, now I want to download it. I really feel the Proxmox interface should have buttons for Download and Upload on this screen - that would make this operation even easier. But it does not.&lt;/p&gt;
&lt;p&gt;The first problem is to find where these files are stored. Thanks to u/walalauw&amp;rsquo;s answer in &lt;a href="https://old.reddit.com/r/Proxmox/comments/jj6eqz/downloading_backups/"&gt;this reddit thread&lt;/a&gt;, it sounds like they are at &lt;code&gt;/var/lib/vz/dump&lt;/code&gt; I head there in FileZilla, and find:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-02-06-at-7.54.09-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-02-06-at-7.54.09-pm.png" width="826" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You only need the &lt;code&gt;.zst&lt;/code&gt; file, but neat freaks can grab the the &lt;code&gt;.notes&lt;/code&gt; as well. It contains the text you wrote for the backup - in the previous screenshot you can see I&amp;rsquo;d written &amp;ldquo;Ready to move&amp;rdquo; for this one.&lt;/p&gt;
&lt;p&gt;Copy this file somewhere - I copied it one to my local machine, then from there to the new Proxmox (same &lt;code&gt;/var/lib/vz/dump&lt;/code&gt; directory) since I was using FileZilla, but a hardcore scp user would have gone direct between the two servers and saved a bit of time.&lt;/p&gt;
&lt;p&gt;Now on the new server, I can see my backup! All you do then is select it and hit the &lt;code&gt;Restore&lt;/code&gt; button.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-02-06-at-7.58.49-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;A minute or two later, the VM &amp;ldquo;dockhost&amp;rdquo; is in the list. I press &lt;code&gt;Start&lt;/code&gt;, and it boots, my containers all start. And magically, amazingly it all works perfectly.&lt;/p&gt;
&lt;p&gt;If I wasn&amp;rsquo;t already sold on virtualization, this would definitely sell me on it. I understand there are other ways of moving VM&amp;rsquo;s between hosts, but this is hard to beat for simplicity if you can afford the downtime. This was the first time I&amp;rsquo;d ever done this, and I was stopping to screenshot things along the way. From the time I stopped the VM, to the time my last container went green was only nine minutes.&lt;/p&gt;</description></item><item><title>Save Proxmox password in Chrome</title><link>https://blog.iankulin.com/save-proxmox-password-in-chrome/</link><pubDate>Sat, 11 Feb 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/save-proxmox-password-in-chrome/</guid><description>&lt;p&gt;When I installed Proxmox, I&amp;rsquo;d used a secure, and therefore absurdly long and complicated root password. I do use a password manager, but don&amp;rsquo;t have it integrated into Chrome, so it was buggging me having to find it and paste it in each time - why wasn&amp;rsquo;t Chrome offering to save it for me?&lt;/p&gt;
&lt;p&gt;Well, you&amp;rsquo;d guess it was something to do with this. I feel like Chrome is trying to tell me something here:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-02-04-at-7.06.49-am.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Seems like a certificate thing. &lt;a href="https://forum.proxmox.com/threads/how-can-i-save-pve-web-loginpassword-on-firefox-chrome.46180/"&gt;These peeps&lt;/a&gt; say that I need to import the CA from PVE, and one more &lt;a href="https://pve.proxmox.com/wiki/Import_certificate_in_browser"&gt;googlestep reveals&lt;/a&gt; the certificate is on the Proxmox machine at &lt;code&gt;/etc/pve/pve-root-ca.pem&lt;/code&gt; so we need to grab that.&lt;/p&gt;
&lt;img src="https://blog.iankulin.com/images/aint.jpg" width="90" alt=""&gt;
&lt;p&gt;A while ago, I wrote a post about &lt;a href="https://blog.iankulin.com/copying-a-file-via-ssh/"&gt;using scp to copy files over ssh&lt;/a&gt;, and you should totally know how to do that, but my daily drive for secure file copying is now &lt;a href="https://filezilla-project.org/"&gt;filezilla&lt;/a&gt;. Once you have a bundle of servers in VM&amp;rsquo;s and containers that you revisit and move stuff around all the time, its just a big productivity step-up to have that list of hosts and credentials a tap away, plus having the visual arrangement of nested folders works for my brain somehow.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-02-04-at-7.14.40-am-1.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;On Mac, certificates need to live in the KeyChain, so you just drag the file into the certificates page. But it won&amp;rsquo;t be trusted, so you need to go in and manually do that. Where it says &amp;ldquo;Use System Defaults&amp;rdquo; change it to &amp;ldquo;Always Trust&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-02-04-at-7.19.54-am-1.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;It was annoying at this stage to find that Chrome was still saying it was insecure - even though it had changed to saying the certificate was valid.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-02-04-at-7.20.50-am.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Looking at the settings for the site in Chrome, there&amp;rsquo;s an option for &amp;ldquo;Insecure Content&amp;rdquo; I try changing that to &amp;ldquo;Allow&amp;rdquo;, but really I&amp;rsquo;m guessing by this stage.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-02-04-at-7.21.15-am.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;But it actually does help - I&amp;rsquo;ve got the little padlock. That wasn&amp;rsquo;t quite the end since Chrome still wasn&amp;rsquo;t offering to save the password, but clearing the cache fixed that.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-02-04-at-7.24.08-am.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-02-04-at-7.24.08-am.png" width="566" alt=""&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Proxmox - Qemu-guest-agent</title><link>https://blog.iankulin.com/proxmox-qemu-guest-agent/</link><pubDate>Thu, 09 Feb 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/proxmox-qemu-guest-agent/</guid><description>&lt;p&gt;One of the strengths of having virtual machines (VMs) running inside a hypervisor like Proxmox is how they are isolated from each other and their host. This is a strength - if there is a problem with a particular VM nothing else should be affected by it.&lt;/p&gt;
&lt;p&gt;But this can also be a pain if the hypervisor needs access to a VM to control or monitor it in some way that&amp;rsquo;s only possible from inside the VM. Proxmox can use the &lt;a href="https://qemu-project.gitlab.io/qemu/interop/qemu-ga.html"&gt;Qemu Guest Agent&lt;/a&gt; for this purpose. To over simplify, this is a deamon that runs in the VM and opens a unix socket/virtual serial port to the hypervisor, and listens for commands on it. With Proxmox, the main use of this is to aid in orderly shutdowns and backups, but it also allows us to run commands in the VM from Proxmox - an obvious security compromise. You definitely would not want to install this daemon on a hosted VPS.&lt;/p&gt;
&lt;h4 id="installing-qemu-guest-agent"&gt;Installing Qemu-guest-agent&lt;/h4&gt;
&lt;p&gt;I&amp;rsquo;m running Unbuntu Server 22.4.1 inside Proxmox 7.3 for the following examples.&lt;/p&gt;
&lt;p&gt;Use apt (or whatever you distro uses) to install the agent inside the VM.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;apt install qemu-guest-agent
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will do the usual thing - build the list, ask your permission to use the disk space, then download and unpack everything.&lt;/p&gt;
&lt;p&gt;Some guides on the internet will tell you to either use &lt;code&gt;systemctl&lt;/code&gt; to start the agent now, or to reboot the VM. Don&amp;rsquo;t do either of those.&lt;/p&gt;
&lt;p&gt;Instead, shutdown the VM entirely from Proxmox. Then in Proxmox, with the VM selected, we need to go into &lt;code&gt;Options&lt;/code&gt; and find &lt;code&gt;QEMU Guest Agent&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-29-at-9.21.27-am.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;To change an option you either double click on the line your are interested in, or select it and click edit up the top. So do that for &lt;code&gt;QEMU Guest Agent&lt;/code&gt; and select the box to enable it.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-29-at-9.33.05-am.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Once that&amp;rsquo;s done. We&amp;rsquo;ll select the VM and start it. If you watch the summary screen as it starts, you&amp;rsquo;ll be able to see if everything is working by watching the IP Address field. It will start off saying &lt;em&gt;Guest Agent not running&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-29-at-9.37.33-am.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;But then change once the boot gets to the stage of running all the daemons. This is an example of the hypervisor being able to use the agent to get information about what&amp;rsquo;s going on inside the VM.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-29-at-9.33.53-am.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;If you want to double check everything is working, you can &lt;code&gt;ssh&lt;/code&gt; into the VM, and have a look at the process with &lt;code&gt;systemctl status qemu-guest-agent&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-01-29-at-12.07.46-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-29-at-12.07.46-pm.png" width="938" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Or, we can look from the host. If you select the shell of the node - remember mine was called &lt;code&gt;pve&lt;/code&gt;, you have a console for the root node that owns all the virtual machines. We can run qm with &lt;a href="https://qemu.readthedocs.io/en/latest/interop/qemu-ga-ref.html"&gt;all sorts of options&lt;/a&gt; to accomplish different things. One of the most interesting is &lt;code&gt;qm guest exec&lt;/code&gt; which allows us to run whatever we&amp;rsquo;d like, as root, on the guest vm.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-29-at-12.13.17-pm.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;The number 101 in &lt;code&gt;qm guest exec 101 -- hostname&lt;/code&gt; is the Proxmox id for the server we want to access - it&amp;rsquo;s shown in the server view in the top left, and the text after &lt;code&gt;--&lt;/code&gt; is the command to execute. What&amp;rsquo;s returned is some JSON with the exit code and the output. This should be a chilling reminder that anyone with access to the proxmox account will also have root access to all your VM&amp;rsquo;s running the daemon.&lt;/p&gt;</description></item><item><title>Proxmox - Installing a Virtual Machine</title><link>https://blog.iankulin.com/proxmox-installing-a-virtual-machine/</link><pubDate>Tue, 07 Feb 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/proxmox-installing-a-virtual-machine/</guid><description>&lt;p&gt;Installing your first virtual machine (VM) in the Proxmox hypervisor is pretty straightforward. This post runs through those steps using Proxmox 7.3.&lt;/p&gt;
&lt;p&gt;You need an operating system for your virtual machine, I&amp;rsquo;m going to use &lt;a href="https://ubuntu.com/download/server"&gt;Ubuntu server&lt;/a&gt; in this example, but it could just as easily be &lt;a href="https://www.microsoft.com/en-us/evalcenter/evaluate-windows-server-2016-essentials"&gt;Windows server&lt;/a&gt;, or regular windows, or one of the desktop Linux distributions. Whichever you decide, you&amp;rsquo;ll need to find and download the ISO for it. The ISO is a (usually quite large) file needed to install the operating system.&lt;/p&gt;
&lt;p&gt;Once, you&amp;rsquo;ve got the ISO for the operating system, you need to upload it into Proxmox via the web interface. The ISO will be stored in the &lt;code&gt;local&lt;/code&gt; directory style storage. If you click on it in Proxmox, you&amp;rsquo;ll see there&amp;rsquo;s actually a section for ISOs, as well as buttons there to upload an ISO from your machine, or to directly download it into ProxMox from a link.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-27-at-5.45.54-pm-copy.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Above you can seen I&amp;rsquo;ve now got two ISO images stored in my local storage. Once an image is there, you are ready to install it.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-28-at-3.03.45-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;In the top right of the Proxmox screen there are two blue buttons. One of them says &amp;ldquo;Create VM&amp;rdquo;, and that&amp;rsquo;s what we want to do. Now there will be a series of dialogs to click through and fill out. Most things we can just leave as defaults, but a few need some decisions.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-28-at-3.06.56-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;The node (your server) is already filled out. Mine is &lt;code&gt;pve&lt;/code&gt; since I just used the default name when I first installed Proxmox. The VM (virtual machine) ID is used by Proxmox to identify the server. You can change this to any three digit number you haven&amp;rsquo;t used. I&amp;rsquo;m keeping 100. Some people use this to separate their server types, for example all their production servers might be in the three hundreds.&lt;/p&gt;
&lt;p&gt;You need to come up with a name for this VM. These can only use letters and numbers - no punctuation. I like to keep them short, and describe the purpose of this VM, but perhaps you want to name yours after the OS you are using. I&amp;rsquo;m calling this one dockerhost because it&amp;rsquo;s going to host my Docker containers. Once you&amp;rsquo;ve decided, hit &lt;code&gt;next&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-28-at-3.15.02-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s where we choose the image, I&amp;rsquo;m going with the Unbuntu I downloaded earlier.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-28-at-3.16.46-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;The System page - I&amp;rsquo;m just leaving all the defaults and hitting &lt;code&gt;next&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-28-at-3.18.24-pm.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;On the Disks page, we go have a decision to make: how much drive space does this VM get. You&amp;rsquo;ll remember from our discussion about thin provisioning that we can allocate more disk than we have, but it&amp;rsquo;s not a good idea. The final decision about this is something you need to make considering the purpose of this VM and the space you&amp;rsquo;ve got available to you. You might need to google around for recommendations. It&amp;rsquo;s pretty easy to increase the disk size after your VM is created, but more difficult to reduce it.&lt;/p&gt;
&lt;p&gt;The Wizard has suggested 32GB for me, but the &lt;a href="https://linuxconfig.org/ubuntu-22-04-minimum-requirements"&gt;minimum spec is for 2.5GB&lt;/a&gt;. I am going to be downloading a few large containers, so 10GB seems like a good starting point for me.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-28-at-3.29.27-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Next is the CPU&amp;rsquo;s. Leave the defaults for everything, except you need to make a decision about the number of cores. My baby server only has two cores, but yours may have a eight or more. Proxmox will ration things out to some extent by time slicing - so you can easily run eight VM&amp;rsquo;s all allocated one core on a four core processor. And in fact, since a lot of them will probably just be sitting there waiting for something to happen, none of them will need to wait.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s probably a bad idea to allocate all of your cores to one VM, so I&amp;rsquo;m going to say &amp;lsquo;one&amp;rsquo; for mine, but you should also consider the processing needs of your VMs.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-28-at-3.44.45-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Another important consideration is the amount of memory. Again, the needs will be determined by your use case. In my case, the minimum spec is for 1GB, but I&amp;rsquo;m planning on loading up some large containers and I have 8GB in hardware. So I&amp;rsquo;ll go with 4GB. The story with the minimum memory field is a &lt;a href="https://pve.proxmox.com/pve-docs/pve-admin-guide.html#qm_memory"&gt;little bit complicated&lt;/a&gt;, but basically, setting this lower than the max memory gives Proxmox a little bit of flexibility to share it around if you&amp;rsquo;re not using it all - which sounds like a good idea, so I&amp;rsquo;ll say my minimum is 2GB.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-28-at-3.47.21-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Networking in a visualized environment is a whole thing. But I have simple needs and only one hardware port, so all these defaults are fine for us.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-28-at-3.48.50-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;The Confirm page is just a last chance to look over what we&amp;rsquo;ve chosen, then we can press &lt;code&gt;Finish&lt;/code&gt; to create our VM! A few seconds later it should be showing up in the server view. If we click on the VM in the server view, we can see the summary. It&amp;rsquo;s not very exciting yet because our machine is not running.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-28-at-3.57.42-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve highlighted the buttons we are going to use next in the image above. &lt;code&gt;Start&lt;/code&gt; is going to start the VM, and we&amp;rsquo;ll need to open the &lt;code&gt;Console&lt;/code&gt; to see what&amp;rsquo;s going on. Go ahead and click both of these now, and sit back in amazement.&lt;/p&gt;
&lt;p&gt;What happens next depends on what OS you are installing into this VM. You&amp;rsquo;ll just need to work your way through the questions accordingly. One point worth noticing though is that if is asks you questions like &amp;ldquo;Use the entire disk&amp;rdquo;, it&amp;rsquo;s talking about the virtual disk you allocated - not the physical disk.&lt;/p&gt;
&lt;p&gt;This operating system you&amp;rsquo;re installing now &lt;em&gt;doesn&amp;rsquo;t know&lt;/em&gt; it&amp;rsquo;s inside a virtual machine. Everything it sees - the machine bios, the screen, the memory - it&amp;rsquo;s all faked - and managed by Proxmox. You and Proxmox are playing god here. From the VM point of view, it could be installed directly on hardware. It doesn&amp;rsquo;t know the true nature of it&amp;rsquo;s world.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/pappademas_matrixkeanureeves.webp" alt=""&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-28-at-4.15.24-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;While you are killing time waiting for your new OS to install, if you haven&amp;rsquo;t used noVNC before, it&amp;rsquo;s worth noticing the little slide in options on the left edge there.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-01-28-at-6.45.34-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-28-at-6.45.34-pm.png" width="974" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I most commonly use it to force this window fullscreen, but in the &amp;ldquo;Extra Keys&amp;rdquo; button might be handy if you&amp;rsquo;re running a Windows OS and want the Windows key. I don&amp;rsquo;t love this console window - I&amp;rsquo;d rather SSH in and use my terminal, but it&amp;rsquo;s a handy tool that&amp;rsquo;s always going to work if the VM is running.&lt;/p&gt;</description></item><item><title>Proxmox - Storage Basics</title><link>https://blog.iankulin.com/proxmox-storage-basics/</link><pubDate>Fri, 03 Feb 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/proxmox-storage-basics/</guid><description>&lt;p&gt;Once you&amp;rsquo;ve got Proxmox installed, you can point your web browser at the IP for the physical server, and use the port 8006. Log in as &lt;code&gt;root&lt;/code&gt; using the password you entered during the install. If you just accepted all the defaults during the install it will look something like this:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-26-at-7.52.16-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s discuss what you&amp;rsquo;re seeing in that &amp;lsquo;Server View&amp;rsquo; on the left there. &lt;code&gt;pve&lt;/code&gt; is the name of my &lt;em&gt;node&lt;/em&gt; - this installation of Proxmox on my physical server. If you named your server something different during the install, it will be show that name here.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Datacenter&lt;/code&gt; is just the idea of a container for all your nodes. I just have the one node, but if I had another physical server and set it up with Proxmox, it could be configured to appear in this dashboard along with my first node.&lt;/p&gt;
&lt;p&gt;Looking at my node, &lt;code&gt;pve&lt;/code&gt;, it has two storage items. Both are &amp;rsquo;local&amp;rsquo; which means they are physically on this machine. A common setup would be to have a Network Attached Storage (NAS) and have Proxmox use that for the Virtual Machine (VM) images. A big benefit of that would be the ability to move the VMs between nodes (physical servers) in your datacentre if needed - for example if a server failed.&lt;/p&gt;
&lt;p&gt;Since I only have local storage, you might be wondering why the installer set me up with two. Let&amp;rsquo;s click on the first one &lt;code&gt;local (pve)&lt;/code&gt; and look at the summary for it.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-26-at-8.14.04-pm.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;So we can see in the summary at the right, that the type of this storage is &amp;lsquo;Directory&amp;rsquo;. Meaning that this is just a directory in the host (internally, Proxmox is just a specialised Linux distribution - in theory we could drop in to bash and look at this directory).&lt;/p&gt;
&lt;p&gt;The summary helpfully tells us the content for this storage as well, saying &lt;code&gt;VZDump backup file, ISO image, Container template&lt;/code&gt;. These are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;VZDump backup file - backups of VMs or containers&lt;/li&gt;
&lt;li&gt;ISO image - the images that VMs are created from&lt;/li&gt;
&lt;li&gt;Container template - images that containers are created from. For the moment, you can just imagine containers as lightweight VMs&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can see from the graph that I&amp;rsquo;ve used a bit of this storage already. That because I have some ISO&amp;rsquo;s and container templates already downloaded to play with for the next post and stored in the local directory type storage.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s click on the other storage &lt;code&gt;local-lmv (pve)&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-01-26-at-8.28.41-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-26-at-8.28.41-pm.png" width="999" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;We already discussed the &lt;code&gt;local&lt;/code&gt; part of the name &lt;code&gt;local-lvm (pre)&lt;/code&gt; means it&amp;rsquo;s on this machine/node. LVM stands for Logical Volume Manager. An LVM is an abstraction from the physical disk. A single LMV might actually be made of of a number of physical partitions, or even drives. Regardless of this, and LVM presents as a single volume at the software layer.&lt;/p&gt;
&lt;p&gt;This storage is used for disk for the VMs we&amp;rsquo;ll be running. If you look at the use graph, you can see that about 45 minutes ago, I had been using 10GB. That&amp;rsquo;s because I had a VM and a couple of containers configured. When I created them, part of that process is to specify how much disk storage each VM is allowed to use. Then that allocation is stored here.&lt;/p&gt;
&lt;p&gt;You can see in the summary, that the type of this storage is &lt;code&gt;LVM-Thin&lt;/code&gt;. The Thin part of this description means that although a hunk of storage is allocated, if it&amp;rsquo;s not actually used, then it&amp;rsquo;s still available to be allocated. For example, if you have a 100GB LVM, then you allocate 50GB to a VM, then on this display, you&amp;rsquo;ll see that 50 has been used up. But if the VM is only actually using 5GB, you&amp;rsquo;ll still effectively have 95GB to allocate.&lt;/p&gt;
&lt;p&gt;This is a great idea, until those VM&amp;rsquo;s &lt;em&gt;do&lt;/em&gt; start using up most of their allocation, because at that point the VM&amp;rsquo;s will start getting IO errors. Of course, since it&amp;rsquo;s an LVM, you&amp;rsquo;ll be able to add more storage to it before that happens if you&amp;rsquo;re keeping an eye on it. Thin provisioning was invented for companies that sell virtual server services. Their customers rarely use 100% of the hard disk space they pay for, so it&amp;rsquo;s highly profitable to use thin provisioning of storage and resell the same disk space multiple times.&lt;/p&gt;</description></item><item><title>Proxmox Hypervisor</title><link>https://blog.iankulin.com/proxmox-hypervisor/</link><pubDate>Wed, 01 Feb 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/proxmox-hypervisor/</guid><description>&lt;p&gt;I &lt;a href="https://blog.iankulin.com/pi-server/"&gt;mentioned a while ago&lt;/a&gt; that the price of the &lt;a href="https://www.raspberrypi.com/products/raspberry-pi-4-model-b/specifications/"&gt;Raspberry Pi4&lt;/a&gt; was getting such that it&amp;rsquo;s smarter to purchase one of the little business workstations instead. Depsite having little need for such a thing, I went ahead and bought an &lt;a href="https://support.hp.com/au-en/document/c04266271"&gt;HP Elitedesk 800 G1&lt;/a&gt; &amp;ldquo;mini&amp;rdquo; PC. It has 8GB RAM (which is the max for the Pi4) as well as a 128GB SDD, the processor is an Intel i5.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-26-at-10.54.25-am.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;This compares pretty well with the 8GB Pi4 which only has a fraction of the storage (on an SD card) at around $400. One area where the Pi would have an edge might be in power consumption - I expect it would be a bit less. One possible catch for young players is that the HP has a &amp;lsquo;display port&amp;rsquo; rather than HDMI for the screen connection, so pick up a $5 adapter if you&amp;rsquo;re getting one. The metal case and nice finishing on the HP actually looks really great in my office compared with my Pi 3b+ dev server that&amp;rsquo;s sort of hanging on the end of a cat5 cable.&lt;/p&gt;
&lt;p&gt;My reason (excuse) for getting the HP is that I&amp;rsquo;m quite interested in getting some experience with (having a play with) deploying web apps in Docker containers. I&amp;rsquo;m also thinking that having better Linux skills and some understanding of devops would be helpful for working in IT in any capacity.&lt;/p&gt;
&lt;p&gt;Virtualization (running several servers inside one physical server) has a number of benefits anyway, but when your main purpose is to fiddle around with things, it&amp;rsquo;s the perfect tool. How this works is that you have a layer between the hardware and the virtual machines (VMs) called the hypervisor. The hypervisor deals with the hardware, and allocates resources to the separate VMs it is hosting. It&amp;rsquo;s probably worth underlining separate in that sentence. The VMs can be set up to communicate via networking, or have access to shared storage, but they are running independently. If one of them crashes for some reason, the others are not affected.&lt;/p&gt;
&lt;p&gt;In practice this means that I can install and run a number of different operating systems on my server. They can be stopped, started, exported, deleted etc all without affecting each other or any &amp;lsquo;critical&amp;rsquo; systems I&amp;rsquo;ve got running in the same box. There&amp;rsquo;s a number of choices for virtualization software. Microsoft has Hyper-V, VMWare is probably the most famous and has a reduced feature, free version called ESXi. That would probably be a good choice if you want directly transferable skills as VMWare have a substantial profile in the commercial world.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://enlyft.com/tech/virtualization-platforms"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-26-at-12.40.24-pm.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;But one of the missing features from ESXi is central management, and I want to play with my toys, and anyway, all the cool kids are using &lt;a href="https://www.proxmox.com/en/proxmox-ve"&gt;Proxmox&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-01-26-at-12.25.13-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-26-at-12.25.13-pm.png" width="1000" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Like a couple of others on this list, Proxmox is built on Linux, and is a great choice for a home server setup. It is available for commercial use with different (&lt;a href="https://www.proxmox.com/en/proxmox-ve/pricing"&gt;paid&lt;/a&gt;) tiers of support.&lt;/p&gt;
&lt;h4 id="installing-proxmox"&gt;Installing Proxmox&lt;/h4&gt;
&lt;p&gt;There&amp;rsquo;s quite a few guides around for installing and setting up Proxmox, I won&amp;rsquo;t rehash all the steps here, but rather just make a couple of points, especially in relation to the HP 800 as a host.&lt;/p&gt;
&lt;p&gt;I followed &lt;a href="https://www.youtube.com/watch?v=Flw_ycAwT3E"&gt;this video from Darin Wood&lt;/a&gt;. He did lead me a bit astray by fiddling around with the storage options using the command line. That&amp;rsquo;s probably great if you are going to use an external NAS, but form my situation it would have been better to just leave all the storage defaults as they where - so when Darin gets to those commands just skip over them.&lt;/p&gt;
&lt;p&gt;If Darin is a bit dry for you, a very enthusiastic alternative might be &lt;a href="https://www.youtube.com/watch?v=Flw_ycAwT3E"&gt;this series&lt;/a&gt; from Jeremy Cioara (&lt;a href="https://www.youtube.com/watch?v=Flw_ycAwT3E"&gt;Viatto&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Other points were:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I used Balena Etcher to flash the USB thumbdrive with the 7.3 &lt;a href="https://www.proxmox.com/en/downloads/category/iso-images-pve"&gt;Proxmox ISO&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;To get the BIOS settings on the HP, you mash the F10 key on start up, but if you just want to choose the boot device, F9 does a better job of that (because you don&amp;rsquo;t need to change it back later).&lt;/li&gt;
&lt;li&gt;A couple of places mentioned having to turn virtualization on in the BIOS of the HP - it&amp;rsquo;s in the &lt;a href="https://h30434.www3.hp.com/t5/Desktops-Archive-Read-Only/How-to-turn-on-the-virtualization-on-hp-elitedesk-800-g1/td-p/3958272"&gt;BIOS settings under security&lt;/a&gt;, but mine was already on, so perhaps it&amp;rsquo;s on by default. &lt;a href="https://en.wikipedia.org/wiki/X86_virtualization#Hardware-assisted_virtualization"&gt;AMD and Intel processors have some special features to support virtualization&lt;/a&gt;, so that&amp;rsquo;s probably what that&amp;rsquo;s about.&lt;/li&gt;
&lt;li&gt;There&amp;rsquo;s a couple of config files to edit so you can do the updates - this is the step to make your life a bit complicated for not paying for Proxmox support. They are well explained in all the guides.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Apart from that, I pretty much just followed all the instructions and used the defaults (I used a made up email address, and &lt;code&gt;local&lt;/code&gt; as my hostname), and I was soon up and running. The only other thing I did was go into my router settings to reserve the IP address that the Proxmox machine had picked up from the DHCP server to prevent (the low chance of) it changing in the future.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-26-at-1.29.27-pm-copy.jpg" alt=""&gt;&lt;/p&gt;</description></item></channel></rss>