What is a home lab server ? Does it really need
to be a big, loud 19 inch rack beast that eats electricity for breakfast? I don’t think so. I
recently bought this little PC here second hand on e-Bay for roughly 200 bucks. It’s got an intel
i5 processor with 4 cores, it’s small and silent. I upgraded the RAM to 16 Gbytes and I added a
Terrabyte SSD drive. Now let’s install a software called Proxmox on it that provides virtualization
in Vms (so virtual machines) or Linux containers as well as many many other Enterprise scale
features such as software defined storage, replication, backup, thin storage provisioning
as well as high availability. Stay tuned. (intro) Please use the chapter markers and the
time line if you want to skip parts of the videos. You can see the sections here
on the timeline ? Those are the chapters. I have also put them into the description.
In the last video we built a little home lab server on Ubuntu Server 20 that runs Virtualbox,
Docker, Webmin and Portainer. That works perfect if you want to have an always on device where
you run for example your home automation software and a file server on it. Today we are going
to take this to the next level. What do I mean by that? Enterprises or large corporations have
started to virtualize their environments a couple of years ago. What that means is that rather
than buying hundreds of servers on metal or “tin” like it’s called in IT, for each service,
they buy that one or two big fat servers and run many servers as virtual machines on
those. They use technologies like KVM or QEMU, very often on VMWare ESX Servers. These solutions
are enterprise scale and so is their price tag. In one of the last sessions with you guys on
my discord server someone pointed out that he is using a software called ProxMox to run his
machines on. Following up on this I had a look at it and I must say that I am amazed. Their busines
model is such that the software is free but if you want support and maintenance like you need it
in the enterprise then you just pay for that. I like that business model because it
gives us hobbyists the possibility to use enterprise scale solutions and at the
same time provides revenue for the company and ultimately for the developers. Enough
talking, let’s get this installed. Now let’s go. As usual when I set up a new machine, I use
ventoy in order to boot from a USB stick. I have downloaded the Proxmox ISO from their
website and boot from it. The Proxmox installation is wizard-driven, so the installer asks me
for the most important technical details such as my new user account, the network parameters
etc. Once I have answered all those questions, the installer starts coping files and installs
ProxMox on the server. That does take a coupe of minutes. You can see at the bottom that it
installs .deb packages. Proxmox is in fact Debian Linux with additional tools and its own Kernel
distribution. At the end of the installation, the installer tells me that I can now browse to
port 8006 on my server once I have rebootet it. Awesome, we have successfully installed Proxmox
on that little PC. We can now remove the screen and keyboard and move the PC to our network
rack. From now on we will run it “headless”, that means access it over the network. Just a
little remark on the hardware choice though. If you want to run virtual machines then what you
want is as many CPU cores as possible. This PC has 4 cores. If you want more then you can either
use a PC with an intel i7 processor which would provide 8 cores or – if you want to play serious
– use a server scale processor like the AMD Epyc. There are also low power versions
of that such as the Epyc 3251 which runs at roughly 50 Watts
– here is a quick comparison: We need to be careful here because to some
extend this is comparing apples to pears. The AMD Epyc is a server scale processor while
the i5 is made for desktops. The Epyc focuses on cores and hyperthreading while the i5 has
integrated graphics etc. Also, the i5 is much older. From a benchmark perspective the Epyc is
2 to 3 times more powerful but this is mainly because of the multiple cores. If we compare
one single thread they are roughly even. Where things become interesting is the CPU Mark per
Dollar. And here the i5 actually beats the Epyc. But this is no surprise as older CPUs generally
have better values here than newer ones. I am particularly interested in the
cost of running it over the year as the device will be always on and this is
where the i5 is roughly 30% lower than the Epyc. So as you can see the Epyc is definitely
much more powerful – but so is the price tag. For me, the little i5 will do. I am
not planning to mine crypto currency or anything like that ;-) - Cool, let’s
have a look at the proxmox interface. The Proxmox user interface is an https frontend,
that means that you don’t need any type of client other than a web browser. From this interface you
can do all administrative tasks on your Proxmox server because there is also an integrated shell.
So if ever the GUI does not provide what you need then you can most certainly do it from the shell.
Proxmox by design is enterprise scale, hence you could add multiple nodes and do high availability
between the nodes and also run backups or replication between them. I only have one node
here. If you want to provide exabytes of storage then you can also install ceph which can provide
Object, Block and File storage on a large scale. After the installation Proxmox defines
two default Logical Volumes with LVM, one for the root drive and one as a local
storage for images of containers and Vms. Another nice thing is the deep integration
with ZFS which is a deduplicating file system, that means a ZFS Volume can store
more data than the actual volume size because it would only store redundant blocks of
data once. A lot of stuff in here. Of course the usual admin things such as logs, DNS, network
etc. Are here as well. A real one stop shop. So as you can see there are a lot of
options and possibilities here. I will only use a fraction of those. First
let me set up my network and storage. Two things need a bit of tweaking in my personal
environment. The first one is the fact that I have multiple VLANs, one for my LAN, one
for the guests and one for my IOT devices. I am running shinobi as a cctv software in order
to record footage from my surveillance cameras. And those cameras are in a segregated IOT network
because I do not want them to phone home to their vendor. Also I do not want the traffic from
shinobi to the webcams to go over the VLAN because that would put load on my router
and make the available bandwidth for other things lower in my network. Therefore I added
a USB Ethernet card and connected it directly to the IOT network where my cameras are. The
only thing that did not work well with the GUI was actually to configure the network adapters for
DHCP. That needed to be done in the config files. Configuring the storage to me means that I just
added a 5 TB USB Disk where I store all my files. Adding storage to Proxmox can be done on the
datacenter level – which is logical because it might be replicated over multiple nodes. In my
case I have just added a directory on the disk which can store all types of information
such as disk images, ISO files, containers or templates and backups. My plan is to use
the fast internal SSD for the disk images and use the slower external spinning
hard drive for file data such as music, videos, fotos and documents and provide mount
points on that disk to the containers as needed. Great, so now the system has one leg in each
of my networks, one in IOT and one in the LAN I can therefore access my video cameras
in the IOT network directly over the switch without having to go over the router. The big
disk that I added over the USB port can be used for storing files and the internal SSD can be
used to store Virtual Machines and containers. Actually, let me create my first virtual machine. I want to quickly import an OpenWrt router which
we have created in the first virtualbox episode and set the networks accordingly. Let’s
migrate that machine from Virtualbox to Proxmox In Virtualbox I click on file, then Export
Appliance and then I pick the machine to export. The open standard to migrate virtual machines from
one platform to the other is called Open Virtual Appliance OVA or Open Virtualization Format OVF.
Just need to include a so called manifest file that contains the actual description of the VM.
Once I click on export then virtualbox creates the OVA file for me. Next I need to transfer it
to the proxmox server – in order to do this I use FileZilla so I just copy the OVA file over to the
proxmox server. Switching over to the console of my pve node I can see that the file is there. The
tool which we will use to migrate it is called qm. Quickly launching qm without any options shows
this help page. The two options that will be interesting for us are importovf and importdisk.
But first we need to unpack the ova file which is in fact a simple tar file. So let’s do this by
typing tar -xvf and then the filename. Now we can import the VM using qm importovf and give it a
new machine ID which in my case I chose to be 201, followed by the name of the manifest file and
then we need to tell proxmox where to put it. Unfortunately it did not import the disk, so we
need to do this manually using the importdisk option. Same game, need to give it the ID of the
machine, the filename, the target storage plus you can specify the target format of the disk. We can
see here that the disk has been imported. However, on the VM it is still listed as unused. So we need
to quickly attach it by just double-clicking it or clicking edit and checking the parameters. Once
I click on add then the hard disk is properly attached to the right controller. Cool, let’s
start it. As we can see, Grub starts in the VM and launches OpenWrt. Here we go, OpenWrt is up and
running in that VM and the first thing I want to do is check the network interfaces – Like we did
in the first Virtualbox episode. So let me first stop the VM. I need to create an internal network
as a LAN interface for the virtual router. That can be done under network of course. I add a linux
bridge and give it an IP, subnet and gateway. Next just add the two interfaces to the VM and connect back in and – surprise –
Proxmox wants to boot the VM over PXE. I had not checked the boot order after
having added the IDE Disk manually so I need to do that quickly.
Here we go, restarting the VM – and it looks like the network interfaces are up
– here we go. Just the LAN interface still has the old Virtualbox network range but I can
change this in the OpenWrt GUI. All good. As you can see using the Open Virtual
Appliances Format OVA is a fairly easy way of migrating complete servers from
one virtualization platform to another like I just did from Virtualbox to Proxmox. Next
let’s just try and install a new Virtual Machine with Windows on it. Right after this – CALL
TO ACTION. I need you to get involved. I would love to hear from you if you are using
virtualization technologies like VMWare, Virtual Box, Proxmox, Docker, Kubernetes, Xen,
ESX – If yes, which one are you using and what are doing with it ? Please do leave me a comment. Many
thanks guys ! Over to our Windows Installation. The first thing we need is an installation DVD,
an ISO file. This can be uploaded directly to proxmox by selecting the right storage,
then content and then click on upload. The content type of course is ISO and I just pick
a Windows 10 ISO file here. Takes a while and here we go, it’s uploaded and appears in the list. Now
we can go ahead and create a new Virtual machine by clicking on the blue create VM button in the
upper right corner of the Proxmox interface. We need to specify all the parameters such as the
operating system, the location of the ISO and of the disk image, CPUs and Memory, attach it to the
right network. Just one thing I want to point to because I think it’s really awesome. Proxmox can
provide access to remote display either over VNC or over Spice. Spice is a nice way of having a
seamless remote display very much like with RDP. I have the remote viewer installed on my system
and can now walk through the installation as if I was sitting in front of the machine. Spice can
do much more, such as map local USB devices to the remote machine. Very powerful. Let’s stop
that here. Installing Windows is not the main topic of this video. I’m sure you know how to
do that. Just wanted to show how it can be done. Great, so we can install virtually anything on
those virtual machines. But there is another thing here in Proxmox that is very powerful.
Those are the Linux containers or LXC. If you want to run something under Linux but it
doesn’t need a hypervisor, that means it does not have to have its own Operating System but could
eventually use the kernel of the host machine, then LXC might be a good fit
for you. Let’s have a look. Very much like Docker where we
have images and a docker registry with standard images we have something
similar here which is called templates. The command to use in order to get a
list of the available templates is pveam. Pveam update pulls the current list of available
templates and pveam available lists them. I can then download them using the pveam download
command. Checking on my storage content I can see that the container templates are available. Please
note the small size. The alpine template is only 2.3 Megabytes in size and even the full
Ubuntu 20 only accounts for 200 MegaBytes. In order to create a new container I click on the
blue Create CT icon. Here I need to type a couple of parameters as well in the wizzard such as an
Identifier number for the container, a hostname, a root password and then I can select one of
the templates. Let’s create a real slim Ubuntu 18 machine with one CPU and 2 Gigabytes of RAM.
The wizard creates the container for me and says Task OK – all good. I can now see the container
in my Proxmox Environment and start it. If I wanted to have graphics in that container I could
even do that by installing gnome and using x2go in order to access it remotely. But typically you
would probably rather use a container headless and run a file server or home automation
software on it and access it over a web frontend. As we could see, the LXC virtualization is a
perfect way to run a complete linux machine but without the overhead of a VM. But how is this
different from Docker and why would you want to use it ? Well, Docker is actually based on LXC. It
is basically LXC with a couple of tools around it. Plus you can run Docker in so called swarms
if you need for example more compute power or if you need to serve another
thousand users. In the Enterprise this is mostly done with Kubernetes which provides
additional clustering and scale out possibilities. In the home environment people use
docker to run stuff in containers and when something is broken you just scrap
the container and rebuild it. Now, the proxmox approach to Linux containers – LXC – is much more
similar to Virtual Machines – in other words – if you can’t get your head around Docker then this
might be the way for you to go and use container technology. Proxmox gives a couple of additional
tools such as for example sizing the disk space for a container with a quota. That makes sure
that a container doesn’t grow above its limits. Awesome, guys – that’s all I wanted to show you
today. In the next episode I will use proxmox in order to migrate my old home server
into a virtual machine on proxmox on the new server – so I will show how to
virtualize a physical machine. Until then, many many thanks for watching, liking
and subscribing. Please do not forget to leave me a thumbs up and a comment.
Stay safe, stay healthy, bye for now.