Here's how I do it. Create an Ubuntu server VM in VirtualBox, I use the bridged adapter for networking, VM will be its own host/IP on the network.
Then install samba.
sudo apt install samba
Also install openssh if not already chosen during setup.
Edit /etc/samba/smb.conf to uncomment/set these settings.
[homes]
browseable = no
read only = no
valid users = %S
Create a user for SMB, use the same username/password as your local Windows user for convenience.
sudo smbpasswd -a username
Restart smbd, this command can vary depending on the VM OS/version.
sudo service smbd restart
Mount the home directory (run this from the Windows command line.) You won't have to provide a password when authenticating, if you set the user/pw as I suggested above.
net use z: \\vm-hostname\vm-username
I run git commands on the Linux side where all code projects live.
You can go in the opposite direction (mount the Windows filesystem from within Linux) but I don't suggest that for the primary use case of code projects, it can introduce problems with permissions. But for one-off use cases I do sometimes mount the Windows filesystem in Linux. That requires following the VirtualBox instructions for installing "Guest Additions" and using the Shared Folders feature.
Run servers on the VM, access web sites/services on the VM hostname through the browser on the Windows side.
Not specific to this setup, but if you want to run a service on port 80 of the VM, run this command on whatever the actualy binary is for the server process. (Not a symlink.)