This is a home setup, for me all this infrastructure has the only purpose to prevent data corruption, data will be duplicated and checksummed by the ZFS filesystem, but on just one physical drive. For helping against data loss caused by hardware failure, I will do a backup copy of the virtual drive with the data on external physical hard drives.

Creating the virtual machine

I created the virtual machine using the Hyper-V management console:

RAM: 1GB,

network: connected to a virtual switch,

virtual hard drive: 32GB - dynamic expansion,

management options: always start at boot time.

Installing and configuring the operating system

I installed FreeBSD on the virtual machine.

I created a non-root user and I added it to the wheel group, so it is possible for me to connect to the system by ssh and to manage it by becoming root using the "su" command.

After installing FreeBSD on a Hyper-V machine I had no network connection.
The solution is to modify rc.conf that DHCP will always work on boot
Edit /etc/rc.conf:
Comment the following with a “#”:
ifconfig_YOURNICID
Add the following:
ifconfig_YOURNICID=”SYNCDHCP media 100baseTX mediaopt full-duplex”
Save
Done

I restarted the operating system and when it was up again, I connected to it and I tested the network connectivity.

I powered off the system with the "poweroff" commmand of the operating system.

Adding a virtual hard disk for the data

From the Hyper-V management console I added a virtual hard disk, which will contain the ZFS filesystem where the data will be stored.
I added it on the IDE controller 1, I created it as a VHDX with dynamic expasion, of 300GB.

I powered on the virtual machine and I used the command "dmesg" to understand the name of the newly added device (the virtual hard disk):