How to create a share on my Proxmox server to allow direct vhdx uploads

rcscny

New Member
Feb 21, 2024
6
0
1
I need a location to upload virtual drives (disk2vhd files) on my Proxmox server so that I can convert them into Virtual machines. I have 13 File Servers that I need to move from Hyper-V ( I DO NOT have access to the Hyper-V console), we are switching IT companies and the old company will not give us access. Normally I would use Clonezilla, but I don’t have access to the Hyper-V console to allow server to server image.

My Proxmox server is a Dell R630 with 3.5 TB Raid 10 and 256 Gig Ram.
I have a 4TB External USB hard drive that I can attach to my Proxmox server for disk2vhd files.

Ideally I would like to set it up so that I can go to any live computer on my network, and use the ProxMox share as a destination for my disk2vhd files (directly from the machine I am converting).

I have seen many articles/videos regarding creating a local vhdx file on the physical machine, then ftp to the server, then convert, but that seems like too many steps. Can’t I just use a UNC path when creating my vhdx file to go directly from the live computer to the Proxmox share?

My specific question is:

After I attach the 4TB USB drive to my server, how do I make it available to my physical computers to connect to as a share so I can upload images directly?
 
How do you plan to configure these VMs under Proxmox? Is the R630 a hardware raid with LVM storage?

More generally, you don't want your PVE host to be serving up SMB shares, or have any "always-on" access to your production virtual disk storage. There was a thread on here about a month ago about a guy whose VMs were wiped out by a ransomware due to this.

You probably want to use WinSCP or a tool like that to SSH into your host and you can browse the file systems from there.

You can use qemu tools for Windows to convert your VHD/VHDX files to qcow2 or raw
https://cloudbase.it/qemu-img-windows/

Once your disk has been converted, it can be uploaded to your PVE host with WinSCP.
 
Last edited:
then ftp to the server
Hopefully not real FTP or you should never listen to those people again.

There was a thread on here about a month ago about a guy whose VMs were wiped out by a ransomware due to this.
That also came to my mind instantly. I'm glad that person shared their experience.


You can use qemu tools for Windows to convert your VHD/VHDX files to qcow2 or raw
https://cloudbase.it/qemu-img-windows/

Once your disk has been converted, it can be uploaded to your PVE host with WinSCP.
Yes, good idea and would be the toolchain on the physical server aswell.
Doesn't Windows nowadays also ship with ssh and scp availabile in the command line? So you probably could try doing it the pipe way from windows:

Code:
qemu-img convert -p -f vhdx -O qcow2 C:\path\to\the\file | ssh <proxmox> dd of=/path/to/directory/storage/<vmid>/vm-100-disk0.qcow2

example for qcow2 ... depends on your used storage
 
Code:
qemu-img convert -p -f vhdx -O qcow2 C:\path\to\the\file | ssh <proxmox> dd of=/path/to/directory/storage/<vmid>/vm-100-disk0.qcow2
I dont think this will work. qemu-img requires output file as name and does not seem to support stdout.

Code:
qemu-img convert -p  -O qcow2 ./cirros-0.5.1-x86_64-disk.img | ssh pve7demo1 dd of=/tmp/test.qcow
qemu-img: Must specify image file name
sign_and_send_pubkey: no mutual signature supported
0+0 records in
0+0 records out

This may be helpful: https://www.mail-archive.com/qemu-discuss@nongnu.org/msg07868.html


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
The server won’t have any public facing shares…. .. I mentioned FTP because SCP is the recommended upload method (port 22). All transfers would be between private subnets.

The SMB share would be just a way for me to upload the vhdx files directly to the server. There is no room on the target live physical servers to copy an image onto itself, and since they are Hyper-V (with no console access) I can’t connect a USB drive to them either.

I could set up a share on a workstation and convert there, I am just trying to save steps/time.

The plan would be to set up an SMB share on the proxmox server that points to the USB drive.
None of my VM’s or containers would exist on the USB share, its just a temporary holding place while I convert the files. Sending a screenshot.

In VMWare I could run the converter and it would convert directly on the server. I am trying to find the most efficient way to convert live Hyper-V computers to Proxmox VM’s … The best method I have seen so far is Disk2VHD. I would like my output target for disk2vhd to be the usb share on the proxmox server. Once there, I can convert the image from vhdx to qcow and then move to the appropriate local-zfs vm

Hopefully that makes sense… I am new to ProxMox… VmWare discontinued their free licenses and as a result we’re tying to move to this platform.. It has certainly been a learning curve.

Thanks for your help!
proxmox.jpg
 
The plan would be to set up an SMB share on the proxmox server that points to the USB drive.
Its clear you are in an urgent situation where you are not concerned with best practices, nor do you have infrastructure available to pursue better ways. Best case scenario is you'd be talking to a lawyer to claw back access to your data from "rogue" IT provider.

So, given your constraints you can just plug "how to setup smb server on debian" and follow one of many guides online:
https://serverspace.io/support/help/configuring-samba-on-debian/

You may also need to prep the USB disk, ie https://phoenixnap.com/kb/linux-format-usb

Good luck


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
  • Like
Reactions: wbk
I dont think this will work. qemu-img requires output file as name and does not seem to support stdout.
Oh yeah, you're right. It cannot handle stdin/stdout. What a shame.

Nice idea and could work from Windows.

I would like my output target for disk2vhd to be the usb share on the proxmox server. Once there, I can convert the image from vhdx to qcow and then move to the appropriate local-zfs vm
Yes, this works. Just follow the Debian Howto. You should use a private share (with a $ at the end), so that it cannot be browsed. Another security measure would be to restrict to only the hyper-v host.
 
  • Like
Reactions: alyarb
Its clear you are in an urgent situation where you are not concerned with best practices, nor do you have infrastructure available to pursue better ways. Best case scenario is you'd be talking to a lawyer to claw back access to your data from "rogue" IT provider.

So, given your constraints you can just plug "how to setup smb server on debian" and follow one of many guides online:
https://serverspace.io/support/help/configuring-samba-on-debian/

You may also need to prep the USB disk, ie https://phoenixnap.com/kb/linux-format-usb

Good luck


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
I am certainly open to the best way if there is a better method, I am open to it... Once my servers have been converted I plan on removing the USB drive and removing Samba from the server. Do you have a best practice solution that would be better given my circumstance (that does not involve Lawyers)? We haven't started the migration yet, so I am open to whatever would work best and be the safest. I appreciate everyone's feedback
 
I am certainly open to the best way if there is a better method, I am open to it... Once my servers have been converted I plan on removing the USB drive and removing Samba from the server.
Go for it. There is no reason for a further concilium on a design here. You've received sufficient advice.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!