I’ve been working on automating builds in Hyper-V using Powershell and given that for some reason every OS seems to need either a PXE setup or a floppy disk to auto-provision, I took the road that took fewer additional servers/services.
To create virtual floppy disk, perfect for kickstart and unattend.xml files for your operating system of choice, the first part is easy:
New-VFD -Path “C:\mystuff\floppy.vfd”
You should now see a working VFD….HOWEVER, without additional tools you can’t mount and work with that VFD. It’s a bit chicken before the eggy but you need to mount that VFD into a VM to manage it. I ended up with a ‘control’ VM for these purposes, mounting the VFD and writing my files on the guest VM. To attach the VFD to the guest VM:
Set-VMFloppyDiskDrive -VMName $vmName -Path $vfdpath
(where vmName is your VM and vfdPath is the path to the vfd file…I would hope that part was self explanatory).
Now comes the fun part. You’re done with this floppy and need to use it elsewhere, except oh…it’s still mounted. You search up and down for Dismount-VirtualFloppyDrive or something to that effect and come up incredibly short. The solution? Null.
Set-VMFloppyDiskDrive -VMName $vmName -Path $null
There ya go. A freshly dismounted floppy drive.