Debian 9: How to set up Samba-Exchange between QEMU-Host and QEMU-Guest (Windows)?

5,240

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

[global]
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

[Shared]
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!

Share:
5,240

Related videos on Youtube

Dave
Author by

Dave

Updated on September 18, 2022

Comments

  • Dave
    Dave almost 2 years

    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:

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