Scripts for Streamlining Your Homelab with Proxmox VE
tteck.github.io
tteck.github.io
After poking at a couple of these, they seem like they're 50% shiny packaging and 50% one-liner bash commands.
One could definitely write them on their own.
It’s also another way to discover other packages in these categories.
Some of the LXC container settings can be a little specific and these scripts manage those we’ll most of the time with a standard install, or an advanced one is available too.
And more broadly, a lot of software could be summarised as a pretty packaging of a basic tool.
If you want things to Just Work, this is probably not for you
I have been pleasantly surprised to find that, after the initial research & setup, things still "just work!" In some cases, more reliably (and way more quietly!) than before.
But no, after the first couple hours of tinkering it Just Works.
This past week I settled in for a good solid weekend of getting a gitlab server stood up. I was looking forward to it! Imagine my disappointment when it was a single command that took half an hour to run.
Oh well, I guess it just means more time for my other hobbies.
There's definitely some cool stuff here (disabling the nag screen, thank you!) but I really dislike the way it's presented.
I don't like the curl|bash very much, but mostly I think this would be far more interesting as a collection of one-liners to accomplish each task vs the current form of a curl|bash with dialogs and prompts. I think that's better for security and better for learning you should know what commands you're executing!
I do a quick look over of the source to make sure it’s ok. It saves me so much time and pain.
With docker it seems a Dockerfile is a self-contained recipe. You build it, then you run the container.
with proxmox, you sort of have to be a sysadmin. The proxmox UI helps you define the characteristics of the container, but then you have to put everything inside the container yourself without help or reproducibility.
It's working so well I now have too many vms and need to get a bigger disk.
[1] https://sschueller.github.io/posts/wiring-a-home-with-fiber/
https://web.archive.org/web/20231128113854/https://www.idont...
I'm always reading stuff about people using proxmox but don't really understand its 'edge'
While things like TrueNAS exist with ZFS support, in the past iX systems has made some overeager patches to ZFS, to bring in new features that weren't appropriate to include yet IMO. I hate to dig up old news, but that's why I've avoided them so far.
Basically I've got Proxmox "figured out", which lets me fuck around with the things I want, rather than the things I don’t want. This reduces my very subjective mental overhead.
All the high availability stuff is wasted on me though, and I just disable the related services.
Note to new users experimenting with proxmox The most common "gotcha" with proxmox, is that it does NOT automatically adjust network stuff after install. If you switch out a network card or change what physical port it's connected with, you will lose network access, and need to manually edit `/etc/network/interfaces` to make sure your using a correct port ID and/or assigned IP are valid.
iface vmbr0 inet static
...
bridge-ports <The port ID, like "enp130s0f0">
...I've also not enjoyed reading their forums at all, while information about Proxmox tends to be actually helpful rather than berating people over their hardware choice or spreading misinformation about ZFS.
I had been running a k3s cluster (k8s flavor) on some Raspberry Pis, but decided I needed some non-ARM nodes, and "invested" in a few low power "1L" AMD64 PCs (6-8 core + hyper-threading). I was initially going to just install Ubuntu and base my setup off my existing Ansible automation to make things less inefficient. But I figured I'd play around with Proxmox first and see if there was any benefit to using that as a base layer since I'd heard a lot about it.
I'm so glad I did. I ended up learning quite a bit in the process. Some quick highlights about using Proxmox for VMs in general:
* Proxmox supports creating a "cluster", so you can login though one machine to administer them all. You can conveniently "move" VMs between machines pretty seamlessly.
* If you install the para-virtualization drivers for e.g. Windows or Ubuntu VMs, you can do pretty fast remote KVM. E.g. I could run Youtube on a Windows VM in my basement over "Spice" and it almost looks like it's running locally. (Not that it's a use case I care about, mostly just shows the fact it's performant.)
In terms of actually getting around to deploying k3s on top of the infra:
* I ended up learning HPC-Packer, and HPC-Terraform, which integrated nicely with my existing Ansible experience.
* Packer turns an Ubuntu ISO + my "base" Ansible setup playbooks into a pre-baked machine template directly in Proxmox. (My local machine's Packer binary just orchestrates the process.)
* Terraform deploys the machine template into the Proxmox cluster. Basically a config file of machine names + IPs + mac adresses, and a few other params and initial setup.
* Ansible then installs any final dependencies (anything not in the base template), setups up the first k3s master, grabs the join token, and adds in 2 more master nodes for a proper `etcd` backend.
* Ansible then installs my base Kubernetes services (cert-manager, Rancher, Longhron storage, etc) via running helm commands on one of the nodes.
* This is where I'm at now; the next step is for me to deploy my existing Flux.cd-automated "Gitops" apps (built for ARM64+AMD64 via Gitlab runner, also in Proxmox). These _had_ been running on my now-quite-crusty-seeming Pi cluster.
I can run a single command to delete all the VMs, and rebuild + setup everything (full HA cluster + apps deployed and running) from scratch in ~6 minutes without any manual input required from me, just a few secrets/params in a config file.
This has made exploring the horizon of possibilities _so much easier_ without getting locked in; I can try to weird Longhorn storage configs, or try out k8s monitoring stacks without worrying about needing to "back out" my changes if I picked bad settings. (Just blow it up and try again!) I can change how VLANs are configured in early steps, or try adding a library to the base Ubuntu install cluster-wide super easily, etc.
I am primarily a software-engineer, so it has been really nice to delve into the operational side of things, and get a proper reproducible setup. It really has transformed how I think about the cluster in that it's no longer a "thing to carefully maintain", but instead a great sandbox to explore AND deploy my own k8s applications on top of without playing cloud bills.
My Proxmox journey in the past few months definitely turned into more than a rabbit hole than I'd expected.
yeah you can write weird shell script and re-implement hot vm migration (moving a physical machine from one physical host to another without shutting it down) but what's the point, really? you might as well use proxmox.
if you ever actually need to see how it's done you could just see what's proxmox doing under the hood (it's open source after all)
It has a webui with a bunch of features.
If you don't like or want those things, that's fine. This question feels like a "no true power user would...".
In the same amount of time, if I were diving in to DIYing it, I'd probably be about 5 minutes into reading the arch linux wiki page for KVM/qemu.
Like any distro, it has some quirks, but, those are worth dealing with because the day to day is almost always frictionless.
Have a look at this script for example https://github.com/francescor/swarm/blob/main/create_swarm_v... which is the "proxmox" side of cloud-init, that then load an ordinary cloud-init https://github.com/francescor/swarm/blob/main/cloud-init/clo...
...
# remove snapd trash
- snap remove lxd
- snap remove core20
- snap remove snapd
- systemctl stop snapd.service
- systemctl stop snapd.socket
- systemctl stop snapd.seeded.service
- systemctl disable snapd.service
- systemctl disable snapd.socket
- systemctl disable snapd.seeded.service
- systemctl stop snapd.service
- systemctl stop snapd.socket
- systemctl stop snapd.seeded.service
- rm -rf /var/cache/snapd/
- apt autoremove --purge snapd -y
- rm -rf /root/snap
# remove apport trash
...I try to do everything without Ansible: cloud-init is pretty powerful, too, but I am reaching the 64k limit, so sooner then later will go "back" to Ansible.
There's a pretty neat Proxmox API library written in Go that can do this all for you: https://github.com/luthermonson/go-proxmox
There's a Terraform plugin planned, as well. Not sure what the status on it is, currently.
I also am slowly working on my own Proxmox CLI, consuming the go-proxmox library: https://github.com/perchnet/gomox
But unfortunately I don't have much software engineering experience, so it's a very slow process... :)
It’s great to have something up and running in minutes to only redo it slightly differently.
If you are considering two proxmox hosts ensure the second one added to the cluster is an empty proxmox host, and the proxmox cluster from the first box will assign unique id’s to all containers on any host.
By default, the HA mode insists that all nodes are up or others won't come up, making this tweak (it may be contained in the OP scripts, I don't recall) allows you to retain many of the benefits of having Proxmox machines "connected", without requiring you treat them like a HA cluster.
In my case, I have a node I shutdown when it's not used, I use it for specific occasional tasks, and then I have nodes I want up all of the time.
With the non-HA tweaks, you can still do things like centrally manage, migrate VMs and containers between nodes etc, without the limitations of it wanting them all up and available all of the time.
I don't really use the HA features of proxmox that often, mostly just for migrating vms across hosts. But I had been thinking of re-installing some of my remote servers with proxmox and hooking them up to the same cluster so that I could potentially shut off all of the servers in my basement and run everything from a remote location, then migrate the vms back later.
There's also the issue of quorum of it's only a 2-node cluster, though I've personally not had any issues with it, despite repeatedly restarting the different nodes.
I see no reason why you couldn't do this to allow you to move your VMs from home to elsewhere and back again as you just mentioned.
I thought quorum feature of proxmox was also latency sensitive, but this is the only thing I found:
https://pve.proxmox.com/wiki/Cluster_Manager#pvecm_cluster_n...
Maybe this doesn't matter if not using HA? I'll read more about it and maybe test it out
Just my experience though, YMMV.
Is anyone using Proxmox on their homelabs? Would you recommend blowing away Windows and installing Proxmox and then install Windows with PCIE passthrough?
Firewall is a great example of what not to run on a vm, at least for me! I consider gateways as appliances though, and I haven't run my own router on Linux since I first got Cable internet in 2002. I remember how awesome it was compared to the weak routers available at the time!
Now I just buy a UDM Pro and forget about it!
That said, I wouldn't mix the two use cases either initially nor over the long-term. House/network infrastructure should be on a more stable host than the retro-game console connected to your TV (IMO).
In your case, I'd recommend buying another PC (even an ancient Haswell would be fine to start) and getting experience with vanilla proxmox usage there before jumping straight into trying to run infra and MAME/retro gaming on PCIe passthrough on the same singleton box.
I'd recommend a separate device if you need any access to a GPU. But I do recommend Proxmox as a homelab. I still have it running on a separate 2012 Mac Mini.
But i'd be happy to be proven wrong.
At the time I had no idea how popular it was to run this setup, I thought I was being all weird and experimental. Was surprised how smoothly everything ran (and still runs, a year and change later!)
Bonus, I was able to just move the PC to another disk when the SSD it was on was getting a bit full. Moved PC's storage onto a spinny HDD to make room to shuffle some other stuff around, then moved it to another SSD. Didn't even need to reboot the PC VM, haha.
Proxmox backup server running on my NAS handles deduplicated backups for it and other VMs too which is great.
[1] https://jellyfin.org/docs/general/administration/hardware-ac...
ProxMox is on my list to try out. So far I’m very happy with Unraid. It makes it easy to set up network shares, find and deploy containerized services, and handles VMs if you need them. I try to avoid the VM and focus on containers because it’s more flexible resource wise.
My server was originally a single debian installation set up to host local services for things like git. That grew into hosting a site, vpn, then some multiplayer game servers. When I reached a point where too many things were installed on single machine, I looked at vm options. I've used VMWare/VSphere professionally, but settled on Proxmox for these main reasons: easy to set up and update, easy to build/copy vms, simple way to split physical resources, monitoring of each vm, and simple backup and restores. All without any weird licensing.
That server houses 4 vms right now. That might be a bit much for your mini pc but you could do a couple. The multiplayer servers are the main hog so I isolate resources for that. The windows machine is only for development which isn't your exact use case. I can say however that I've never had issue when I need it. Only thing I can't speak for is the need for graphics passthrough.
MIG does need hardware suppoet, and from what I understand really expensive licensing. I don't know if AMD has a parallel technology.
That is pretty cool that it is vendor agnostic. I've found a few docs from a few years ago talking about stuff like it on Linux, but development of it seems to have stopped or just not progressed at all.
But she is they would use it in Azure, I imagine there they are using enterprise GPUs. But in Andheri scale datacenters it definitely sounds like an advantage!
Anecdotally, it's a very effective setup when combined with a solid KVM. I like keeping my main Debian desktop and the hypervisor separate because it keeps me from borking my whole lab with an accidental rm -rf.
It is possible to pass all of a systems GPU's to VM's, using exclusively the web interface/shell for administration, but it can cause some headaches when there are issues unrelated to the system itself. For example, if I lose access to the hypervisor over the network, getting the system back online can be a bit of a PITA as you can no longer just plug it into a screen to update any static network configuration. My current solution to this is enabling DHCP on Proxmox and managing the IP with static mappings at the router level.
There are a few other caveats to passing all of the GPU's that I could detail further, but as a low impact setup (like running emulators on a TV) its should work fairly well. I have also found that Proxmox plays well with mini PC's. Besides the desktop, I run it on an Intel NUC as well as a Topton mini PC with a bunch of high-speed NICS as a router. I cluster them without enabling the high availability features in order to unify the control plane for the three systems into one interface. It all comes together into a pretty slick system
I have a ubuntu server install running on an old laptop to do very basic background jobs, backups, automation, run some containers etc. – am I missing something by not using a hypervisor? What are the benefits?
- Unifi Controller installs like a half dozen dependencies to run (Mongo, Redis, etc last time I used it), much easier to isolate all that in a VM
- Home Assistant's preferable and most blessed install method is Home Assistant OS, which is an entire distribution. I've run HA in Docker myself before but the experience is like 10x better if you just let it control the OS itself
- I have Plex,Sonarr,Radarr, etc running for media - there is software called Saltbox which integrates all of these things for you so that you don't need to configure 10 different things. Makes it a breeze, but requires a specific version of Ubuntu or you're in unsupported territory (kinda defeating the purpose)
Lots of stuff you can be totally fine just using Docker or installing directly onto the host. But having the bare metal system running Proxmox from that start gives you a ton of flexibility to handle other scenarios.
Worst case you just setup a single VM & run your stuff on it if you have no need for other types of installs. Nothing lost, but you gain flexibility in the future as well as easy backups via snapshotting, etc
For major upgrades, I may go a step further and do a manual snapshot before upgrading and then decide whether or not to commit (usually) or rollback (easy, when needed).
The (emotional) security provided by this is nice, as is the time-savings (after initial time expense to learn and setup the base proxmox infrastructure).
ZFS support that just works is really nice too. They also have a backup solution I’d like to check out but haven’t yet.
I'm a virsh/kvm user myself, but I admit I'd probably leverage more features of the platform if the interface was easier to use.