PXE-Boot Raspberry Pi From Proxmox Server | "Easy Mode" setup | Proxmox Home Server

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone and thank you much for watching this is me Mr P and welcome back to another episode of The proxmox Home Server series I had the idea to set up the pxc boot service I'm a proxbox environment and use that to boot the Raspberry Pi's inside my home network and I spent quite a few days trying to figure out how to make this work and just I know I'm doing something wrong because it just doesn't work as as it should but with the at and probably everything in life when you're trying to fix the problem there is a big chance somebody already did that for you it even created the tools to make the setup process much easier so I found that I found the GitHub repository by the name of tech by tips and he's created the RPI pxe setup script which will basically set up all this just with a couple of well not a couple of clicks but much easier than I was going through through a command line and setting up everything from scratch I know roughly the how everything works but it's just like I said I just can't get that to fully function so in this video we'll demonstrate to how this this script runs what you need to do to make this function because the um this script is more designed to run on the Raspberry Pi and use one Raspberry Pi as a server where another Raspberry Pi will be used as a node so there's a couple of things you need to install extra before running the script on your lxc container or virtual machine before basically getting everything set up always all this setup done so let's start by going inside the proxbox and setting up ourselves the LFC container I will use Ubuntu Galaxy container but you pretty much can use even um let's say Ubuntu VM to get this working I'm gonna use LFC container for this video so first thing inside my proxbox YT and the city templates I already have a template and loaded if you don't have Ubuntu template you need to go to the storage unit where you keep your city templates click on a template and then search for Ubuntu and then lower the 2204 23 or 4 doesn't work for some reason my system 20-04 is a little bit too old um I'm just going to use the middle which is 22 or 4 for this video so this is my template that I'm going to use I'm going to click create CT ID number automatically picked up by 100 F100 has been used just pick any ID number that is free so I'm just going to use uh let's say it's a lucky number 777. I have the host name or in the name of the container will be pxe server Dash YT this container needs to be privileged with VMS is pretty much you don't need to do this but for the containers you need to select is it privileged or not I need to make sure that continuous privileged that's why I will I will untick that give it a password for the root root assh access and the templates I will select my Ubuntu 2204 and the disks 8 gigabytes is plenty to boot a up to I would say two free Raspberry Pi's so I will leave eight gigabytes just to boot one right there by will be plenty and the cpu's one core is fine and the memories I will increase that to one gig just to speed up the installation so actually let's make two gigs just to speed up there everything you know what I'm just gonna do two quasi two cores and two gigabytes of RAM just to make the installation process much faster on the networks I'm just gonna choose DHCP to obtain IP address for this container automatically and the DNS everything by default and the confirm I will not select start after created because I need to do a couple of more things to this Lexi container and we'll click finish and proxbox will create this container in no time so task of K contain is created close that I will select the container and I will not start and I'll click options features and click edit I will enable nesting and the first NS SMB the NFS and SMB text allows this container to host NFS and the sample servers and nesting is allowed to run all kinds of all the background processes without interference so there's there's three ticks or well with most this one is is not allowed because it's unprivileged only so second third and fourth needs to be ticked click ok so as you can see here right now is changed to mount equals NFS cifs and nesting and I'm just gonna go back to console and press start so the container is starting for very first time wait for the container to start come on where are you here we go so username is root and the password is the one I created during setup process and a couple of things we need to install to get everything working this I'm gonna go and update the packages then I'm gonna go and upgrade the packages give Auto yes to the request I'm data changing the daisy changing the command so that means that once this is successfully finished run that and when this successfully finished run that which we're going to install two things we'll just install git to git clone the repository and we need to install net tools net tools will allow this container to scan our Network to detect the Raspberry Pi's once once you're running on let's say NDM that this this package probably not required it's already installed but still is suggesting to run this just to make sure it's definitely installed I'm going to say Dash y at the end so command this command will run once this is successfully finished this Commander will run and one this command successfully finished it's going to run that and press enter so while this is happening we need to get ourselves the Raspberry Pi OS image I'm going to use the right grouper imager for that so we're going to run Imager I'm going to choose OS I will select the pios part before that some of the Raspberry Pi Force but you for example let's see bought in the past month maybe six months they already have net boot automatic enabled if you're not sure if it's enabled or not it's not a not a harm to run the Raspberry Pi image select misc utilities images select bootloader Network Boot and then choose micro SD card write that into microSD card put microSD card into Raspberry Pi you don't need to plug in the network for this you just powered it on and wait for about 30 seconds and that will Flash the configuration to Raspberry Pi inboard onboard memory to uh to tell the Raspberry Pi that if micro SD card fails boot from the network in our case micro SD card will not fail because it will be no micro SD card at all so it automatically will jump to network boot my Raspberry Pi already has that setup done so I'm just going to go back select raspberry pios 64-bit pios light I just need to see a light I do need a desktop environment select the micro SD card and I'll click on the gear icon because I want to give the hostname something different so I'm going to say RPI pxc node Dash YT enable SSH and I'll give the password something easier to connect press save right and go for it popo was asking for authorize that that's fine so right now Raspberry Pi imager Flash and raspberry and Os to my micro SD card with all the pre-configurations I selected let's go back here and this is all set up done which is great so right now we have the updated and upgraded the Galaxy container with netboot net tool solder installed and GitHub installed as well let's go to the GitHub repository and select all that let's select all that come on here we go so step one clone this so I'm going to say C clone all this I will clone that into my root folder which is fine it's not a big deal to I can even create a folder within the folder but root fold is going to be fine for me I'm John is going to right click choose paste and press run and right now Repose which is cloned and it's created the folder for me RPI pxc I will navigate into this folder and I have two files readme.md and pi r Pi pxc sh we need to make sh file executable to do that we need to write CH Mod Space plus lowercase x which this command or this flag passes the information that this the next file needs to be converted into executable file enter that so now this file turns green in my case this turns green in your case might be different depending how you are accessing this container as you can see right now it says okay this is to made executable we are happy to run so this is fine let's check how our image is doing so it's almost done with that so let's wait for a couple of seconds for this to finish click OK continue and close that so now I'm just going to take microSD card from the reader which is stuck so micro SD card here I will connect or insert the MicroSD into Raspberry Pi and I will connect that into my server rack and plug in the power by using a power Poe so Raspberry Pi insert and it's all ticking nicely so while the Raspberry Pi is booting up for very first time we can run this script to run the script you need to navigate to a folder where the script is located and type dot forward slash RPI and then a full called Full text full full name of the file ending within extension sh press enter this layout is a bit wonky less it will go actually a bit more here we go our PI PX imager brought to you by George Payton pay Bon I hope I'm pronouncing your name correctly and this is the steps we need to follow to get everything's working not all of them we're going to use but majority of them will be used in this video so step one install our PI PFC server press one would you like to do I am picking option one and press enter and right now it will go and update the number three packages which is not necessary we already did that but that's fine and right now it's installing NFS kernel server and Samba these are two to run NFS server and a sample server and it should install DSM DNS mask here we go to allow Raspberry Pi to detect it it is the pxc server running inside our Network so it says press enter to continue I'm going to say yes and right now it tells you please read this carefully and this is more tailored to Raspberry Pi users when they're using Raspberry Pi as the server because this tells you that you should not to attempt to run this from SD card because SD card longevity will will be shortened because a lot of things will happen on SD card so it's recommending to use Nas but my lxc container runs inside the proxbox which is hosted inside SSD and m.2 and BME so it's much much longer longevity than my micro SD card so I'm happy to pick option three which is usable device instead I'm going to say option three press enter and it tells you we will create this folder so inside root they're going to create the pxt folder with three subfolders boot file system and images and images will have another two subfold if it's going to be Boot and file file systems and this explains to you what each of them will contain so I'm going to say enter and enter that and it's doing the rest of the things it says are you we want to restart this just to make sure everything is fine I'm going to say fine by me and right now the LFC container will automatically restart Galaxy container is backup and running so I'm just going to say login back in I'm logged in straight away into root folder this is the folder where the script lives and run the script again so we're done step one install RPI pxc and install we don't really want to do that see information about this Raspberry Pi so if I choose free and press enter it gives information about this Raspberry Pi which technically is my Lexi container which runs on Intel not 12 gen with 16 cores i7 1260p and serial number and IP address and Etc so we see OS version of Ubuntu 22204.2 LTS that's fine I'm going to click this and now we're gonna go and I don't want to change my hostname identify Raspberry Pi Zone Network I'm going to press 5 and press enter and what's happened right now is went and checked my network and detected all the Raspberry Pi's that's why we have to install net tools on Raspberry pios when you're running this on the Raspberry Pi and you're creating Raspberry Pi as a pxe server this is already pre-installed it's probably going to be pre-installed on your VMS already but in my case I had to install it manually and it's detected to Raspberry Pi is currently active in my network scar.36box.fritz.box this is my octoprint and RPI this is the one we're going to use so I know my IP address for Raspberry Pi is 32. I'm gonna click enter that so it says okay we're done step five get information about the Raspberry Pi I'm gonna press six press enter and we're going to enter the AP address author Raspberry Pi which we're going to use for Pixi boot press enter which username you want to use I'm going to choose Mr P this is the one I chose when I was doing Raspberry Pi imager press enter I'm happy with that and get that one going so that's it so it gives me information about this Raspberry Pi which runs um Bullseye 11 Raspberry Pi 4 model B version 1.4 and version most important thing from all of these obviously if you remember your IP address that's fine you can take a note of that but most important thing is the serial number I'm just going to copy that and just paste it somewhere just to make sure this is very important because the serial number will be used by Raspberry Pi's to detect where to go and what to boot so this is quite important we take a note of your serial number of your Raspberry Pi press enter so we're done step five we've done step six make image of Raspberry Pi before we start this we need to allow root access to Raspberry Pi to do that I'm gonna go inside the LFC inside my SSH and try to log into this I think I'm going to be kicked out because I already logged into this before so my fingerprint might be different here we go so I'm just gonna quickly remove that file so I'm logging into the Raspberry Pi so this is the Sim Raspberry Pi that we just created as you can see RPI pxc node YouTube and I need to change couple of things here first thing I need to sudo Nano and change the file which is located inside slash ATC slash S6 sshd underscore config scroll down a bit until you see a file called pyramid root login delete hashtag make sure this is active and type yes Ctrl X to close y to save enter to confirm and then sudo pass WD root because root password is automatically the generator I don't know what that is so I need to sudo space pass WD pass WD is a command that will change the password and the user root and give it a new password and once that is done I suggest to reboot the Raspberry Pi by running sudo reboot so now Raspberry Pi is basically getting rebooted so what I'll do while I'm here I'm gonna ping the same IP address and I'll wait until the Raspberry Pi Pi will come back to life after the reboot so I'll come back when this is all ticking again here we go Raspberry Pi up and running again I'm gonna control C that and go back to approxbox before I run set 0.7 I like to run 0.5 again just to make sure that this container detects this Raspberry Pi is up and running again so I can see this one on the list which is fine so let's pick the options that and make an image seven enter and then now I need to give ipe address of the Raspberry Pi in my case is 32 enter and what name I want this file to be named I'm going to name it pi for Bullseye one word it tells you to use dashes and stuff I'm just going to use Pi for Bullseye actually just going to use Pi 4 because that's all I have is only Pi Force so Pi 4 is going to be the image name enter and this is gives you instructions how to allow root access exactly what we just did so I'm just gonna enter that otherwise if you see this instructions you go back to do the things to the root password then you come back here you need to restart the script I just done that before initiating option seven and give it a password for the root and press enter and right now the this script connects to the Raspberry Pi by SSH is installing required packages it will create the temp folder which I can show it to you so as you can see it's copying the stuff right now into here so while this is copying I can go here log into the same Raspberry Pi but using the username instead of the root and if I navigate into a root folder unless that there is a folder created right now it's called pxe This is the temp folder that the script creates created and is dumping the stuff in here if I do for example a less as you can see there's a quite a couple of things started to show up uh they were not here at all so boot files limits and images so right now this script automatically logged in as a root created a temp folder and moving all the stuff into this folder to me to make exact copy uh one-to-one copy of the raspberry and Os and this image that we're creating now will be used or can be used as a Master Copy for all the Raspberry Pi OS Raspberry Pi 4 sorry so this might take up to five minutes or so depending on the network speed and Etc a lot of factors involved but just leave this running it's like I said this maximum should take up to about five minutes so I'll be back when this is done and about five five minutes five and a half minutes everything's copied so I'm just gonna press enter on that and that's it so the new the temporary file was created the script copied all the all the files for the raspberry pios into this temporary folder which basically was linked to this Alexi container so before running option A to the provision in Raspberry Pi what I like to do I'm just going to press q and just double check it this definitely all works fine all the files copied well actually this is the files copied so I'm navigating to a CD slide and just slash to go into root folder and if I LS this list content there's a folder created pxc navigating to this and this is contain two folders boot folder will contain the necessary files for Raspberry Pi's to boot file system will contain the files for Raspberry Pi's to function and images this is where we store the images or to that we're going to use to provision another Raspberry Pi's so for navigate inside the images and the list you can take content inside here it is again to fold this boot and file systems a boot is stores the boot files for each Raspberry Pi and file system stores so for each image and the file system stores files files for each image so if we will say list boots boot folder this is my image that I asked to create which is pi4 and if I'm going to say file systems so I do see this okay so it means the image is created let's let me get back to my script where is where it is hiding and render the script again so we're done all the way to a 0.7 so next one is 0.8 provision new Raspberry Pi so my Raspberry Pi iPad is ending 32 and I know the serial number if you forgot to reseal number already or you don't saved it you can run right now again the details about Raspberry Pi so option six give it the IP address of the Raspberry Pi you want to provision a username password and this is the ID number serial number you need to make sure you copy somewhere so just move in the mouse so 0.8 enter so provision what image you want to use to provision this I want to use Pi 4 enter which are a serial numbers so this is the one I'm going to copy from my notes I'm going to say this is the serial number of the Raspberry Pi that I want to pixie boot from the server and the Raspberry Pi's will search for Pixies pxe server inside the network and look for this particular folder which is exactly the same as the serial number to boot I'm going to say this is the one I want press enter and right now what the script was doing copying the files into this temporary folder this is exactly done exactly the same thing but because it's doing within the same file system within the same Alexa container as you can see it's happened way faster and now do you want to restrict access to this file system I'm going to say no I don't want everything is fine and that's it Raspberry Pi has been provisioned smiley face enter that's it and then point nine is delete the image and point 10 is delete the provision provision so I'm gonna cure this and I will navigate into the same folder which is inside the root redirectory and it's a pxe that's where these two folders located if I'm navigating to a boot now there is a folder with exactly the same serial number you know if I list the content this contains all the files that needs to start the Raspberry Pi and if I go in a file system and this so this is as you can see is quite familiar this is where your Mount is your home lost and found media Etc user files temporary Etc so right now I can go into the terminal while I'm still logged in into this Raspberry Pi I'm going to see sudo shutdown and press enter and I'm over here okay pseudo shut down now and Raspberry Pi is getting shut out so what I'm gonna do I'm going to disconnect the Raspberry Pi from the power take the micro SD card out and I'm just gonna Supply the power by a Poe hat without any micro SD card so let me do that now so this is microSD card was used for Raspberry Pi and right now Raspberry Pi is starting up using a pixie boot so let's ping this files to the pi the same IP and number AP address and see once it's gonna go up and running it might take a bit of longer than doing from a SD card because it's running out of the going and searching for my home network for a Pixi server a pxe server so let's wait for a second to start okay it's up and running so right now Raspberry Pi is up and running using the uh using the pxe boot so we can login back into SSH here we go so if I navigate to this directory where all the files is this is all the files that you normally would find when you're booting the Raspberry Pi using microSD card and if I'll navigate into my Galaxy container I am inside the pxe folder then go in file systems I'll navigate into a directory which matches my Raspberry Pi serial number and I can see the same folder just to make sure that it's exactly the same just to show it to you that it's exactly the same I will go for example inside a home inside here is MRP user and right now Mr peusey has nothing so I'm going to say touch test one two three I'll go back inside the SSH where I logged into this Raspberry Pi I'll go inside a home and here we go test one two three I'm gonna say touch subscribe and I'll go back into LFC container I'll say LS test and I can see subscribe and test one two three and right now this Raspberry Pi is Pixie boot Network booting or pixie booting using my PSC server which is located inside the proximox let's remove all these folders on all these files so files gone go back in here and we see files gone so I'm using I was using 32 gigabytes micro SD card to basically user or raspberry osana or Raspberry Pi but right now because I set my Galaxy container to have only where are you only eight gigabytes I can go back inside this terminal I'm going to say du oh no DF Dash H as you can see the root folder is automatically mounted you're using NFS server into this location this serial number and it only has almost eight gigabytes of RAM so right now proxmox will do auto backups of this galaxy container and all the Raspberry Pi's that I will set up to run a pxc or Pixi boot from this like sequential will be automatically booted up if let's say this Raspberry Pi needs more storage I can go back inside my proxmox I'll go inside the resources the same with my 8 gigs is not enough you know what I'm gonna reset resize this give it another 60 gigabytes resize resize done so right now this container using 68 gigabytes I'll go back into Raspberry Pi as you can see so now jump to 67 gigabytes it was 7.8 was almost 8 gigabytes right now is just almost 68 gigabytes and if I'm doing all the source to this Raspberry Pi I need more storage it's just going to increase Galaxy container storage and I'm gonna use it and this storage will be shared through all the Raspberry Pi so if I will connect two three four twelve Raspberry Pi's to this Pixi boot to This pxc Server Galaxy container they all will share the 68 gigabytes and now pretty much this is a normal raspbian OS I can update this now I need a sudo I need I can update this size B and Os updating come on updated you will go sudo app upgrade Dash Y and it's running this of this of this galaxy container so see how it's going so it's using 100 163 megabytes and barely doing anything on a CPU if we go with the dating rate I can install Docker I can install stuff you can't connect USB a device to Raspberry Pi expect that to work well it doesn't work for me I try to connect the USB webcam just to see if I can set up something like a peak Vector booting sort of like a webcam kind of setup using motion eye and this stuff it doesn't work but there you go I can use this and if I messed it up or I done something wrong I'm I can go back if I have a backup I can roll back and the Raspberry Pi I just unplug the power plug it back in and it will boot to whatever whatever restore point I brought this Raspberry Pi back so this is how you do a network booked off Raspberry Pi me spending two three days trying to figure out turns out somebody already did that and made the actual script about it I highly suggest I highly encourage you if you're gonna use this and you're enjoying this to this network boot thing please donate to the Creator I already did that we already did that off the camera but basically I suggest to help this guy go she's done this script it's helped me so much instead of me spending two three days trying to figure out and I was so close to getting working just right before I wasn't detecting that the pixie or pxe server for some reason I know I've done something stupid but it's worth fine and I've been using this quite a lot lately just to mess around right being always just to see what kind of things I can do with Raspberry Pi's Etc anyway thank you guys for watching I hope you enjoyed this video all the links that you need to know all the information I'll leave in the description below and I'll see you in the next one goodbye
Info
Channel: MRP
Views: 9,796
Rating: undefined out of 5
Keywords: proxmox home server, mrp, pxe-boot raspberry pi, proxmox home server series, network boot raspberry pi, pxe server using lxc, mrp tech, Tech Byte Tips, network boot rpi, raspberry pi boot without sd card, network boot raspberry pi using proxmox
Id: G5BhQqRLN4A
Channel Id: undefined
Length: 26min 42sec (1602 seconds)
Published: Mon Aug 07 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.