Howto share data between host and guest OS on Qemu with Samba

Prerequisites

 * you must have a windows OS installed under qemu and to know how to launch it
 * you also need samba installed on your computer
 * we suppose that the directory you want to share is on /mnt/windows and it has all the permissions (chmod a+rwx)

Steps
The following steps have been tested on a Debian GNU/Linux host OS using qemu version 0.8 and samba version 3.0.22

[qemu] comment = Windows file space path = /mnt/windows read only = no  public = yes
 * add the following to the /etc/samba/smb.conf file on the host OS :

Before you edit your lmhosts file in Windows 98 or 2000 you should be able to access the samba shared resources on the host if you enter the following ip within windows explorer. \\10.0.2.2

10.0.2.4 smbserver 10.0.2.2 smbserver /etc/init.d/samba restart -smb /mnt/windows To use the shared directory :
 * if you use windows XP as the guest OS, add the following to the C:\WINDOWS\system32\drivers\etc\lmhosts file :
 * if you use windows 98 or 2000 as the guest OS, add the following to the C:\WINDOWS\lmhosts file :
 * restart the samba server :
 * restart the guest OS with the following option to qemu :
 * now you can access the shared directory from the windows explorer :
 * if you use windows XP as the guest OS, open windows explorer and type the location :

\\10.0.2.4\qemu
 * if you use windows 98 or 2000 as the guest OS, open windows explorer and type the location :

\\10.0.2.2\qemu If the Guest operating system is a linux-based OS, you can mount the share with : mkdir -p /mnt/share && mount //10.0.2.2/qemu /mnt/share on the guest OS, into /mnt/share.