Qemu : Share Folders Between Guest And Host OS

Qemu -smb option does not work on Debian/Ubuntu because of a bug in Samba package. Rebuild the Samba package without the –with-fhs option to work around it. But you still can use samba without “-smb” option. Lets say you have ubuntu as host OS and WindowsXP guest OS.

Install samba server on host OS :

sudo apt-get install samba smbfs

Then make a folder :

mkdir /home/smd/public_share
chmod 777 /home/smd/public_share
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
sudo nano /etc/samba/smb.conf

Find this line :

...
; security = user
...

Replace with :

security = share

Insert the following lines at the end of file :

[public]
comment = Public Folder
path = /home/smd/public_share
public = yes
writable = no
create mask = 0777
directory mask = 0777
force user = nobody
force group = nogroup

save the edited file. then,

sudo testparm
sudo /etc/init.d/samba restart

Now, you can run your guest OS.

qemu -hda winxp.img -localtime -kernel-kqemu -m 384 -boot c

Open your shared folder :

Start Menu -> Run -> \\10.0.2.4\

By default, 10.0.2.4 = host ip and 10.0.2.2 = guest ip.

Further reading about samba http://ubuntuguide.org/wiki/Ubuntu:Feisty#Samba_Server

One Response to “Qemu : Share Folders Between Guest And Host OS”

  1. In windows, when I click the public server I still get

    \\qemu\public is not accessible. You might not have the permission to use this network resource.

Leave a Reply