(Here i will be create a Guide, the Guide will take a while so stay tuned)
Hello,
here is a little guide and documention of my journey to switch from multiple Raspberrys to one new faster machine with virtual Containers powered by “Proxmox”.
Whats this Guide About??
The Guide is about to setup a virtual environment on a x86 based maschine to get mutliple services (Pimatic, Iobroker Pihole, etc) on a single Machine without problems that come with a Installation without virtualization. For Example Problems that you need for two Services the same networkports or you need different versions of a software for your services. This will written as journey of how i came to it, why i do it and what im doning for it.
Starting Point:
I had 2 Raspberrys that i used for my Smarthome Services, one Raspberry wars for Pimatic and Zwave.me and one Raspberry wars for a 2nd Pimatic, a Pihole (Addblock DNS-Server) and Script for a Roborock vacuum cleaner.
All is working fine but the Raspberry are pretty slow and its quite ornate to Backup Raspberrys and also there pretty delicate for a productive System because of the SD-Card as Stoarge.
Here starts my journey and my new fun project.
My Goals:
- get every Service on one Maschine
- make it easy to Backup and Restore
- improve the Hardware performance
- have a littlebit fun and learn something new with a new project
Hardware
The first thing is to think about the new Hardware that i should use. A pretty good youtube Channel to stay up-to-day what kind of “single board computers” is on the market is ExplainingComputers.
There a lot of options out there that have low power consumption and more “power” then a Raspberry.
I choose a Lattepanda Delta, its a 4 core Intel Celeron N4100 with 4GB of DDR4 Memory and the option to use a Nvme SSD (see more Infos in the Links above), it costs ~ 180$ (wihout the SSD) by dforbot.com. This is as far i know also the only Seller of this computer, so you have to import it directly from China (inlc. Tax etc). This a pretty fast little machine and with the Nvme Support has also every fast Storage.
The UDOO Bolt seems also pretty Interesting but it costs over 300euros at moment so its pretty expensive but is has to notebook-size Ramsolts that supports up to 32GB RAM.
Whatever Hardware you choose i recommend a minimum of 4 GB RAM, 4 core CPU (x86 based) and fast Storage (SSD, Nvme SSD etc)
What is Proxmox?
Proxmox is a Opensoruce and free Software to create and manage virtual machines and virtual containers. It has pretty good WebGUI for the Management of systems and supports a lot funky stuff for virtual hosts. Im not a expert in Proxmox so list just a few things that i know.
-
Supports virtual machines and virtual Containers
I assume everyone knows what a virtual machine is so whats a virtual container? A virtual container is like real VM it has CPU Core, Storage with partitions and also memory but in the containers will not have there own OS-kernal there use the kernal of the hostsystem so there mutch smaller and need less hardware. Thats the reason that you can run a Ubuntu as a container and need just ~60MB memory for it, containers are still in there own bubble and has there own hostname, IP and Software. As far i know containers cant have a GUI for the OS because there just for publish “applications” like pimatic, webservers, etc. -
Supports shared Memory for virtual Machines
If you run multiple machines that load the same files (like the OS Kernal) for example 1 GB of files you will normally spend with 3 machines 3 GB of Memory but proxmox will find these files and will share them with all machines so you just need 1 GB for all 3 machines. (not supported and not needed for containers) -
Supports a whole backup and snapshot-system
You can easily create backups and snapshots for a container or a VM. You can run fullbackups where the virtual machine /container will be stopped or you can run a snapshot without interrupt the running machine
Installation of Proxmox (on Hardware and Virtualbox)
i tested Proxmox on my normal machine by using “Virtualbox”, with “Virtualbox” you can create Virtual Machines on your Windows PC. Proxmox works fine in it and is perfect for the first steps with it.
1. Download the Proxmox VE 6.1 ISO Installer from https://www.proxmox.com/de/downloads
1.1 Download and install “Virtualbox” (optional)
1.2 Setup Virtualbox (Optional)
After the Installation is completed setup a new Virtualmaschine like this:
click on “new” and give the Machine a Name, select as Typ “Linux” and as Version “Debian(64bit)” and click on next.
Give the maschine that mutch Memory that you want, i choose 4 GB because my lattepanda as also only 4 GB and let the rest default until the creation is completed.
After the creation of the VM select the new VM and click modify go to “System” -> “Prozessor” and give the maschine that many CPU-Core that you want and activate the to opitional features (beware you must have the Virtual-features enabled in your Bios - for more see the manuall of your Mainboard).
Afters we must to setup the network that ourer VM can access our network over the Hostmachine, go to “Network” and “Apdapter 1” and set it to “Network bridge” also set the “promiscuous-mode” to “for all VMs and Hosts”
Now you can start the VM and i will ask you for a Iso so selcet the “Proxmox VE 6.1 ISO Installer” that you downloaded before, there are no important changes in the installation prozess just follow it.
3. Access Proxmox
The default user is “root” and the Password that you set in the installation progress. When the System is ready you see in your VM-Screen or on your devices this message with the IP: Port for the Webgui or you can login to the console.
When you enter the IP and Port in to a Webbrowser you come to the WebGUI of Proxmox. (I dont get it to work that the Poxmox installation replays on its Hostname)
After the Login with “root” and your “Password” you will get this Message:
Don´t be scared! Proxmox is Free and Opensource you can use it legal with out a subscription! There only one restriction you will not get Access to there “Enterprise”-Updates its same like the normal Updates but proxmox make sure that you get only the Updates there run Stable. There is noway to get grit of this Message.
3.1 Config Updates without a Proxmox subscription
There is already a good Guide on the Internet (i used this as well) so just follow this Guide from www.caretech.io
4. Setup the virutal Container Template
Before we can beginn with the creation of the Container we have to download a basis “template” for it. So we must navigate on the leftside to the “local storage”. (Im a little lazy so i used screenshots of my finished installation )
In the list you will find all the already provided OS-Templates, i choosed “Ubuntu 18.04” .
When the download is complete, we can start to create our first Container and we will use this container to make our own template with custom Softwareload and Settings. Right-click on the “Node-name” by default it is “pve” and “create CT”
Now you can enter the “hostname” and the password for your root-account on the new container and continue with "next"
Now we can choose the template that we downloaded before and continue with "next"
The in the next Step we choose the Disk-Size, RAM and CPU for our Template. I recommend a Disk-Size of 5 to 8 GB, beware the Template and every new Container will need this size on the disk. In my case as a described i used a 256GB Nvme SSD so i got more then a enough space.
Next the Core, i choosed everytime 4 cores my system as anyway only 4 real-cores. It is possible to Setup much more cores that you really have but i don´t know what happend, it works fine for me with 5 Containers with everytime 4 Cores.
Next the Memory - The Containers with Ubuntu will use ~ 60MB without any additional Software and the Containers will only use that much Ram that there really need. For Example my Pimatic uses ~ 160MB and Iobroker ~ 540MB. Memory is most the first ressource where you hit the limit for the count of Containers, Applications / VMs. I got 4GB of RAM and i recommend to set 1GB as default and yes we will overcommit the real amount Memory so you have to monitor you Containers. I use in the moment ~66% of my 4GB with Iobroker, OpenHAB,Pimaitc, Pihole and Privoxy so its fine. Swap is fine in the default 512MB.
… Still in Progress …