I want to share a folder on my Debian-host with a Windows-guest. To run the necessary Samba-server I installed the following packages on my host:

  • samba
  • samba-client

All I know right now is that I only need to add some additional lines with the correct input parameters to the file /etc/samba/smb.conf. I access the guest-VM via virt-manager. Now I found a few notes which state that virt-manager can configure the /etc/samba/smb.conf-file automatically.

Unfortunately I am not sure which command(s) I have to use.

Here is one command with -net user,smb=/absolute/path/to/folder \, but I get the error "Command not found".

Would it end in the same way like adapting the /etc/samba/smb.conf-file by myself?

  1. What do I have to type in this file at least?
  2. Which permissions does the exchange-folder require?
  3. How do I have to configure the Windows-guest for getting access to the mentioned folder (Windows-network is already working)?

Here is an example for the additional section in /etc/samba/smb.conf:

path = /home/user/exchange
comment = my shared folder
guest ok = Yes
inherit acls = Yes
read only = No
browseable = Yes

The solution for /etc/samba/smb.conf was way more simple than I expected before:

workgroup = WORKGROUP
security = user
map to guest = Bad User
server string = %h server (Samba, Ubuntu)
dns proxy = No
wins support = Yes
usershare allow guests = Yes
panic action = /usr/share/samba/panic-action %d

comment = Shared Folder for QEMU
path = /home/myusername/Exchange
public = no
browseable = yes
writeable = yes
read only = no
guest ok = yes
force user = myusername

  1. Modify the file /etc/samba/smb.conf depending on your needs. In my case (Debian 9), just add the previous lines below the last existent line of the file.

  2. Restart Samba via terminal: /etc/init.d/samba restart

  3. Mount the now configured shared folder in Windows via "Map Network Drive" --> et voila!


Yes, I tried a Windows10 guest with "-net user,smb" but it would always crash in 5-10 sec so instead I set up a smb shared folder as Dave recommended and "et voila!" worked - the guest was able to see the Samba folder shared by the host with access of as a certain host user (not guest) created for this purpose and eventually mount it as a Z: drive at "\\\Shared". The certain user was needed as the Windows would ask for credentials to connect to the net drive. No need to start the internal Qemu samba then, just the good old "service smb start" is enough. NB: I have not installed any virt-manager or like, only qemu-kvm and qemu-system as my Linux is headless.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.