Creating Virtual Machines on the Raspberry Pi 4 with Proxmox!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
have you ever wanted to create virtual machines on your raspberry pi 4 well if you did this is the video for you so as you can see right here in this tab i have debian 11 running right here i can click this button right here and i can go over to a different tab and here i'm going to have ubuntu 20.04 running on my raspberry pi 4 that is also currently running debian so if you're interested in running something like this on your raspberry pi 4 this is the video for you but first let me tell you about today's sponsor pcb way pcb way the server style allowed to create custom pcb prototypes flexible pcbs pcb assemblies cnc 3d printing and much more let's say you were building a custom project and you needed a specific pcb for it to work correctly all you need to do is go to pcbway.com become a member get five dollars for free in order your first one to two layered standard pcb prototype with dimensions of within 100 to 100 millimeters and with a quantity of 10 and it would be completely free pcb way also has an open source community that you can join where you can find custom projects that pcb way users have created some even with the raspberry pi basically if you need anything from pcb prototypes to smd stencils and to all of their other great services pcb way has it covered well you may ask how do i install this on my own raspberry pi 4. well this video is going to be an installation guide going over that exact thing but first let me explain what we are running right here so right here we are running the proxmox virtual environment and proxmox is a type 1 hypervisor that basically allows you to run multiple virtual machines off of the same system with this nice web interface it is usually used for servers and enterprise works like that so it isn't usually like for desktop usage but we are going to be just playing around with it today on our own raspberry pi force but first let me talk about what you need to have beforehand so first of all we are going to be using this version of proxmox that has been built specifically for the raspberry pi 4. it is called mox and a huge thank you to the developer who has created this it works really well on the raspberry pi 4. so the requirements are a raspberry pi 4 and i would really recommend a four or a gigabyte model since with a two or one gigabyte model of the raspberry pi 4 you are not going to have much ram to allocate to your virtual machine so i personally have any gigabyte pi 4 which is great for running virtual machines since i can have a lot of ram to give to other systems and you are going to need ethernet so i initially tried to do this with wi-fi i hadn't read through this github correctly and it was not working so you do need ethernet for this process so if you don't have that you may need to figure out something to get this working since it is not going to work with wi-fi so keep that in mind but with all of those things in mind we are ready to start installing pymox or proxmox on our raspberry pi 4 to run virtual machines so first of all we are going to be using the raspberry pi imager to flash your operating system so you can install this in all three operating systems it's really awesome it's easy and everything like that so you're going to want to download this for your system if you don't already have it but if you do great we're going to want to go choose os and we're going to go raspberry pi os other we are going to want raspberry pi os light 64-bit you are going to need a 64-bit operating system for this to work correctly and we are going to want to choose our storage okay so i'm going to hit choose storage right here i'm going to choose my device right here i am using an sd card right now but you could also run this off a usb stick an ssd something like that but i personally want to do this setup completely headlessly meaning without a monitor since it's just going to make things a lot simpler so i'm going to hit control shift x and here we're going to have advanced options but i'm going to enable ssh right here and we are i'm going to leave it like that so our username you can leave it as pi or you can set it to something custom if you like alibas pi right now and i'm going to type in a custom password that i am going to remember and you don't really need to configure wi-fi since if you are using wi-fi this process is not going to work so don't worry about that and local settings doesn't matter blah blah all i really needed was to enable ssh and to set a username and password but if you are doing this with a monitor you can skip this part you don't need to do this if you are doing this with a monitor but i'm going to hit save and i'm going to hit right and i'm going to click yes and type in my password so this is going to start writing my operating system to my sd card and then we'll be able to boot it up on our raspberry pi 4 and actually start installing proxmox once the raspberry pi imager is done flashing the image to your sd card plug it into your raspberry pi 4 plug in your ethernet cable and boot it up and if you are doing this headlessly like i am right now you are going to need to find your raspberry pi's ip address so i use a tool on my mobile phone called a thing thing will scan the network it will show you all of your ip addresses and through there i'm able to find my raspberry pi's ip address and then plug it into my terminal to be able to ssh straight into it so however you find your ip address you can do that but i personally use thing so once you have your raspberry pi's ip address you are going to want to open up your terminal if you're on windows the command prompt or if you're a mac os open up the mac terminal but i am on linux currently so i'm going um in my terminal i'm going to type well first let me make the terminal a little bit bigger but right here in my terminal i'm going to type ssh pi since that is my username if you change your username from the raspberry pi image make sure to specify the correct username i did not change mine so mine is going to be pi i'm going to go at 192.168.0.31 but of course your s your ip address is probably going to be different but i'm going to leave it at that for now hit enter are you sure you want to continue to connect i'm going to type in yes hit enter and type in your raspberry pi's password so i'm going to type that in right here and here we are we are in a side of our raspberry pi right now as you can see so we have complete access to our raspberry pi it's terminal and everything like that so now we need to start installing proxmox and like i said before we are going to be using this tool called pymox pymox is actually a script that has everything ready for us to do it and it's just going to make everything so much easier so first of all we just we already have a raspberry pious arm64 so we need to go into root mode at least that's what they want us to do so i'm going to copy this paste it right there and this link will be in the description below so you can copy the commands from there as well so type in sudo s hit enter and give it a second now we are in root so once we're in room we're just going to want to copy this script right here which is going to copy and download the installation script that is going to allow us to do this process correctly so it is already downloaded now we're going to want to copy the this script right here to make it to make it executable now we have that ready and now we're going to start to run this script and this script running it does take quite a long time so be aware of that when doing it so we don't need this anymore i'm going to minimize this and here we are i'm going to hit enter so please don't blah blah you can read this and if you're ready you can type in enter but now we're going to set a host name for our proxmox server so right here is like a default one but i'm just going gonna name mine pi4 that seems good enough for me but of course you can do it whatever you like whatever you want feel free hit enter and this static ip device is going to be an ip address that is never going to change meaning what even if your i if your network tries to give a different ip address to your raspberry pi it is always going to use this ip address so make sure that you set a static ip address as an ip address that you know that another system on your network is not currently using so i'm going to set mine to be 192.168.0. something i know is not being used so i'm going to go 255. and you are going to want to set the port right here which is 24. so slash 24 so type in your static iep address that you want but of course it doesn't have to be the same as mine you can do whatever you like that you know that isn't being currently used on your network once you have that hit enter is this the correct gateway for me that is but of course you can always check with your router to make sure that that is the correct gateway so i'm going to hit y and enter okay so it's going to add these statements to the cmd line.txt i don't really care so i'm going to hit y and enter so you're going to want to type in a new password for your system so type in that password whatever you like okay so now it is starting to begin the installation and normally it takes around 30 minutes so this is definitely a long installation process so just be careful don't touch your raspberry pi you can watch it from the terminal but go ahead drink some coffee take a break you know take a nap whatever you want to do and let proxmox install on your raspberry pi 4. alrighty so now we have proxmox installed on a raspberry pi and how do i know well right here it says installation completed wait and reboot and actually reboots by default because right here you can see the connection was lost and my raspberry pi automatically rebooted and now it tells us exactly where we can access our proxmox web interface through this link right here but there is something that i need to mention before heading on so my installation right here it gave some errors right here as you can see and then it didn't seem to work after i rebooted so i was like so i formatted that drive and i tried it on a different drive and it still would not work so i really do not know why it's not working so i'm actually going to be showing casing my drive that i installed this on earlier before this video that i actually got this working on so hopefully you all don't run into the same error but if you do i'm really sorry but theoretically this should still work because i got it working on my own drive the other day and as you can as you're going to see in a little bit it does work so hopefully that is all sorted out but enough of that let's dive into installing and running virtual machines on our raspberry pi so as you can see right here it tells us exactly where to go in our web browser so i'm just going to copy this right here copy that and i'm going to open up my browser and in my browser i'm just going to go to the ip address you can right click and paste it too if you wanted to but here is my raspberry pi's ip address with the proxmox so here we are in the proxmox ve login screen and this is what you're going to be welcome with the first time and you may be confused about what the username is well let me tell you the default username for proxmox is going to be root so type in root and the password is going to be the password you created during the installation process of proxmox so make sure that that is typed in correctly leave this as they are unless you want to change the language which of course go ahead and change the language to whatever you want it to be but once you have that set login right here and we have proxmox running and right here it says that this is a development build it is an official one well we know that so i'm gonna hit okay so here we are on the proxmox screen and it does look a little bit complex but don't worry i will guide you all through creating your first virtual machine on your raspberry pi 4 but first there is one thing that we should check before going on so in our raspberry pi's proxmox server right here we are going to want to get hits node and we're going to want to go down to network so in network right here you're going to want to make sure that you have a network bridge already selected if you don't have any network bridge already installed you're going to want to hit create and go to linux bridge in linux bridge you are going to want to make fill these ports out but how do you help fill it out well this is how you're going to fill it out so in the ipv4 you're going to want your proxmox servers ip address exactly what you typed in for your static ip address in the terminal for the gateway is going to be your ip address basically with dot one at the end of it and the bridge port is going to be e f t h zero everything else like that i don't you can figure that out if you do need it but for me i don't need it so this is how i got it set up and it seems to work perfectly fine like this so of course set it up in your own way but make sure that you do have a linux bridge already selected and running on your proxmox server and i do want to say a big thank you first of all to this blog post right here that really guided me through this whole process and helped me know how to get this working on my raspberry pi 4 because without them i would have missed a lot of things and not been able to boot into any virtual machine but their guide was really thorough with a lot of images a lot of text and it helped me know exactly what to do to get virtual machines running on their raspberry pi 4. so a lot of what you're going to be seeing in this video is directly learned and gotten from them so huge thank you to them for their help but first of all right now we actually need to upload an iso image to our proxmox server to be able to create virtual machines and you may ask well what type of operating systems can i run on the system well this can only run arm 64 iso images not raspberry pi operating systems arm 64 generic arm 64 operating systems meaning something like this debian arm 64 iso image right here or something like a ubuntu arm 64 image right here so you are going to want to download those but for this video i will be going with the debian arm 64 network installer which i will leave a link down below that you can download i will also leave a link to ubuntu so you can also try ubuntu out if you want to since i also got ubuntu working on the system but you're going to want to download whatever operating system you want a generic arm64 iso operating system onto your computer and then you're going to want to go on your data center right here on your proxmox server you're going to want to hit node and go down my bad not node you're going to want to exit right here you're going you're going to want to hit local right here and go to iso images iso images upload and it uploads select your file select it from your computer mine right here is this debian 11 arm64 iso file i'm going to hit upload and it isn't that big so it shouldn't take too long i'm gonna hit upload and it's uploading it to my raspberry pi right now okay so that upload was really fast now i have a debian 11 image on my proxmox server because it is done now so i'm going to hit this x button right here and the iso is now on my raspberry pi so we are ready to start making a virtual machine on our raspberry pi 4 so hit data center again right here and go to create vm create a virtual machine so our node is again going to be pi 4 since that is our raspberry pi 4. our vm id can be whatever you like i'm going to leave it as default 100 our name you can name it whatever you like again i'm going to be going with the debian for this video i'm going to type in debian right there i'm going to hit enter and for now we do not want to use any media i will ex we will figure this out later but for now no media do not select any media leave the guest os as cur as it is by default instead that that is what we want it to be and then next right here we are we don't really want to change anything in here yet either so i'm going to hit next and disks you don't want to change anything either unless you want to change the disk size so by default it is set to 32 but keep in mind how much this size you actually have on your raspberry pi 4 but for me i'm going to set that to 16 since that should be enough for a minimal debian installation anyway so i'm going to leave i'm going to leave it at 16 right there i'm going to hit next and in cpu our raspberry pi 4 only has four cores so you don't want to give it too many cores but for me i will up that to two chorus half of my what my raspberry pi has i don't want to give it too much since i don't want to overload my pi 4 too much and two should be just enough for what we're doing so i'm going to leave it as two right there i'm going to hit next and the memory of course i have an 8 gigabyte pi 4 so i could clearly up up this like 4 gigabytes and i wouldn't really have an issue but if you only have a four gig pie two gigs is going to be around the max of what you really want to give the virtual machine but even though i have an eight pi i'm going to leave it as two right now by default just to see how the performance is i'm going to hit next and in network bridge this is going to be the net network bridge that we already haven't created earlier so make sure that you have your network bridge already selected right here next and this is a confirmation tab right here if everything looks good to you but we are not ready to boot into that virtual machine just yet so we need to hit qmu right here double click that right here and go down to where it says hardware in hardware first of all we need to change the bios to something right here called ov mfuefi so make sure you select this right here hit ok since on the default bios it will not work correctly so make sure you have that selected as the bios and then click add and add select an e e f i disk right here and efi storage click local leave it as default right there hit ok so once we have that selected we need to go down to where it says cd dvd drive and we need to remove this we do not want that anymore we're going to remove it and now we actually need to go back and create another cd dvd drive so click cd dvd drive right here and our bus or the device i device is going to be a scsi thing right here with two as two right here and our use our storage is going to be local of course and our iso image is going to be the debian image that we uploaded earlier so if you have that configured like i do right here great you are on the right track so click create and that is about it for what we need right here but we actually need to go back to where it says options right here on the same tab go to options and go to boot order and boot order up the iso image to boot order number one because we wanted to boot from the installer first before trying to boot from the arc the storage that we created on our virtual machine but of course after installing this we will change this back to boot from the hard drive first and not the installer but for now put the installer at the top hit ok so we are basically ready to start booting into our virtual machine right now so back in data center right here i'm going to click this virtual machine right here the one titled debian double click it and go to console and console now we are ready to hit start so this is going to start starting up the virtual machine and hopefully we will be able to access the debian installer and start installing debian on our raspberry pi 4. but of course be patient and may take a little while to boot up but again be patient and yeah okay so it is now booting into debian as you can see right here and here we are in grub of debian and i want to go with the graphical install but of course if you want to go with the more terminal base you can always hit install but for me graphical install seems perfect so i'm going to hit graphical uninstall and hit enter and hopefully we will boot into that debian installer as you can see it is booting up right now for us and here we go guys we are running a virtual machine on our raspberry pi through proxmox that is really awesome but how do we really control this well watch my mask right now right now my mouse is on my main computer if i scroll it over it just hops straight over to here and it seems to really seamless and it really seems to perform really well so my language i'm gonna leave it as english blah blah blah and i will go through the setup of this virtual machine on my own since this video really isn't a guide on how to install debian but hopefully you have the overview of how to set this up so i'll meet you back once i have debian successfully installed on here and we'll play around with debian on this virtual machine okay so i actually just wanted to show this part real quick since some of you may be confused so once you're creating your virtual machine if you were going with debian like i am you will eventually reach a screen like this that is titled partition disks so you're going to want to hit guided use entire disk and hit continue and your disk that you created for your virtual machine will automatically show up with however much disk space you allocated it during the setup process i gave mine 16 but mine does say 70.2 which they're always they're never really exact so that is fine for me i'm gonna select that and continue and i'm gonna all files in one partition hit continue and basically we can just go through the installer like this that is good for me i'm gonna hit continue and yes i'm gonna write the changes hit continue and this will just help you all to know how to purchase your disk successfully on this operating system it's really simple but i know some people may get a little bit confused and stuff so i want to just go ahead and show that as for my desktop environment for this virtual machine i'm going to go with xfc since it's pretty lightweight and i would rather go with it than something like gnome or the debian desktop environment since i just want to give our virtual machine a kind of a lighter desktop environment so i'm going to go with xfc for here continue and it's now going to start installing it and this installation does take a little while since it is grabbing everything from the internet all right so here we are finally with the debian 11 installed in our virtual machine so it says to finish the installation you're going to want to reboot so i'm going to hit continue so the one issue we have right here is that it is booting us back into the debian installer not into our debian desktop and well how do i change that well you need to go right here to where it says shutdown hit shutdown and shut it down successfully so hit yes and this is going to successfully shut down our system so we can make one tweak to make sure that we can fix this virtual machine but if you are a little bit unpatient like i am which and sometimes may be bad but i'm going to hit this arrow right here and i'm going to go stop so this could be harmful to losing data or different things like that but if you're really impatient and what you want your virtual machine to stop a lot faster just hit the stop button and it should shut down a lot faster okay so once your virtual machine is completely shut down right here and you can know that it's shut down by getting no signal in the console or even seeing that there's no little like check mark right here next to the monitor icon so once it is shut down you are going to want to go down to options and go down to right here boot order and in blue order make sure to pull this i the s s c s i zero with the icon with that little hard drive icon pull that all the way to the top to make sure that it tries to boot from our hard drive first rather than the iso or the debian installer hit okay and now we can go back right here to debian again hit console and hit start so hopefully we will be in the debian desktop right now here we are finally with the debian login screen so right here as my username i'm going to type in whatever username i created during the installation process same for my password whatever i created during the installation process i'm going to hit login and hopefully i will be on the xfce desktop environment in just a second alright so here we are on the xfce desktop environment and does it work correctly yes i can hit this right here and i can browse through all of my applications i can open up my terminal right here and i can i can even try to install an application so i'm going to type sudo apt install and this will also show you guys that i do have a network connection through this virtual machine oh i am not in the sudoers file so that would be something to change in the near future but since i'm just doing this right now i'm going to type sudo s type in my password oh my bad i'm going to type an su type in my password and here i'm going to type apt install neofetch and of course you probably should not be in root i know that i'm i just don't want to spend the time trying to add my user to the sudoers file at least for now so i'm just doing it in root it might not be safe or smart but it will work for now so neofetch is now installed so if i try to run it right here i could type in uft hit enter and we get the debian logo and this is a 64-bit arm 64 distro and it is running in our virtual machine and as you can see right here we have two cores like we set it to and we have about two gigs of memory like we set it too so those things are all perfect what about web browsing would web browsing work in this virtual machine well why not try it out so i'm going to hit the web browser icon right here and this is going to be the firefox web browser so here in the web browser i'm going to type something like pi4 and see if it shows up so you know what's so surprising this virtual machine is not that slow even through this vnc service meaning this no vnc that we're accessing it through this is not a slow operating system really i mean i'm surprised at how responsive this thing actually is i can i can scroll through right here even just with those two cores i can access these pictures right here and there are there is definitely screen tearing but it does work which is really awesome so i mean this is debian a debian virtual machine on your raspberry pi 4. sure i could go through much more but for now i think i'm just going to leave it there so we've come to the end of this video and i hope this guide was helpful for you all to know how to get proxmox set up on your raspberry pi 4 and set up your first virtual machine but of course you are not limited to one virtual machine right now i just have debian installed but i could create another virtual machine of something like ubuntu or something some other operating system that you could try on here to see if it works so if you found this video helpful a like that the video would be awesome a subscribe to the channel would be spectacular and thanks for watching [Music]
Info
Channel: Luke's Tech
Views: 32,996
Rating: undefined out of 5
Keywords: proxmox, virtual machines, raspberry pi 4, raspberry pi, virtual machines on raspberry pi 4, proxmox on raspberry pi 4, debian, proxmox installation guide, proxmox 7, proxmox installation guide raspberry pi
Id: D6DIslXyIHU
Channel Id: undefined
Length: 26min 25sec (1585 seconds)
Published: Wed Apr 13 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.