April 19, 20242 yr I have a new PC on the way, but want to get started with building the system in a VM. I'm going to install Ubuntu 22.04.4 on it, along with Docker, Tdarr (node), etc etc etc. Basically, what I want to do when the new pc arrives is to connect it's hard drive to the server via a USB adapter, copy/clone the VM to that drive, then install the drive in the PC. I have Ubuntu installing now, but just wanted to see what has to be done for the clone/copy when the time comes.
April 20, 20242 yr Solution Yes its very straight forward. We can use the qemu-img tool to convert a virtual disk image to a physical disk. If the image is a raw image (by default in Unraid it is) then you would use this command qemu-img convert -f raw -O raw /mnt/user/domains/vm_name/vdisk1.img /dev/sdX If the image was a qcow2 image then the command would be qemu-img convert -f qcow2 -O raw /mnt/user/domains/vm_name/vdisk1.img /dev/sdX So the /dev/sdX refers to the disk you want to copy it to. Plug the disk that you want to use for the real machine into the server and it will get a letter. So for instance the /dev/sdg Be careful its the correct one as you dont want to write over an anraid array disk etc. Also just make sure the location of the vdisk for the vm is correct for this part /mnt/user/domains/vm_name/vdisk1.img
April 20, 20242 yr Author 10 hours ago, SpaceInvaderOne said: Yes its very straight forward. We can use the qemu-img tool to convert a virtual disk image to a physical disk. If the image is a raw image (by default in Unraid it is) then you would use this command qemu-img convert -f raw -O raw /mnt/user/domains/vm_name/vdisk1.img /dev/sdX If the image was a qcow2 image then the command would be qemu-img convert -f qcow2 -O raw /mnt/user/domains/vm_name/vdisk1.img /dev/sdX So the /dev/sdX refers to the disk you want to copy it to. Plug the disk that you want to use for the real machine into the server and it will get a letter. So for instance the /dev/sdg Be careful its the correct one as you dont want to write over an anraid array disk etc. Also just make sure the location of the vdisk for the vm is correct for this part /mnt/user/domains/vm_name/vdisk1.img I found your video early this morning on how to do it. I'm building the physical to virtual now. Next will be converting the virtual to physical next. When I set up the new VM (Windows 11) from the now-creating vdisk, other than using the manual setting to select the img file, is there anything else special that I need to do?
September 17, 20241 yr On 7/28/2024 at 6:58 PM, SterlingF said: What Video is this? This is the only video I could find and it's a little after 10mins in. Not the same steps, but it is the same premise. The steps in the video are what worked for me. dd='/mnt/user/domains/Ubuntu/vdisk1.img' of='/dev/sdX' status=progress Edited September 18, 20241 yr by kalyway code
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.