Create an image:

qemu-img create -f raw win10.raw 50G

Open image:

/usr/bin/qemu-system-i386 -boot c -m 1024 \
-hda '$HOME/win10.raw' \
-cdrom  '$HOME/cdrom.iso' -net nic,vlan=0 -net user,vlan=0 -localtime &

Share a directory between host (linux) and guest (windows)

At boot, we indicate qemu we want access to e.g. `$HOME/qemu_share:

qemu -smb $HOME/qemu_share -m 384 -localtime windows.img

Then allow access a real user (in principle, a user in the host):

sudo smbpasswd -a username

And enable user username:

sudo smbpasswd -e username

The directories to which username has access are specified in /etc/samba/smb.conf

[accounts]
comment = Accounts data directory
path = /data/accounts
valid users = usesrname
public = no
writable = yes

And for changes to be taken into account:

sudo /etc/init.d/samba reload

NOTE: If the above command doesn’t work for you, try:

sudo smbd reload