Converting a Physical system to a Proxmox VM

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
today I'm going to be going over taking a physical server like this one here and converting it to a virtual machine while keeping all your programs configurations and other data stored on the drive this means that the new virtual machine will work almost identically to the way that the physical machine does but now it's a virtual machine instead of a physical system in most cases it is best to create a new virtual machine from scratch and set up all the programs and configuration you need but that can often be a pain and it can be a lot quicker to transfer from another server sometimes you don't even know how that server is configured or how to set it up again so your only real option is to just clone this physical system into a virtual machine and also these techniques will work for cloning VMS from other hypervisors to proxmox as you can pretty much treat them like a physical node and copy all the data that is stored on their virtual disks to proximox you can think of this process in a lot of ways like taking a physical system and cloning it to another physical system but in this case you're going to build another system or a virtual machine in this case and you're going to copy the data from the physical hard drive onto the virtual hard drive one thing you should check for before starting this process is if you have BitLocker enabled in Windows it's often using the TPM to store keys and those keys can't be copied over when you clone the image so what you'll likely want to do is disable BitLocker for now and then re-enable it on the system if you don't do that you'll need the BitLocker recovery key to boot the system up because it cannot access that TPM for the key let's take a look at the steps that you'll want to follow when setting up a VM that is a clone of a physical piece of hardware so here I am going to create new virtual machine Wizard and proxmox and I've just kind of set up a Old Dell server name under OS it typically wants you to pick an ISO file that you're going to install your operating system from but you're not installing an operating system it's already installed so I'm going to say do not use any media under guest OS I'm gonna pick what this system is in this case this is Windows 10 because it's going to pick some drivers and other utilities that are more compatible with Windows 10. next to going under system is one of the main changes you want to look out for and it's under the bio system of default C bios or UEFI if you have a newer system it's likely booting from UEFI and if you have an older system it's booting from the Legacy BIOS method if you have a Windows system you can check by opening the system information page and looking under the Bios mode and seeing if it says Legacy or UEFI if you're on other systems you can often tell if it's a UEFI system because it'll have an EFI partition on the hard disk and it'll be using the GPT partition table and also if you get this wrong and the system doesn't boot at all luckily it's very easy to change this setting after the VM is set up and configured so don't worry too much about getting this option wrong under disks and products marks you can set up the disk that the data will be copied to this may vary depending on how you're cloning data and I'm going to talk about that a little bit later but for now I'm going to create a new disk using the SATA controller and that's because the SATA controller is compatible with modern versions of windows out of the box and I don't need to install any drivers Linux on the other hand typically has the i o drivers built in so you can try this luckily this is also relatively easy to change later on so if it kind of Kernel panics and says it can't find any disk that's likely what you want under disk size I picked a little bit bigger than the real disc I'm copying from in this case the disk I'm going to be copying from is 200 gigabytes so I just made it 240 so there's a little bit of extra wiggle room under network is another driver that you want to be aware of luckily the network card won't prevent the system from booting so it's much easier to change later on but the Intel E1000 Nick Works in pretty much every operating system out of the box the vert i o Nic is a higher performance Nick but you have to install the driver you can do this by downloading the driver in the VM once you have like an E1000 Nick or you can add a CD-ROM that has the drivers for the neck and have it installed on the gas OS and Linux comes with this i o driver by default but Windows does not now that the virtual machine is created all the data from the physical systems SSD or hard drive needs to be copied over to the virtual hard drive that the VM has and there's actually quite a few different methods to do this and I'm going to show a quick demonstration of all these methods after I just kind of go over each of them and no pros and cons so the first method is Clonezilla which is a live USB stick that you can boot from and copy the data over the network if both the physical system and the new hypervisor on the same network it's really easy to copy the data over and I'd say the simplest way to do it but unfortunately it tries to read the partition tables and I've had systems that fail so using DD in a Linux live USB is a bit more complex and will cause more terminal knowledge but also should almost always work as it copies every single block as an identical copy to the virtual machine you'll need a way to copy the image file of that hard drive over to the proxmox server some ways to do this would be like setting up an NFS server on the proxmox host to copy the data to or using like a USB hard drive to copy the image to the hard drive and then plugging that into the proximox server to copy it over to your VM disk if you're on Windows one way to do this is using disk to vhd and this actually lets you take a running Windows system and create a vhd image of the operating system that is bootable and contains all the same configuration and files as the existing install and this will create a vhd x file of which commute IMG in proxmox can take that file and convert it into a qcal 2 file which then can be used in a virtual machine if the system you're cloning data from doesn't boot likely the best way to get the data from it will be to take out the SSD from the system and put it into your proxmox host and copy the data over if it doesn't have a spare drive bay something like one of these little USB enclosures would work otherwise you can put it in a spare drive bay and take an image of that system in the proxmox system I'm going to first take a look at using Clonezilla to clone a physical or another virtual machine to a proxmox via and this actually works between any physical systems and any VMS I'm just going to demonstrate it in proxmox Clonezilla is a little Linux live disc that is made for cloning systems and it can clone systems inside another computer or to image files but it also has a nice feature where can clone over the network so if you have two systems that are booted from a Clonezilla live disc both of those systems can copy data over your local network and then do it that way and that way there's no reason proxmox to go and copy and edit config files and copy an IMG file something in there it's all just do it in the actual VM that you're running so to in order to test this and demonstrate this I've set up a pair of VMS one VM has a working OS on it and the other VM has an empty disk that I'm going to be copying the data to so in this example the one on the left has the data that I want to copy data from and the one on the right is the one I want to data copy to and it was a little bit of menus to go through like selecting the language and the keyboard layout but once I've selected that I'm going to take the source or where I'm copying the data from and say start Clonezilla and I will select the remote Source I will then take my system that has the data that I want to copy from and select a remote source and then I have to do a little bit of configuration before I can have the data copied from this so it's going to take a little bit of time to configure it I'm going to select beginner because I can use the default options for what I'm doing here I want to copy the whole disk including all the boot partitions and stuff and not just a single partition and use DHCP on my network to get the configuration set up I'm then going to select my commute hard disk which is the one I want to copy data from not check any other data and it's just going to show up a prompt when I'm done to let me choose what my next action is and it's saying this is everything I'm doing here I can press enter to continue and now it's going to sit here and wait for another system to try to go and access its data over the network so on this other system that's going to be the destination or where the Clonezilla data goes is going to run here so I'm going to paste it start Clonezilla on my destination system I'm going to click on remote destination instead of remote source and I will be firstly prompt with the IP address that I want to connect to and on my source one I see right here this 192.168.1.122 that's the IP address that I want to connect to so here it is I'm going to change the default one to 122 which is the IP address of the system I want to copy the data from and then I'm going to hit OK and it's going to say restore the whole disk it's going to go reach out over the network and find out what it is I'm going to select the disk I want to copy data to in this case it's going to be a bigger disk and Clonezilla is actually kind of smart in the way that it can kind of expand partitions and be aware of larger disks unlike DD where it just copies every single block but unfortunately this smartness can cause issues as I've had sometimes your Clonezilla won't clone due to some partition or something it doesn't like where on the other hand GD does not care what data the drive has at all it just copies blocks and now Clonezilla is showing me a progress bar on screen of how much data it's copied Clonezilla is actually Smart World actually look at the file system and see how much data is being used and only copy the data that's being used so even though this drive is a 68 gigabyte drive only 58 gigs are used so those 10 gigs don't need to be copied at all this laptop here has some issues of Clonezilla and won't just let me make a clone of it over the network so I'm going to be using dist to vhd which is a little program from Microsoft to take all the data on the drive convert it to a virtual hard drive or vhd file then once that is complete I'm going to take that vhd file copy it onto my proxmox server and use a program to convert it into an image that proximox can work with so the first thing I'm going to want to do is download this to vhd this is from the Microsoft system internal suite and you just click download to get the file in a little zip file I've already ran it here and it's a little program and what you're going to get is a few options first of all which volumes do you want to include if you only have the boot Drive in the system you probably only want to include that but in this case I actually have an external USB drive that I'm going to be copying the image to so I don't want to copy that USB drive onto the actual image so I'm going to uncheck that 953 gigabyte external drive and I have the boot volume and I have the C drive selected on it then I'm going to set the path to something on my external USB drive so we're going to call it like m6600 and it's going to make an image called m6600.vhdx and I'm going to click create once this process is complete I'm going to take my external hard drive with the vhd file on it and plug this up to my proximox system so I can copy it over to the VM now I'm using a laptop that is SSH into the proxmox server so on this system I'm in a directory of a directory file structure in proxmox and I am in the images as in the number of the VM if you don't already have any data that's stored in that you might have to create that number as then I'm going to use a little program called Camille IMG to convert it and this little program can do a lot of conversions from different formats of virtual disks to others you can also take images from things like virtualbox or VMware or other programs and convert them into qcal 2 files that will work in proxmox but in this case I have commute IMG the program either then telling it to convert the file I am saying Dash o which is the output I want to be cue count to and then I'm giving it the input file which is my vhdx file and then again I get the output file which is this laptop drive.q cal2 which will be created now this little process has completed and if I run LS now I can see that I have this laptop drive.qcal2fa now I need to make it so that the VM sees this file and the way I'm going to do that is I'm going to edit the config file of my VM so that config file is located at slash Etc PVE slash commute server as in the number of the vm.com so here I am in right now and I'm going to add a new line I'm going to call it like SATA and one because I already have a Theta 0 device colon the name of the repository that the data is coming from So it's b underscore Sam file in this case colon the VM number for the directory and then slash as in the name of the image that I just created which in this case is laptop drive.qcal2 I then gonna exit from this configuration file editor I'm going to switch over to my system here and now I can see this hard drive Sata one device that was just configured and it says laptop drive.q code2 and I'm going to make another configuration change to the VM and actually set the boot order because by default it's not going to select so the bootable device so I'm just going to say this is the only device it can boot from now and I'm going to click Start and it should just start that VM up right now taking a look it says okay and if I open the console I get a start Windows Up Normally and I'm booting into my Windows 7 system that was cloned from that laptop and it's going to have all the same programs and functionality and here I am at the desktop of the VM it says it's detect a new device driver software it's going to prompt to me about I have a new network card installed because I'm using this E1000 network card instead of what was in the laptop here so it's going to pop up and you might get some issues like now it doesn't have a graphics card that can do 3D acceleration so it has the old style menu but other than those changes I still have all my programs and settings and configuration on this video now I'm going to go over the DD method of copying data from a physical systems hard drive and putting it onto the proxmox system to be used in a VM so in front of me is a system running a Linux live disc so this way it's not modifying any of the data on the internal drive and taking a look at the size of drives I can see this 232 GB byte drive or 250 Gigabyte Drive is my boot drive that contains the Windows operating system also if I open disks in here I can take a look at that 250 Gigabyte drive and see it's an 850 Evo which is the drive that's inside my laptop I can also see the serial number of the device here if I want to verify it with the physical device to make sure it is the correct drive that I'm copying data from and this drive is located at SDA in this Linux system so that's what I'm going to be wanting to copy data from now it's where I want to copy data to there's many places you can copy it to for example like an NFS share or SMB show over the network to the proximox server or you could use like a USB hard drive you just have to have some way of getting a file from the system you're cloning over to the proxmox host and here's the command I'm going to run to copy the data sudo DD if equals Dev SDA so this is the drive number that I'm copying from if means input file of means output file and this directory here is one of my external hard drive is mounted and I can see an LSB OK it's mounted here and it's that one terabyte external hard drive that I have and then I have a couple more commands of BS equals one M which means you use larger one megabyte blocks which makes DD complete faster and Status equals progress which shows me a nice little progress bar when this operation is happening this process is extremely similar to the one I'm going to show in a little bit of where you're going to take a drive plug it into the proximox system and pull an image from that and you're actually going to use the exact same process to add this image to the drive so all you have to do is load this image file that you've created onto the proxmox host and then follow the instructions a little bit later on of how to add that image file in the system to the virtual machine if the system doesn't boot or all you have access to is the boot drive I'm going to be going over how to take this drive make an image from It and Boot It In proxmox so I have this drive from one of my desktops that I pulled I'm going to take this drive and plug it into my proximox server using one of these little USB to SATA adapters this just makes it easy to add this to any system but you can also use like an extra Drive Bay if you have one of those anyway works as long as you can get the drive accessible by the system so you can make an image with it now I plug that drive into my server and I can see that drive now in LSB OK on my proxmox server when I'm sshed in so I can see this drive here at 186 gigabytes and that's the drive that I'm going to want to copy the image from on the other side of this terminal I'm using a little DD command to copy that drive image into an image file that then I can configure proxmox to use so the command I'm going to be using is sudo DD if equal slash Dev sd0 so that's disk drive right here of equals Drive image dot IMG so that's just the name of a file that I'm going to be making that contains the exact same data as that hard drive I set BS equals 1M just makes it faster by doing few bigger blocks instead of lots of little ones and Status equals progress because I like to see a little progress bar when this happens now DD has finished copying the files and I have this drive image.img file and this contains all the data that was stored on the SSD that was in the system block for Block it's an identical copy of the data so I can actually just give this file to the VM and it'll treat it just like that SSD in a different system actually in order to do that I need to rename the file into drive image.graw or any other name.raw because proxmox uses dot raw files I discovered that it used dot raw files by creating a new raw disk and proxmox and seeing how it did it oftentimes if I'm messing with proxmox I'm not sure how to do something I do it in the GUI see how it's done and then edit it with the files that I want to use so in this case I'm gonna have to run a little MV command or move which is going to take my IMG file and make it into the dot raw file so if I run it now and run LS I see drive image.raw now instead of dot IMG so now I can edit the configuration file for the VM and I added the SATA one device that has the name of the storage pool that it's running off the name of the VM and then the actual name of the file that I want to pull off so I'm going to save and exit the text editor that I was using there and now I see it pop up in the web UI now I need to configure the VM to actually boot from that drive so I'm going to go into boot order SATA one and make sure that this drive is configured as the bootable drive and now if I click Start it should just be able to boot up and boot the OS that was on that drive and after fixing a little typo that I had that prevented it from accessing the disk I now have the windows 10 VM that's starting to boot up and it's probably going to do a little bit of detection of the new hardware and changing some of its settings to work with the new devices that I have in this system thanks for watching this video going over how I convert physical systems and virtual systems to proxmox VMS let me know if you used method like cities or other methods you've used and how that has worked out for you
Info
Channel: ElectronicsWizardry
Views: 31,227
Rating: undefined out of 5
Keywords:
Id: 4fP-ilAo_Ks
Channel Id: undefined
Length: 18min 51sec (1131 seconds)
Published: Sat Feb 04 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.