This should do it:
$ qemu-system-x86_64 -net nic -net user,restrict=on,smb=/path/to/shared/folder ...
From the manpage:
Use the user mode network stack which requires no administrator
privilege to run. Valid options are:
If this option is enabled, the guest will be isolated, i.e. it
will not be able to contact the host and no guest IP packets
will be routed over the host to the outside. This option does
not affect any explicitly set forwarding rules.
When using the user mode network stack, activate a built-in SMB
server so that Windows OSes can access to the host files in dir
transparently. The IP address of the SMB server can be set to
addr. By default the 4th IP in the guest network is used, i.e.
In the guest Windows OS, the line:
must be added in the file C:\WINDOWS\LMHOSTS (for windows
9x/Me) or C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS (Windows
Then dir can be accessed in \\smbserver\qemu.
Note that a SAMBA server must be installed on the host OS.
QEMU was tested successfully with smbd versions from Red Hat 9,
Fedora Core 3 and OpenSUSE 11.x.
For this to work,
samba must be installed on the host system; it doesn't need to be configured or running, just the
smbd binary is needed, which will be run with an ad-hoc configuration and no privileges.
In windows 7, you can connect to the shared folder from
Computer -> Add Network Location -> Choose a custom network location -> \\10.0.2.4\qemu.
If windows insists on opening the "Connect to the Internet" wizard, then just close it; the "Add Network Location" wizard is still running, and you can reopen its window by clicking on the taskbar icon.